4 Replies Latest reply on May 2, 2017 3:17 AM by MichelleC_Intel

    D2000 bootload process clarifications

    LonGlazner

      Hi,

       

      I would like some clarifications regarding the bootloader and bootload process.

       

      First, we're developing a D2000 based circuit board to be used in an internal project at Intel.  The design implements a JTAG connection that matches that found on the D2000 evaluation board. 

       

      1.  I'm assuming that when we purchase D2000 parts from a distributor the bootloader will not be pre-programmed into the IC.  I'm also assuming that in Intel System Studio for Microcontrollers the Project>Update Microcontroller ROM is the process by which the bootloader is programmed into the D2000.  Can somebody verify these assumptions?

       

      2.  In these forums I've seen that in the event that the JTAG functionality is disabled in firmware, grounding GPIO13 can "unbrick" it (D2000 GPIO13 UART_A_RXD, Arduino pinout DIO_0).  In section 3.2.1 of the Software Interface Bootloader User Guide it states the GPIO13 and GPIO2 "do not ground" (Table 6 under Notes).  I assume this means on reset.  This seems to indicate that the firmware management mode is active on the D2000.

       

      Section 4 through 6 of the bootloader user guide discusses the firmware management mode and using a DFU utility to program the D2000.  The document states...

       

      "The FM GPIO pin is the pin used to put the device into FM mode. To enter FM mode, the

      device must be reset manually by pressing the reset button while the FM GPIO pin is

      grounded. To exit FM mode, unground the FM GPIO pin and press the reset button. The

      device cannot exit FM mode while the FM GPIO pin is grounded.

       

      Intel advises you not to use the FM GPIO pin in a FM-enabled ROM. Otherwise, the

      board is likely to reboot and enter FM mode unexpectedly."

       

      The way I read the document is that the D2000 may use the JTAG interface to program in the bootloader.  But, if during development, you disable JTAG in firmware you need to use the DFU interface to re-enable the JTAG.  Is that the case?  This would also seem to restrict the FM pin (D2000 GPIO2, Arduino pinout D5) to being an input that must be high on power-up or reset.  There's no mention of grounding GPIO2 in the forums to re-enable JTAG (only GPIO13). 

       

      It would be great if I could get some explicit advice on the uses of these different bootloader/interface options, and the best way to initially program in the bootloader.  

       

      Thanks,

       

      Lon     

        • 1. Re: D2000 bootload process clarifications
          SergeyK

          Hi Lon,

           

          1. Your assumption is correct. Quark D2000 will come from the distributor not programmed, and you'll need to program the boot loader and possibly the rest of your firmware using JTAG. Another option - program a DFU/Firmware Management-enabled boot loader using JTAG, and then use qm-dfu utility to program the firmware.

           

          2. On the reset, Quark D2000 has JTAG signals routed to the pins, but later on the user firmware can reprogram pin multiplexers, and use these pins for other purposes. This will make interface JTAG unavailable, and therefore it won't be possible to reprogram the microcontroller. Another scenario - JTAG pins get disabled when MCU enters a sleep mode, and if the firmware enters sleep mode very quickly, it won't be possible to attach to the MCU with the JTAG.

          As a workaround, the boot loader checks the logic level on pin  GPIO13 (UART_A_RXD). And it will spin in the loop as long as the logic level is LOW, allowing JTAG debugger to connect. So, if the Quark D2000 board gets "bricked", for example by the firmware which changes the JTAG pin multiplexers right away, it is possible to unbrick it by connecting GPIO13 pin to the ground and resetting the board.

           

          The FM mode serves a different purpose, although I think it can be used to "unbrick" the device as well. To enable the FM mode, it is needed to recompile the boot loader with ENABLE_FIRMWARE_MANAGER=uart option. The boot loader source code and the instructions are here: GitHub - quark-mcu/qm-bootloader: Quark MCUs Bootloader and Firmware Manager

          During the boot process, the FM mode enabled boot loader checks the logic level on pin GPIO2 (which is connected to the user button on the D2000 CRB), and if the logic level is LOW, it will enter the FM mode, which for example allows flashing the firmware over serial port using qm-dfu utility. The qm-dfu utility source code is here: GitHub - quark-mcu/qm-dfu-util: UART-based dfu-util for Quark MCUs

          Since it enters the FM mode before running the user firmware, the JTAG signals will still be routed to the pins, so it should be possible to re-program the MCU using JTAG programmer as well.

           

          Thanks,

          Sergey

          1 of 1 people found this helpful
          • 2. Re: D2000 bootload process clarifications
            MichelleC_Intel

            Hi Lon,

             

            You may find some additional useful information in the Bootloader User Guide -  http://www.intel.com/content/dam/www/public/us/en/documents/guides/software-interface-bootloader-user-guide.pdf

             

             

            - Michelle.

            1 of 1 people found this helpful
            • 3. Re: D2000 bootload process clarifications
              LonGlazner

              Thank you both for the responses.

               

              From what you are saying it sounds like I do not need the bootloader's  FM mode, and it is not enabled in the bootloader by default.  As long as I have a means of ground the GPIO13 (a jumper) I can recover from any firmware development mistakes that disable the JTAG functionality.   I was concerned that in the software interface bootloader user guide it states not to ground GPIO2, and my design has the potential for this io to be grounded on reset.

               

              Lon  

              • 4. Re: D2000 bootload process clarifications
                MichelleC_Intel

                Hi Lon,

                 

                The only thing to be aware of is that with the latest version of the Bootloader available on GitHub the Firmware Manager is enabled by default if you do not specify any FM option when building the code.

                If you want to use that version then disable the FM using the option  'ENABLE_FIRMWARE_MANAGER=none'

                 

                You can tell which ROM's have the FM enabled as it will be evident from the name of the .bin file - quark_se_rom_fm_hmac.bin

                 

                - Michelle.