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.

TMS320F280039C: 280039C custom SPI Bootloader

Part Number: TMS320F280039C
Other Parts Discussed in Thread: C2000WARE

Tool/software:

I am currently working on a custom SPI bootloader to load a SPI FLASH kernel into RAM - see previous questions - TMS320F280039C: TI 280039C SPI bootloader - C2000 microcontrollers forum - C2000Tm︎ microcontrollers - TI E2E support forums

I am using the SPI_Boot.c file found here - C:\ti\c2000\C2000Ware_5_02_00_00\libraries\boot_rom\f28003x\rev0\rom_sources\F28003x_ROM\bootROM\source

One of the first function that gets called is:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//
// SPI_start_Boot - Function to begin transmission and copying of data into
// device memory
//
uint32_t SPI_start_Boot(uint16_t gpioSTEA)
{
uint32_t entryAddress;
//
// Enable EEPROM and send EEPROM Read Command
//
(void)SPIA_Transmit_Receive(0x0300U);
//
// Send Starting Address for Serial EEPROM (16-bit - 0x0000,0000)
// or Serial Flash (24-bit - 0x0000,0000,0000)
// Then check for 0x08AA data header, else go to flash
//
if(SPIA_SetAddress_KeyChk() != BROM_EIGHT_BIT_HEADER)
{
return FLASH_ENTRY_POINT;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

where the entry address (32-bit) of the FLASH Kernel in RAM is returned - entryAddress = GetLongData();

To test out my custom SPI bootloader I used hex2000.exe to create a new binary led_ex1_blinky.txt for the led_ex_blinky.application running out of RAM

Looking at the generated binary file in a hex editor

I am trying to understand how this correlates to the entry address that the SPI Boot code returns with this call -  entryAddress = GetLongData() ??

Thanks for any help,

Brent Williams

  • Hi Brent,

    Connecting you with one of our SPI bootloaders experts to assist you further.

    Best Regards,

    Aishwarya

  • Thanks Aishwarya,

    I have been looking at the SPI Boot code

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    uint32_t SPI_start_Boot(uint16_t gpioSTEA)
    {
    uint32_t entryAddress;
    //
    // Enable EEPROM and send EEPROM Read Command
    //
    (void)SPIA_Transmit_Receive(0x0300U);
    //
    // Send Starting Address for Serial EEPROM (16-bit - 0x0000,0000)
    // or Serial Flash (24-bit - 0x0000,0000,0000)
    // Then check for 0x08AA data header, else go to flash
    //
    if(SPIA_SetAddress_KeyChk() != BROM_EIGHT_BIT_HEADER)
    {
    return FLASH_ENTRY_POINT;
    }
    //
    // Check for Clock speed change and reserved words
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Here is the generated .txt file from using the hex2000 utility

    Looking at the SPI Boot code the first thing it reads in is the following:

    Fullscreen
    1
    2
    3
    #define BROM_EIGHT_BIT_HEADER 0x08AAU
    if(SPIA_SetAddress_KeyChk() != BROM_EIGHT_BIT_HEADER)
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    I can see this in .txt file highlighted in red.

    Next in the SPI Boot code I see the following:

    Fullscreen
    1
    2
    // This function reads 8 reserved words in the header.
    SPIA_ReservedFn(void)
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    This would be the blue highlighted words.

    The next part of the SPI Boot code where the application entry point is read in is:

    Fullscreen
    1
    2
    3
    4
    //
    // Get point of entry address after load
    //
    entryAddress = GetLongData();
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    So, is this saying the entry point is 0x00000000 - purple highlighted?

    Also why is there not a SPI flash kernel?

    Thanks,

    Brent

  • If I look at the generic RAM linker command file -

    Fullscreen
    1
    BEGIN : origin = 0x00000000, length = 0x00000002
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    The highlighted purple value 00 00 00 00 => is the beginning address. The following 02 is the "block size". Data for these locations follow this. 

    This all makes sense now.

    I would still like to understand why there is no SPI flash kernel in the C2000Ware?

    Thanks,

    Brent