2014-04-17 07:12 PM
My fields do not fit in the primary RAM region so I am trying to put some of the fields into CCM but something is not going right.
My .ld file ishttps://svn.code.sf.net/p/rusefi/code/trunk/firmware/config/system/STM32F407xG_CCM.ld
I am using CodeSourcery and I am declaring the field likestatic char pendingBuffer[OUTPUT_BUFFER] __attribute__((section(''.ccm'')));
it works like that, but once I change it to
static char pendingBuffer[10000 + OUTPUT_BUFFER] __attribute__((section(''.ccm'')));
I get an error message
c:/program files (x86)/codesourcery/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld.exe: rusefi.elf section `.bss' will not fit in region `ram'
c:/program files (x86)/codesourcery/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld.exe: region `ram' overflowed by 6408 bytes
But why 'ram' and not 'ccmram'? Because 'bss' goes into 'ram'?
I know that the attribute does something, because all the fields with ccm attribute are not appearing in my .map file.
https://svn.code.sf.net/p/rusefi/code/trunk/firmware_binary/rusefi.map
So, what do I do wrong, what should I be doing to get into the ccm memory region? Why the fields with ccm attribues are not in the .map file is a different question. My makefile and the code are available at2014-04-17 08:22 PM
Put
*(.ccm) *(.ccm.*) In the .ccm section of the linker script Are you using Ethernet/USB? If not why not describe the whole 128KB RAM area instead to breaking it into two?2014-04-18 03:10 AM
I've added these lines into the .ccm section and it now builds! Thank you for the advice
The fields with the ccm attribute are not appearing in the .map file, is that expected behavior - how do I get them in to the .map? Also I've got a messageld.exe: warning: section `.ccm' type changed to PROGBITS
not sure if it's good or bad
2014-04-18 04:51 AM
You'd want to be careful about if the structures you put there are initialized, as then you'd need to put a copy in flash, and managing that.
Might want to consider or AT directives I think there is a ''>CCM >FLASH'' method too, ie data goes to CCM but lives initially in FLASH and is copied out by the startup code. I'm more used to doing this in Keil than GNU/GCC, the latter typically having explicit code to clear/copy static data structures or ctors (constructors in C++)2014-04-28 09:29 AM
Thank you for the ''AT > flash'' hint, I will look into that.
I still have that issue that my __attribute__((section(''.ccm''))) fields are not appearing in the .map file as the other fields are. Any idea what this is about? Unless it's related to the lack of ''AT > flash''