I was trying to do a call such as:
Code: Select all
chPoolFree(&mp, chCoreAlloc(512));
and was getting an assert failure. Upon further investigation, it looks like chCoreAlloc was returning memory alligned on 4 bytes rather than 8. It, in turn, seems to be doing that because the global variable __heap_base__ (from where nextmem is set) is set to an address of 0x20009f94 which doesn't seem to be aligned on 8 bytes.
Since I'm nothing close to an expert on linker files, what should I be modifying in ch.ld to fix this? Should I replace every instance of "ALIGN(4)" with "ALIGN(8)" in the whole file? Or just for the data (and/or bss) section?
I'm using the linker file as-is from the ARMCM3-STM32F107-GCC demo.
Thanks!