The linker script had the incorrect regions defined for the RAM that
actually exists on the LPC4337. To fix this I made changes which
include:
I updated to the latest GCC4MBED which includes support for
overriding the linker script provided by the mbed SDK which allows
us to use a custom one for this Smoothie board.
I re-applied the configdefault.o mods to device-common.mk
I added src/LPC4337.ld which is a linker script that contains the
correct region definitions for the FLASH and RAM memory on the
LPC4337.
The Smoothie makefile was modified to use this customized linker
script.
Without this change, the code would HardFault the first time that it
attempted to push anything on the stack since it was initialized to an
invalid region of memory. lpc21isp must leave the stack pointer set to
whatever it uses when ISP is running so that is why the code worked
right after upload.
The linker script had the incorrect regions defined for the RAM that actually exists on the LPC4337. To fix this I made changes which include:
Without this change, the code would HardFault the first time that it attempted to push anything on the stack since it was initialized to an invalid region of memory. lpc21isp must leave the stack pointer set to whatever it uses when ISP is running so that is why the code worked right after upload.