2014-07-20 05:45 AM
There is a huge bug in STM32CubeMX with STM32Cub V1.0 when full assert is enabled.
When I make a project with timers or SPI and full asser is enabled, then the program hit the assert when the HAL_init function is called in main.The reason is that the Cube dont set all values of the structure htim and dont clear it because for the configured case a lot of values are not important but the assert configuration checks all parameters regardless if they are used or not. Because of random values in these ram sections, the values make no sense.This cause a permanent jump to assert function without any reason. This happen with all timers and sometimes with SPI. I cant use them at all.attached you have the IOC file.Please forward this to the related team.Thanks2014-07-21 06:37 AM
2014-07-22 05:09 PM
Hi,
No, this dont solve my problem. My problem start before the scheduler or anything else is started. The problem starts during the init phase of the main(). When full assert is enabled, every HAL subroutine checks the parameter if they are in range at beginning of the subroutine. These are call from the HAL/Cube init procedure but when I configure in Cube a simple up counter, then the valuese for Output compare (as an example) are not set and has random values. The HAL function check also these values regardless of if they make sense or not (needed for this particular case). If the random vale is out of range then the init will fail and assert hited even when there is no reason to do that. This happen only because of random values in memory. In the older version of HAL there was a clear function for the structure but the Cube don produce such code. It should call an init function to clear all values and set then to a valid value. If its not clear, please let me know, I will sen you code fragments but its very easy to simulate this error. Configure a timer, activate full assert then generate the project, load to debug and before start set all bytes of the htimx structure to 0xff or fill the whole ram with 0xff before you start your programm. Then you see that it will never work. If you disable full assert, then everything is working fine. Right now I disable the full assert to be able to develop my project but I need it to see, if my programm is working correct or not. Regards