Building with GCC - success!

News, Setup, Compiling, Flashing, Development

Re: Building with GCC - success!

Postby Max » Fri Oct 28, 2016 1:42 am

I have a fully working build now with pure GCC 5.4.1 (GNU ARM Embedded 5-2016-q3). Using libc_nano, which helps a lot with memory usage over the full libc. Not quite as compact as Crossworks versions, but very close. Using central Makefile for both toolchains, same linker and startup scripts to keep things consistent. Some more testing needs to be done with different board versions and peripherals to ensure memory allocation is good.

Ye, it was very useful to have your previous changes and experience to look at, thanks for that.

Yet another mystery with alignment and printf_float printing garbage is solved... needed to align the actual memory block in which all the tasks stacks and some data structs are:

Code: Select all
uint32_t *ccmHeap[UTIL_CCM_HEAP_SIZE] __attribute__((section(".ccm"))) __attribute__((aligned(8)));

Finally dawned on me after the same code, built with exact same toolchain and options, would run fine when built with one IDE and not another. The only difference was the order in which the object files were passed to the linker. In the version that worked, ccmHeap ended up aligned on 8-byte memory boundary, and the one that didn't had ccmHeap aligned on 4-bytes only. Seems so obvious now.... :roll:

I think printf/scanf float versions need to go though... even libc_nano versions are a bit worse than the Crossworks versions (both code and execution size), and in both cases we can save a lot of precious RAM w/out using them.

Also config write to flash needs some adjustments so it doesn't cause a huge hit on heap memory (~7,600B!). I want to shrink the heap to fit in the STM32F4 16KB memory segment... right now it peaks at 16,500B. ;)

Posts: 2814
Joined: Mon Aug 13, 2012 9:45 pm
Location: Near Ithaca, NY, USA


Return to AQ Firmware

Who is online

Users browsing this forum: No registered users and 5 guests