2014-08-14 09:01 AM
I use a single assembly module for startup, but this module may be used for different CPUs of the STM32F4xxx family.
Since some micros have more memory than others, I need to set the Heap_Size differently depending on the CPU defined in the project ''Target Device''.I tried this:IF :DEF: STM32F427_437xxHeap_Size EQU value1ELSEHeap_Size EQU value2ENDIFHowever the first option is never taken even though I selected the target device correctly.I have a similar construction in the C code and it works, but seems the macro name is no defined for assembly.The idea is to make this as transparent as possible, I know I can add my own built compile option to define a name and use it but others would need to remember to change it every time and why would this be needed when Keil already knows the target device?Any idea how to solve this? I guess if keil defines a macro automatically for C then it should do it also for assembler.Thankse.2014-08-14 09:39 AM
Have the code read the Chip ID or Flash Size and define the memory arena at run time?
Keil doesn't know the device, the coder has to pick one, hopefully the right one, and it doesn't check the device it's programming on. I've used a small subset of the Keil CPU definitions, and they are not all correct. Have your Project have different targets, and use different startup files. Have your coders pay attention. The assembler has it's OWN defines, review Options -> Asm pane instead of the Options -> C/C++ pane IF :DEF:__MICROLIB ENDIF