-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Application doesn't work with assertion level set to "disabled" (GIT8266O-839) #1262
Comments
So I did some digging on this and the reason why the app isn't initialized (and the image is so small) is that there are a bunch of places where important code is placed inside an assert.
However: These are only the ones I could find on a basic scan, have no idea if this list is complete. I went ahead and fixed all of those (patch) and once thats done everything works correctly when NDEBUG is enabled (you also don't need the ld change anymore because now the image is big enough not to trigger that error). I then compiled my app twice, once with NDEBUG, once with silent asserts.
Enabling NDEBUG shrunk the image by about 7% (30k), which is about what I'd expect. However you are now at the risk of hitting some assert bug that I didn't find. So unless you've run out of other stuff you can disable to reduce that size I wouldn't touch NDEBUG, even with my patch applied. If you do, make sure you retest all functions of your app to make sure it still works correctly. I hope this helps anyone. |
Environment
Problem Description
Application doesn't work as expected when assertion level is set to "disabled" in menuconfig.
Expected Behavior
It should be possible to disable assertions and to have working application.
Actual Behavior
When assertion level is set to "disabled" in menuconfig, first we get linking error, which can be solved by using workaround from #1260 (comment)
After fixing the linking problem, application build and flash successfully, however it doesn't work as expected. There are only logs visible from bootloader and then app hangs.
I tried with "hello_world" example which prints on cosole and restart module evey 10 s. With assetions disabled there is no single log output and there is no restart visible at all.
Steps to repropduce
Code to reproduce this issue
hello_world example
Debug Logs
Only below log is printed. Nothign in printed from application itself. There is no ESP reset visible at all (there should be repeated bootloader log every ~10 s in hello_world example).
The text was updated successfully, but these errors were encountered: