cancel
Showing results for 
Search instead for 
Did you mean: 

Flash memory is full when compiling a code generated by ST Motor control workspace with STVAL-STSPIN3201

NK.13
Associate II

i have generated code from motor control workbench and when i build this code the error came as,

region `FLASH' overflowed by 18000 bytes StSpin_Hall_24_07 C/C++ Problem

StSpin_Hall_24_07.elf section `.text' will not fit in region `FLASH' StSpin_Hall_24_07 C/C++ Problem

i tried for optimised the code code then the there is no error but motor is not working well........

please help...

3 REPLIES 3
Ozone
Lead

> region `FLASH' overflowed by 18000 bytes StSpin_Hall_24_07 C/C++ Problem

> StSpin_Hall_24_07.elf section `.text' will not fit in region `FLASH' StSpin_Hall_24_07 C/C++ Problem

This one is obvious, I think.

> i tried for optimised the code code then the there is no error but motor is not working well........

This usually means your code is semantically not really correct.

Modern compilers are quite good, but still cannot sense your intentions.

If the find no further references to variables, they tend to optimize them rigorously out.

Put a "volatile" qualifier before every variable that is touched in different modules, and especially every variable touched in interrupt context.

For reference, check the stm32xxx device header. It declares structs/variables superimposed on the peripheral registers. All of them are declared "volatile".

NK.13
Associate II

i have successfully compiled this code with size optimization but the motor didnt work, how i can know whether it is the problem with optimization or other.....?

Laurent Ca...
Lead II

The question has been moved from the section "Motor Control Hardware" to the "STM32 Motor Control" section (the question is about the STM32 MC SDK). 

Best regards