RAM sections

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by IanB on Fri Aug 14 09:00:19 MST 2015
Could someone please tell me the correct assembler directive for allocating RAM into sections? I'm using the automatically generated linker file. _debug.ld

The linker file appears to call the sections .bss, .bss_RAM2 and .bss_RAM3

but if I use the assembler directives:

.section .bss
(memory definitions)
.section .bss_RAM2
(more memory definitions)


The assembler appears to want to put them all in RAM0_4 and then tells me there isn't enough room.

It wants to put the stack at the top of RAM0_4 (understandable, as thats the section that can't be switched off) so I need to leave plenty of room in RAM0_4 and then start on RAM1_4, which I would have expected the directive .section .bss_RAM2 to do.

If I call the section .section .RAM2 the it doesn't know where the address is.

I'm using .bss not .data because all the memory needs to be zeroed and not pre-loaded with any values.