Hi,
this is how to put a function to specific flash segment and to specific RAM segment (the code is copied to RAM by startup files):
MEMORY
{
...
hello_test: org = ..., len = ... //flash segment
code_ram: org = ..., len = ... //RAM segment
...
}
SECTIONS
{
...
.__code_ram (VLECODE) : {} > code_ram
.__hello_test (VLECODE) LOAD(ADDR(hello_test)) : {} > hello_test
...
}
And in C file:
#pragma push
#pragma section code_type ".__hello_test" code_mode=far_abs
void test(void)
{
asm("nop");
}
#pragma pop
#pragma push
#pragma section code_type ".__code_ram" code_mode=far_abs
void test_ram(void)
{
asm("nop");
}
#pragma pop
Regards,
Lukas