Hello, All:
I'm trying to define function pointers array:
static const void (*Serial_Func_Table[])(char*) = { SI_Func_1, SI_Func_2, SI_Func_3 };
Despite of "const" memory qualifier, this array is nevertheless located in the RAM, while SI_Func_1, SI_Func_2, SI_Func_3 points to the flash memory. I've checked the table location in the RAM - it is filled by zeros. As a result, my code is not working - functions are not called.
I'm using Infineon XE164FM micro.
This code was ported from my another project on ST10F269. In that MCU this array is located in the flash area and working as expected.
The question is: How to locate function pointers array in the flash space for XE164FM?
I don't work with your architecture, but don't the compiler manual have a description of what architecture-specific keywords it supports for forcing symbols to be stored in specific memory spaces?
const just means that the variable should not be allowed to be changed. Some compilers/linkers may decide to use this as information to locate the variable in the code flash. But that is not something that are required by the C language standard. The language standard doesn't even know that there is a difference between code space and data space. All it knows is that you aren't guaranteed to be able to mix between code and data pointers.