2018-06-18 01:20 AM
hello ST community,
I have a little problem with STM32CubeMX.
The problem is, when i generate new code with cubeMX to my existing programm, some of my existing work is not working as intended anymore (here it is my I2C that only returns 255 all the time after the modification). But if i make the modification without CubeMX (copy and past the exact same code) i don't have any problem. I even checked, all the files are the same.
Does someone have an idea why this is happening and how to solve this issue ?
Thanks for your time.
#stmcubemx #st-cubeSolved! Go to Solution.
2018-06-19 02:05 AM
Thank you
iwanicki.artur
for trying to help me, but i have found the problem.The problem was the optimisation configuration in System Workbench for STM I don't know why but CubeMX change the configuration of the optimisation back to 'Optimize more -O2' each time in generate a new code.
But i would like to know if i can change the default optimisation level in CubeMX.
(just to answer, my MCU is a STM32L476VGT6)
Thanks for your time and your help,
Mickaël Aliot.
2018-06-18 10:38 PM
Hello,
Interesting. To be honest it is the first time I met such a case. Maybe the problem is in initial configuration (SystemInit function) or configuration of I2C peripheral itself. What is the MCU behind?
Your initial code (before the modifications mentioned above) has been generated by STM32CubeMX using the same library? Which version of STM32CubeMX and STM32Cube library are you using?
Which files of the project have you compared? Are you using interrupts in I2C? Last question is important as you can store your interrupt configuration function (setting priority and enabling them) either in peripheral initialization function or in separate one called MX_NVIC_Init(). Decision is up to you and it is done within NVIC configuration @STM32CubeMX
Thank you in advance,
Best Regards,
Artur
2018-06-19 02:05 AM
Thank you
iwanicki.artur
for trying to help me, but i have found the problem.The problem was the optimisation configuration in System Workbench for STM I don't know why but CubeMX change the configuration of the optimisation back to 'Optimize more -O2' each time in generate a new code.
But i would like to know if i can change the default optimisation level in CubeMX.
(just to answer, my MCU is a STM32L476VGT6)
Thanks for your time and your help,
Mickaël Aliot.
2018-06-19 02:10 AM
Hello,
At the moment it is not possible to change the default optimization level in STM32CubeMX. I will put this option as a proposal for future releases.
Best Regards,
Artur