Tool/software: TI C/C++ Compiler
I like to setup a group of function to a specific memory by using the pragma CODE_SECTION
In the source file I used the CODE_SECTION pragma like this
#pragma CODE_SECTION(initBuffer, "my_sect")
void initBuffer(void);
In the linker cmd file I made a section
my_sect: > FLASH, LOAD_START(_RamfuncsLoadStart), LOAD_END(_RamfuncsLoadEnd), RUN_START(_RamfuncsRunStart)
and the map file looks like this
my_sect 0 00000f9c 00000014
00000f9c 00000014 test_sm.obj (my_sect:initBuffer)
...
address name
------- ----
00000f9d initBuffer
My problem now is that the function initBuffer() is at the address 0xF9D but the variable _RamfuncsRunStart or even _RamfuncsLoadStart have the address 0xF9C.
If I try to run the functions like this
uint32_t _RamfuncsLoadStart; uint32_t _RamfuncsLoadEnd; uint32_t _RamfuncsRunStart; typedef void (*fctCall)(); fctCall fCall; extern void initBuffer(void); void testFctCall(void) { fCall = initBuffer; // works fCall(); fCall = (fctCall)&_RamfuncsRunStart; // works not fCall(); }
will not work.