-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Increase free IRAM #5499
Increase free IRAM #5499
Conversation
umm_init() is called in OS startup after flash is enabled, and never again. cont_get_free_stack() shouldn't be called from IRQ. Don't inline _iram_read_byte() function.
The __wrap_system_restart call has been in flash for quite a while and seems to be working fine. There were some support routines that were placed in IRAM (mistakenly thinking the wrap_restart caller was also in IRAM) which are now moved to flash. Clean up the printf code to use the new stdlib which handles PGM_P strings as format and arguments without any difficulty.
Add double-underscores to some string assistance macros to avoid conflicts with user applications.
As a simple test, the ESPEasy sketch from #5476 shows:
Before merge I need to manually run a fault test for each of the many, many ways the core can crash, just to verify none of the string replacements got broken. |
Save ~2KB final bin size by using a ets_printf_P function and not an inline macro. IRAM and HEAP unaffected.
Latest push reduces, in total: |
Store a copy of the incoming stack pointer in the postmortem in order to avoid actually changing the SP when a crash happend in BearSSL.
Use the term "Unhandled C++ exception" instead of just "Unhandled exception" to make it clear such crashes are caused by a C++ throw and now a system exception.
Tested an uncaught throw, a false assert, a null-reference, a processor exception in an interrupt, and a ROM exception, and they all dumped and decoded fine (when using #5502 toolchain GDB to avoid the dynlink problem).
|
Does it make sense to turn those tests into formal device tests? |
It may be possible with lots of effort, but doesn't fit into the existing framework at all. Since your main app code no longer runs when the expected behavior happens, the pass/fail prints can never happen. So can't use the test harness. Some complicated |
Move system fault handler to flash, use new printf
seems to be working fine. There were some support routines that were
placed in IRAM (mistakenly thinking the wrap_restart caller was also in
IRAM) which are now moved to flash.
strings as format and arguments without any difficulty.
Move functions out of IRAM when possible
Make STR macro more unique
conflicts with user applications.