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.