Hi,
I want to write create a custom firmware update function to write a binary image into the Flash of a F2806x processor.
I transfer the binary image from a different processor to the F2806x via the McBSP (SPI mode) and the DMA controller say 1024 bytes at a time.
These 1024 bytes are stored in a Buffer at the F2806x side.
Using the Flash API i want to write these bytes to the corresponding address in FLASH where the binary must end up ( start at 0x3D8000 ),
this offset is known in the firmware update application.
uint16_t* pointer = &Buffer
so: Flash_Program( 0x3D8000, &Buffer, 512 )
next write is then Flash_Program ( 0x3D8000 + 512, pointer + 512, 512 )
What i would like to have is a binary that contains the Flash Content of the application, which is located at Flash Address 0X3D8000 and has length 0xBFFE
( FLASH_ASW_ENTRY + FLASH_ASW ) I then add two bytes (using a costum checksum tool) so the total size of the binary ends up being 0xC000 or in 8 bit
address space a length of 0x18000.
To create an *.out file i use the following linker command file settings
MEMORY
{
PAGE 0 :
FLASH_ASW_ENTRY (R) : origin = 0x3D8000, length = 0x000002 /* Application code entry */
FLASH_ASW (R) : origin = 0x3D8002, length = 0x00BFFC /* Application */
FLASH_ASW_CS (R) : origin = 0x3E3FFE, length = 0x000002 /* Application checksum */
etc.....
}
SECTIONS
{
.branch_entry_point : > FLASH_ASW_ENTRY, PAGE = 0
.copy_sections : > FLASH_ASW, PAGE = 0
.text : > FLASH_ASW, PAGE = 0
.cinit : LOAD = FLASH_ASW, PAGE = 0
, RUN = LRAM, PAGE = 0
, LOAD_START(_CInit_LoadStart)
, RUN_START(_CInit_RunStart)
, SIZE(_CInit_Size)
.const : LOAD = FLASH_ASW, PAGE = 0
, RUN = LRAM, PAGE = 0
, LOAD_START(_Const_LoadStart)
, RUN_START(_Const_RunStart)
, SIZE(_Const_Size)
.econst : LOAD = FLASH_ASW, PAGE = 0
, RUN = LRAM, PAGE = 0
, LOAD_START(_EConst_LoadStart)
, RUN_START(_EConst_RunStart)
, SIZE(_EConst_Size)
.pinit : LOAD = FLASH_ASW, PAGE = 0
, RUN = LRAM, PAGE = 0
, LOAD_START(_PInit_LoadStart)
, RUN_START(_PInit_RunStart)
, SIZE(_PInit_Size)
.switch : LOAD = FLASH_ASW, PAGE = 0
, RUN = LRAM, PAGE = 0
, LOAD_START(_Switch_LoadStart)
, RUN_START(_Switch_RunStart)
, SIZE(_Switch_Size)
RamFunction : LOAD = FLASH_ASW, PAGE = 0
, RUN = LRAM, PAGE = 0
, LOAD_START(_RamFunction_LoadStart)
, RUN_START(_RamFunction_RunStart)
, SIZE(_RamFunction_Size)
.const_cla : LOAD = FLASH_ASW, PAGE = 0
, RUN = LRAM_CLA, PAGE = 0
, LOAD_START(_ConstCla_LoadStart)
, RUN_START(_ConstCla_RunStart)
, SIZE(_ConstCla_Size)
Cla1Prog : LOAD = FLASH_ASW, PAGE = 0
RUN = LRAM_CLA, PAGE = 0
LOAD_START(_Cla1funcs_LoadStart),
RUN_START(_Cla1funcs_RunStart),
RUN_END(_Cla1funcs_RunEnd),
SIZE(_Cla1funcs_Size)
etc...
I expect a binary with the size of 0xC0000 - 0x02 ( application without checksum) in 16 bit address space. (in 8 bit address space 0x18000).
QUESTION:
How can i instruct Hex2000 tool to create such a raw binary file that i can copy and use directly in the Flash API.
hex2000 -o outputfile.bin --map=outputfile.map release_hex.cmd inputfile.out
release_hex.cmd:
--image
--zero
--issue_remarks
--binary
ROMS
{
APPLICATION_BINARY: org = 0x0, len = 0xBFFE, romwidth = 8,
memwidth = 8, fill = 0xFF
files = { output.8b}
}
SECTIONS
{
.branch_entry_point :
.copy_sections :
.text :
.cinit :
.const :
.econst :
.pinit :
.switch :
RamFunction :
.const_cla :
Cla1Prog :
}
But in the ROM stage i get errors because address do not match the sections do not match the ROM origin,
Should i multiply every address in the hex command file by 2? --> --binary is 8 bit and linker command is 16 bit?
Translating to Binary format...
"output/release/f28x_application.out" ==> .branch_entry_point
warning: section output/release/f28x_application.out(.branch_entry_point) at
07b0000h falls in unconfigured memory (skipped)
"output/release/f28x_application.out" ==> RamFunction
warning: section output/release/f28x_application.out(RamFunction) at 07b0004h
falls in unconfigured memory (skipped)
"output/release/f28x_application.out" ==> .text
warning: section output/release/f28x_application.out(.text) at 07b8278h falls
in unconfigured memory (skipped)
"output/release/f28x_application.out" ==> Cla1Prog
warning: section output/release/f28x_application.out(Cla1Prog) at 07bf980h
falls in unconfigured memory (skipped)
"output/release/f28x_application.out" ==> .econst
warning: section output/release/f28x_application.out(.econst) at 07c0424h falls
in unconfigured memory (skipped)
"output/release/f28x_application.out" ==> .cinit
warning: section output/release/f28x_application.out(.cinit) at 07c0d84h falls
in unconfigured memory (skipped)
"output/release/f28x_application.out" ==> .copy_sections
warning: section output/release/f28x_application.out(.copy_sections) at
07c0e36h falls in unconfigured memory (skipped)
"output/release/f28x_application.out" ==> .switch
warning: section output/release/f28x_application.out(.switch) at 07c0ed0h falls
in unconfigured memory (skipped)
"output/release/f28x_application.out" ==> .pinit
warning: section output/release/f28x_application.out(.pinit) at 07c0f68h falls
in unconfigured memory (skipped)
Should i try this? Because it then complains that the paddr for the sections is not specified?
ROMS
{
APPLICATION_BINARY: org = 0x7B000, len = 0x18000, romwidth = 16,
memwidth = 16, fill = 0xFFFF
files = { output.16b}
}
Hope you could help me out, i want a nice way to configure this conversion so i don't need
any other tools / toolchain in the future.
I do not want a hex or text file that describes the address range and requires parsing of the file.
I tried reading the spru13e.pdf but could not figure out the correct conversion procedure / command file.
Regards,
Rob