I'm trying to create a global variable in a memory section which points to external PSRAM (0x11000000). I have done this by creating a new section in the ld script after .binary_info:
And then utilizing it in the code:
The problem with this is that it also allocates into .bss. I can see this when I use `size build/elf.elf`. If I make it larger than the internal memory it complains:
However, if I run with a size which fits, then in the debugger I can see that it appears at the correct address in the external memory. So it apparently gets allocated twice, once in .bss and again in .extram. I'm not sure how to prevent this.
Code:
.extram (NOLOAD) : { . = ALIGN(4); __extram_start__ = .; *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.extram*))) . = ALIGN(4); __extram_end__ = .; } > EXTRAMCode:
uint8_t audio_buffers[2][AUDIO_BUFFER_SIZE * REPETITION_RATE * 2U] __attribute__ ((section(".extram"))) = {0};Code:
/home/x/memmap.ld:250 cannot move location counter backwards (from 2013e32c to 2007e000)Statistics: Posted by empathicqubit — Tue Oct 29, 2024 9:29 am — Replies 0 — Views 19