Question
In Keil Assembler, detect the CPU name for conditional compiling
Posted on August 14, 2014 at 18:01
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.