Hi,
I tried to change the managed linker script option to fully use my SRAMs. I found out that I'm unable to place data in AHB Sram (RAM3) even when using __DATA() macro. This is the situation:
=> INITIAL when my data is correctly placed in RAM3:
1. My memory configuration:
2. My linker setting:
3. Compilation result is correct, my 12KB data is in RamAHB32:
=> AFTER I Changed the Global data placement setting:
1. My linker setting:
2. The new compilation result where my data is placed into RAM instead of RAM3:
Would appreciate if anyone could point my mistake. Here is my test source code:
#include "chip.h"
#include <cr_section_macros.h>
#include <stdint.h>
static volatile __DATA(RAM3) uint8_t ucLwipHeap[12000];
int main(void) {
SystemCoreClockUpdate();
ucLwipHeap[0] = 123;
ucLwipHeap[5] = 99;
volatile static int i = 0 ;
while(1) {
i++ ;
}
}
Thanks in advance,
UAZ
I don't think you have done anything wrong as such, but it does look like you have encountered an interesting quirk in the way that changing the global data placement region in the managed linker script can interact with the __DATA() macro.
Two possible ways to "workaround" this issue would be to do either of the following:
Regards
MCUXpresso IDE Support
Hi,
I did the first workaround and it worked. The latter did not help.
I think I know the real issue here. Global Data MUST be configured to default, in order to be able to use custom data placement. So we just need to make sure to reorder the RAM configuration so that Global Data can be configured as Default.
Regards,
UAZ