This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SPI Boot

Other Parts Discussed in Thread: CONTROLSUITE, TMS320F28063, UNIFLASH

I want to know how to upgrade firmware from SPI-A using external memory.

I'm referring to the SPI Boot example present in the controlSUITE.

I want to know that can SPI Boot be done through SD card as EEPROM has been mentioned in the technical reference manual.

Is it required to store the .hex file in the SD card by transferring the .hex file from PC to the SD card or is there any other way of doing this,  after setting the programming pins (TRST, TDO, CMP2OUT)?  

Please clarify my doubts. 

  • Hi

    sorry - which device is this for? and can you specify which example exactly you are referring to? 

    Best Regards

    Santosh Athuru

  • Hello,

    Thanks for your reply.

    I'm having TMS320F28063 device.

    In controlSUITE 3.3.9 which I'm having, in that, path is "controlSUITE\libs\utilities\boot_rom\2806x\2806x_boot_rom_v1_1" a program is given for boot ROM.

    I getting errors of memory. I have attached the image of problem window. 

    Please guide me where I'm getting it wrong.

  • Yes, you need to store hex file in SD card. Then use SPI boot to interface device with SD card and boot through SPI.
  • Please check whether linker command file is included in the project.
  • Hi,

    I do have the "TMS320x2806x_boot_rom_lnk.cmd" linker file. I have changed the device properties "general/ main" to TMS320F28063. 

    I was getting error of "Flash2806x_API_V100.lib" file not found. I tried to include the path"C:\ti\controlSUITE_Latest\controlSUITE\libs\utilities\flash_api\2806x\v100a\lib", but after copying the "Flash2806x_API_V100.lib" in the project, the errors reduced. I have attached the image of problems window.

    Is the FlashAPI library required ? As I understand the FlashAPI for F28063 devices is in the Boot ROM.

    For loading the firmware from SD card is this SPI Boot program only required to be loaded ? or can I use it with my other programs ? and then switch the pins of TRST, TDO and CMP2OUT pins.

    Please guide me.

  • Ravi,
    the boot ROM project is not for rebuilding. It is provided only for customers to be able to load symbols from the provided OUT file and do a source level debug of the ROM code.

    Best Regards
    Santosh Athuru
  • Hello Santosh Sir,

    I'm still not clearing getting how to implement a SPI bootloader from SD card. I have seen the settings of TRST=0, OTP KEY=0x005A, OTP BMODE=0x0004 for SPI boot mode select having GPIO37=1, GPIO34=1, as referred in the technical manual.

    I'm not getting what is OTP KEY and OTP BMODE ?

    And after having a .hex/.out of a program will be sufficient or a bootloader program is also required to be loaded in the F28063 device.

    If a bootloader program is required then which example program should I refer ?


    Please help.

  • Ravi,

    For development, use the Emulation Boot flow with a JTAG connected to use SPI boot. Follow the details in the TRM to set the EMU_KEY and EMU_BMODE to get SPI boot selected. The boot ROM has the SPI bootloader already.

    Only use the OTP method when you are confident in your setup. Once OTP is programmed, it will always boot to SPI (or whatever is set). If there is no SPI slave, the boot will default to flash.

    Best Regards
    Chris
  • Sir,

    I'm having the JTAG connected to the device and I have changed the values of "0xD01" location in the GEL file :
    /********************************************************************/
    /* EMU Boot Mode - Set Boot Mode During Debug */
    /********************************************************************/
    menuitem "EMU Boot Mode Select"
    hotmenu EMU_BOOT_SARAM()
    {
    *0xD00 = 0x55AA; /* EMU_KEY = 0x 55AA */
    *0xD01 = 0x0004;
    }
    hotmenu EMU_BOOT_FLASH()
    {
    *0xD00 = 0x55AA; /* EMU_KEY = 0x 55AA */
    *0xD01 = 0x0004;
    }

    I have transferred the .hex file to a SD card, and have checked the read and write from the SD card. I'm turning the power off to on in the JTAG connection, without using debug from CCS.

    The program doesn't seem to get updated. from the SD card.

    Please suggest the necessary changes.
  • Sir,

    What changes in the program is required to detect SPI boot. As you had suggested 

    "the ROM project is not for rebuilding. Please refer to C:\ti\controlSUITE\device_support\f2806x\v151\F2806x_examples_ccsv5\f28069_flash_kernel and you can modify it for SPI as needed."

    I have changed the following the following in the code:

    extern Uint32 SPI_Boot();

       return SPI_Boot();

    I'm getting error when I build the program. The console data:

    _GetWordData ./SPI_Boot.obj


    >> Compilation failure
    makefile:150: recipe for target 'f28069_flash_kernel.out' failed
    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "f28069_flash_kernel.out" not
    built
    gmake: *** [f28069_flash_kernel.out] Error 1
    gmake: Target 'all' not remade because of errors.

    Please suggest the necessary changes.

  • Ravi,

    For the emulation boot, debugger is required. Refer to pages 204/205 of the TRM: www.ti.com/.../spruh18f.pdf

    As for your build error, it looks to be unable to locate that function. Check you made all the appropriate changes in the main.c, SCI_Boot.c, Shared_Boot.c, Boot.h

    Best Regards
    Chris
  • Christopher Chiarella said:


    For the emulation boot, debugger is required. Refer to pages 204/205 of the TRM: www.ti.com/.../spruh18f.pdf

    Sir,

    Does debugger mean JTAG?

    Do I need to set the GPIO37 and GPIO34 pins first ? as for Emulation Boot they are having don't care states.

    How is the EMU_BMODE value changed to "0x0004" ?

    Do I have to Debug with the JTAG connected and do a CPU reset and then resume the program?

    Please help me understand the SPI boot, having .hex file in micro SD card

  • Ravi,

    Yes, a debugging emulator such as JTAG needs to be connected. You don't need to set the pins, it will boot based on the value in EMU_BMODE.
    You can set the BMODE value through the memory window or set it in the gel file. The key and BMODE address are in the TRM.

    Best Regards
    Chris
  • Sir,

    Thanks for taking your time and giving responses for my quires.

    I'm checking the SD card boot with the JTAG connected and CCS is opened. I have seen TRST pin goes high. I have changed the "0xD01" location to "0x0004" in both the GEL file and from memory browse.

    The program doesn't seem to get updated from .hex file which is in SD card. I debug from CCS and then resume (run) the program. I have changed the Emulation to EMULATION_BOOT_FLASH.

    Do I need to change the program also to enable SD card boot ?


    Please suggest the necessary changes. 

  • Ravi,

    Your setup of the emulation values looks correct. I can't comment on your SD card interface since SD boot isn't a default boot method. This will depend on how you are using SPI boot to interface with the SD card. I suggest stepping through the boot and debugging from there.

    Best Regards
    Chris
  • Christopher Chiarella said:


    I suggest stepping through the boot and debugging from there.

    Sir,

    Please can you tell me how to debug the boot?

    One of the TI employee suggested me:

    F2806x ROM SPI mode boot loader initialize the SPI to interface to a serial SPI EEPROM. If the firmware download is to be performed from different device (SD Card) then that device has to mimic serial SPI EEPROM. Moreover, the ROM bootloader can only load the program into device RAM.
    Please refer F28xx ROM bootloader user guide to understand the SPI protocol used by ROM bootloader: http://www.ti.com/lit/ug/spru722c/spru722c.pdf
    Custom flash kernel need to be loaded first to controller RAM by ROM bootloader then flash kernel will take care of loading controller application program form  SD card to internal flash memory, this is explained in the application note: http://www.ti.com/lit/an/sprabv4a/sprabv4a.pdf

    Do i have to load flash kernel program ?
    How do I load a .hex/.out in EEPROM ?
  • Hi Ravi,

    The flash kernel can be loaded from bootloaders or placed in flash and the copied to and run from RAM. The flash kernel will download the flash application and program it into flash.

    There is a hex2000 utility that will convert a .out to a .hex. You can program this into the EEPROM in the format given by the .hex file. This will allow the SPI bootloader to properly read the contents of the EEPROM.

    EEPROM programmation should begin at address 0x0000.

    sal
  • Sir,

    I have generated .hex, by enabling the hex utility and the output format is Intel hex.
    Are there any settings to load the .hex in EEPROM ?
    or
    Is there a sample program to load the .hex in EEPROM ?
    and
    update firmware from EEPROM ?


    Please help.
  • I do not think intel hex is the proper format. I believe we use our our TI hex.

    To load the EEPROM, you will need to write the hex file to the EEPROM using SPI.

    The SPI booloader is written to download the hex file from the EEPROM. This boot loader source code is available in controlSUITE.
    controlSUITE/libs/utilities/boot_rOM

    You can look at that source code and reverse engineer a solution to write to the EEPROM.

    We have an i2c eeprom example in controlSUITE. 

    You can also see the sci_flash_kernel as an example of how to perform a firmware update. Also www.ti.com/.../sprabv4a.pdf

    sal

  • Sir,

    Thanks for the information, but I'm still unclear of the procedure to update firmware using micro SDHC card. I have seen the flash_kernel example in controlSUITE.

    Is it required to program flash with the bootloader program or is the bootloader program present in ROM?
    I want to update firmware without using the OTP values.

    By transferring the TI .hex file in micro SDHC card what should be done after that?

    Is there any document that provides information of the firmware update (with and without JTAG) and an example code for the same?

    Please help and guide me.

    I have updated firmware using CCS Uniflash in F28069, but I'm now trying for micro SDHC card.


    Sorry for the EEPROM programming question, I want to implement firmware upgradation using micro SDHC, as I was unable to do so, I asked about EEPROM, I had seen EEPROM being mentioned in the SPI_BOOT file of boot_rom example.

  • Please see the document above for the serial flash programmer and sci_flash kernel. This will guide you in creating a SPI flash programming algorithm.

    We do not have a lot of information on SD card examples.

    Please open another thread and post your SD card questions on that one. It will be easier for us to track the thread and respond accordingly.

    Regards,
    sal