You might have a read at the following articles and the discussions there:
https://mcuoneclipse.com/2013/07/10/freertos-heap-with-segmented-kinetis-k-sram/
https://mcuoneclipse.com/2017/09/18/using-multiple-memory-regions-with-the-freertos-heap/
Basically the reason is that there are two/multiple mermory controllers. That way a better memory performance could be achieved.The important point is that you shall not combine the two memory areas, to prevent a variable/object crossing that memory boundary. Otherwise you will see a hard fault.
More details in the above articles, and as well ways how to use both memory areas.
I hope this helps,
Erich
Hello,
Please take a look to these websites. I believe you can find useful information that might help you.
https://developer.arm.com/documentation/ka002853/latest
https://community.nxp.com/t5/Kinetis-Microcontrollers/Store-a-variable-in-ROM-FLASH/m-p/328690
Have a good day, Daniel.
I can see that you are declaring an array and storing data at the same time. Could you please try declaring the variable with the desired address first, and once it is declared, store the respective data to the variable?
Also verify that the address is not overlapped with your code in RAM.
Regards, Daniel.
Hello,
I just tried the following example and it worked on my side. Could you please help us verify that you are trying to write in a valid memory address?
const uint8_t TEST[4] __attribute__((aligned(0x00004000))) = {'T', 'E', 'S', 'T'};
Regards, Daniel.
I’m dropping you some information that can be useful to solve your problem.
You will probably need to modify the linker file.
https://mcuoneclipse.com/2012/11/01/defining-variables-at-absolute-addresses-with-gcc/
https://mcuoneclipse.com/2016/11/01/getting-the-memory-range-of-sections-with-gnu-linker-files/
https://community.nxp.com/t5/S32-Design-Studio/How-to-wirte-the-data-to-absolute-address/m-p/782831
Best regards, Daniel.