Other Parts Discussed in Thread: HALCOGEN
Tool/software: TI C/C++ Compiler
Trying to make something useful out of the bootloader I found in:
This will allocate 2 MB for the Bootloader which makes it useless.
I plan to allocate 48 kB initially, using the first 3 x 16 kB sectors of Flash 0.
I cannot program the flash and execute code from the same flash, to the plan is to start from flash
and use ramfuncs.
I declare a number of functions to execute from RAM.:
Set the compiler to add the switch "--ramfunc=on"
In the Linker command file I set:
MEMORY {
...
RAMFUNC (RWX): origin=0x08070000 length=0x00010000
...
}
SECTIONS {
...
.binit align(32) : {} > FLASH0
.status align(32) : { __APP_STATUS_ADDRESS = .; } > STATUS
.app align(32) : { __APP_START_ADDRESS = .; } > APP0 | APP1
.TI.ramfunc align(32) : {} load=FLASH0, run=RAMFUNC, table(BINIT)
...
}
In the map file, I get the .TI.ramfunc section
* 0 00000040 00006470 RUN ADDR = 08070000
00000040 00000af0 HL_sci.obj (.TI.ramfunc)
...
I also get a .binit section with a copy table
.binit 0 00007c40 00000010
00007c40 00000010 (.binit)
LINKER GENERATED COPY TABLES
__TI_cinit_table @ 00007c30 records: 2, size/record: 8, table size: 16
.data: load addr=00007c00, load size=00000015 bytes, run addr=08001500, run size=00000431 bytes, compression=lzss
.bss: load addr=00007c28, load size=00000008 bytes, run addr=08001940, run size=000000c8 bytes, compression=zero_init
binit @ 00007c40 records: 1, size/record: 12, table size: 16
.TI.ramfunc: load addr=00000040, load size=00006470, run addr=08070000, run size=00006470, compression=none
I can see that the ramfunc symbols are defined in RAM
08070000 sciInit
080701d4 sciSetFunctional
080701f4 sciSetBaudrate
08070290 sciIsTxReady
Have a few questions:
- WHERE are the ramfuncs copied from Flash into SRAM?
- Do I need to do the copy in the application?
- Can the compiler generate code which calls the F021_API_CortexR4*.lib ?
- If so, how do I make sure that all such F021 code runs from SRAM?
- The Bootloader uses the RTI, but the RTI code and all other HALCoGen generated code should not run from flash.
- It should be possible to specify that interrupt handlers are RAMFUNCs in HALCoGen
- Is there an example where you replace an interrupt handler in the VIM?