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.

CCS/TMS320F28388D: [CM] How to make boot image and load another flash sector?

Part Number: TMS320F28388D
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Hi sir,

I'm using 28388D ControlCARD kit.

I want to make custom bootloader in specific flash area and jump another flash area which is loaded by bootloader.

So I have referenced 28379D SCI flash kernel examples in C2000ware and have loaded image into the flash using SCI_boot() function. (Use only the parsing part of the boot image)

I used 2 projects(bootloader,app) here.

The situation currently being tested is as follows.

As far as I understand, CM cannot create SCI boot images. So I experimented like this:
1) In the APP project, I created  .txt file in -GPIO8, -b format - (Success)
2) Convert the txt image to an Array and allocate it into the RAM data section - (Success)
3) Write to Flash by referring to SCI flash kernel program(DFU) - (Failed)
4) Branch and check program operation - (Failed)

I set bootloader project .cmd files as follows :

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

MEMORY
{
/* Flash sectors */
CMBANK0_RESETISR : origin = 0x00200000, length = 0x00000008 /* Boot to Flash Entry Point */
FLASH_BOOTLOADER : origin = 0x00200008, length = 0x0000BFF8

C1RAM : origin = 0x1FFFC000, length = 0x00001FFF
C0RAM : origin = 0x1FFFE000, length = 0x00001FFF

BOOT_RSVD : origin = 0x20000000, length = 0x00000800 /* Part of S0, BOOT rom will use this for stack */
S0RAM : origin = 0x20000800, length = 0x000037FF
S1RAM : origin = 0x20004000, length = 0x00003FFF
DATARAM : origin = 0x20008000, length = 0x00007FFF
//S2RAM : origin = 0x20008000, length = 0x00003FFF
//S3RAM : origin = 0x2000C000, length = 0x00003FFF
E0RAM : origin = 0x20010000, length = 0x00003FFF

CPU1TOCMMSGRAM0 : origin = 0x20080000, length = 0x00000800
CPU1TOCMMSGRAM1 : origin = 0x20080800, length = 0x00000800
CMTOCPU1MSGRAM0 : origin = 0x20082000, length = 0x00000800
CMTOCPU1MSGRAM1 : origin = 0x20082800, length = 0x00000800
CPU2TOCMMSGRAM0 : origin = 0x20084000, length = 0x00000800
CPU2TOCMMSGRAM1 : origin = 0x20084800, length = 0x00000800
CMTOCPU2MSGRAM0 : origin = 0x20086000, length = 0x00000800
CMTOCPU2MSGRAM1 : origin = 0x20086800, length = 0x00000800
}

SECTIONS
{
.resetisr : > CMBANK0_RESETISR
.vftable : > FLASH_BOOTLOADER /* Application placed vector table in Flash*/
.vtable : > S0RAM /* Application placed vector table in RAM*/
.text : >> FLASH_BOOTLOADER,ALIGN(8)
.cinit : > FLASH_BOOTLOADER,ALIGN(8)
.pinit : >> FLASH_BOOTLOADER,ALIGN(8)
.switch : >> FLASH_BOOTLOADER,ALIGN(8)
.sysmem : > S0RAM

.stack : > C1RAM
.ebss : > C1RAM
.econst : >> FLASH_BOOTLOADER,ALIGN(8)
.esysmem : > C1RAM
.data : > S0RAM
.bss : > S0RAM
.const : >> FLASH_BOOTLOADER,ALIGN(8)

DataBufferSection : > DATARAM


MSGRAM_CM_TO_CPU1 : > CMTOCPU1MSGRAM0, type=NOINIT
MSGRAM_CM_TO_CPU2 : > CMTOCPU2MSGRAM0, type=NOINIT
MSGRAM_CPU1_TO_CM : > CPU1TOCMMSGRAM0, type=NOINIT
MSGRAM_CPU2_TO_CM : > CPU2TOCMMSGRAM0, type=NOINIT

.TI.ramfunc : {} LOAD = FLASH_BOOTLOADER,
RUN =S1RAM|E0RAM,
LOAD_START(RamfuncsLoadStart),
LOAD_SIZE(RamfuncsLoadSize),
LOAD_END(RamfuncsLoadEnd),
RUN_START(RamfuncsRunStart),
RUN_SIZE(RamfuncsRunSize),
RUN_END(RamfuncsRunEnd),
ALIGN(8)
}

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

 

and here is an app project cmd files as follows :

 -----------------------------------------------------------------------------------------------------------------------------------------------------------------

MEMORY
{
/* Flash sectors */
CMBANK0_RESETISR : origin = 0x00220000, length = 0x00000008 /* Boot to Flash Entry Point */
FLASH_APP : origin = 0x00220008, length = 0x00073FF8

C1RAM : origin = 0x1FFFC000, length = 0x00001FFF
C0RAM : origin = 0x1FFFE000, length = 0x00001FFF

BOOT_RSVD : origin = 0x20000000, length = 0x00000800 /* Part of S0, BOOT rom will use this for stack */
S0RAM : origin = 0x20000800, length = 0x000037FF
S1RAM : origin = 0x20004000, length = 0x00003FFF
S2RAM : origin = 0x20008000, length = 0x00003FFF
S3RAM : origin = 0x2000C000, length = 0x00003FFF
E0RAM : origin = 0x20010000, length = 0x00003FFF

CPU1TOCMMSGRAM0 : origin = 0x20080000, length = 0x00000800
CPU1TOCMMSGRAM1 : origin = 0x20080800, length = 0x00000800
CMTOCPU1MSGRAM0 : origin = 0x20082000, length = 0x00000800
CMTOCPU1MSGRAM1 : origin = 0x20082800, length = 0x00000800
CPU2TOCMMSGRAM0 : origin = 0x20084000, length = 0x00000800
CPU2TOCMMSGRAM1 : origin = 0x20084800, length = 0x00000800
CMTOCPU2MSGRAM0 : origin = 0x20086000, length = 0x00000800
CMTOCPU2MSGRAM1 : origin = 0x20086800, length = 0x00000800
}

