2021-12-31 03:58 PM
I know, it's not easy to get this answer this way. I have a working F446RE code with CubeMX generated base in CubeIDE. I use the LL drivers and just simple int and string variables, not any dynamic memory handling. In some cases if I insert a new code line to a function or to the main(), an other completely unrelated part of the program go wrong. For example if I insert a simple "while (USART1_rx_counter == 0){}" line to my USART1_getchar() function, the initialization of one type of the I2C sensors go wrong. No error or warning messages, the build settings are the defaults. If I put this source to Embitz IDE, it can also build, but this problem does not appear there.
So, help me please, what (tipical) kind of errors, mistakes or settings can make this problem and this difference between the two IDE? Or perhaps should it be a (known) bug? CubeIDE is up to date.
Thanks,
Peter
2022-01-01 12:14 AM
Optimizing levels , or for understanding when you write bad code , you see it in src, but in compilation is nop.
2022-01-01 01:52 AM
Dangling pointer or badly initialized pointer...
Maybe you don't write where you want to.
2022-01-01 04:40 AM
Thank you,
The main question is, why this problem of the same code with CubeIDE, but not with Embitz? "Usual" pointer fault should appear similar way with the similar gcc bases. Optimization level is the same -O0 and the buid type is the default "debug". Not any warning with -Wall.
2022-01-01 10:00 AM
Are you sure that the 2 IDE generate exactly the same binary?
Similar is not enough...
2022-01-02 05:34 PM
Just because it works with Embitz doesn't mean it is bug free. Similarly, just because it doesn't produce compilation warnings or errors doesn't mean it is bug free.
Focus on debugging the problem code, be objective. Definitely sounds like a write out of bounds or other memory access issue.