SECTIONS
{
.resetisr : > CMBANK0_RESETISR
.vftable : > FLASH_APP /* Application placed vector table in Flash*/
.vtable : > S0RAM /* Application placed vector table in RAM*/
.text : >> FLASH_APP,ALIGN(8)
.cinit : > FLASH_APP,ALIGN(8)
.pinit : >> FLASH_APP,ALIGN(8)
.switch : >> FLASH_APP,ALIGN(8)
.sysmem : > S2RAM

.stack : > C1RAM
.ebss : > C1RAM
.econst : >> FLASH_APP,ALIGN(8)
.esysmem : > C1RAM
.data : > S3RAM
.bss : > S3RAM
.const : >> FLASH_APP,ALIGN(8)

MSGRAM_CM_TO_CPU1 : > CMTOCPU1MSGRAM0, type=NOINIT
MSGRAM_CM_TO_CPU2 : > CMTOCPU2MSGRAM0, type=NOINIT
MSGRAM_CPU1_TO_CM : > CPU1TOCMMSGRAM0, type=NOINIT
MSGRAM_CPU2_TO_CM : > CPU2TOCMMSGRAM0, type=NOINIT

.TI.ramfunc : {} LOAD = FLASH_APP,
RUN = S0RAM | S1RAM | S2RAM,
LOAD_START(RamfuncsLoadStart),
LOAD_SIZE(RamfuncsLoadSize),
LOAD_END(RamfuncsLoadEnd),
RUN_START(RamfuncsRunStart),
RUN_SIZE(RamfuncsRunSize),
RUN_END(RamfuncsRunEnd),
ALIGN(8)
}

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

I have referenced SPRU513V docs and check data in to the copydata() functions in sci kernel program.

When debugging data in the copydata() function of the sci kernel program, it was confirmed that the key value, reserve value, enry point, length of word, address of the first block are read normally.

I also checked that the values are written to the flash.

However, when I checked the hex value to be parsed, it was confirmed that there was strange destination address in array data.

I am wondering what I did wrong.

Question is,

1. As pictured above, is it correct that I understand the boot loader?

2. How do I convert the CM image and apply it to my kernel program?

3. Is it correct to set .cmd file ?

4. How to excute reset vector? 

I really want to know how to update firmware about CM.( Since the program size is large, IPC RAM boot will not be used.)

Thanks and Regards.

  • Hi 

    We are in the process of analyzing the issue you have reported.  Can you answer the following questions to help us understand the issue better.

    1. Are you using CCS?

    2. What boot mode are using and how is the boot mode configured?

    3. Are you able to download your application into flash memory and run your CM application from flash using flash boot mode (GPIO72 and GPIO84, set to 11)

    Thanks,

    Krishna 

  • Hi,Krishna.

    Thank you for your fast reply.

     

    1. Yes, I'm using CCS10.1 IDE.

    2. Yes. I'm using Flash boot mode. I set "Device_bootCM(BOOTMODE_BOOT_TO_FLASH_SECTOR0)" in the CPU1 and loaded into the CPU1 previously. And then I loaded bootloader project into the CM.

    3.  Yes. What I've tested sequence is,

    1) Set boot mode from GPIO(GPIO72 and GPIO84, set to 11).

    2) load them in different flash memory areas via the debugger (XDS100v3).

    3) terminat the debug mode in CCS.

    4) Power off and on

    5) Check boot to first flash area(boot project) and branch to app project

    6) App program works well.

     

    Thanks and regards.

    Jude

  • Hi Jude, 

    One thing I wanted to clarify - were you able to run the application from Flash using the same hex file that you are showing has strange addresses for the memory blocks? 

    In order to stream the application into Flash, I think you will have to make use of the message RAM between CPU1 and CM and transfer the data over in chunks. You will need to develop a protocol that lets CM know when CPU1 has filled the message RAM and lets CPU1 know when CM has emptied the message RAM. You can use IPC flags for this. 

    Thanks, 

    Anu

  • Hi, Anu.

    Sorry for the late reply.

    were you able to run the application from Flash using the same hex file that you are showing has strange addresses for the memory blocks? 

    ->  The .hex file has been converted to a boot image. Does this mean that the program runs normally when loaded in CCS debugging mode?

     

    Thanks and Regards.

    Jude.

  • Jude, 

    Are you programming the .out file for the application into Flash in the sequence you mentioned above? I believe that should be fine. 

    In order to stream the application into Flash, you'll need to develop a protocol as mentioned above where CPU1 uses the message RAM to transfer over the data to CM, and both cores can use IPC flags for communication with each other. 

    Thanks,

    Anu