-
Notifications
You must be signed in to change notification settings - Fork 7.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
Crash when accessing flash while using RMT and -Os compiler flag (IDFGH-7974) #9487
Comments
Thanks for reporting, we can reproduce the issue with your code. Will fix it ASAP. |
How certain are you that the issue is really fixed? In IDF 4.4.4 I still get a
|
|
That is strange. I do not use rmt_set_err_intr_en at all. rmt_driver_install is only called at start and rmt_driver_uninstall is not used at all. I suspect that -Os makes the dump unreliable and it's in fact another function like rmt_ll_get_tx_end_interrupt_status, rmt_ll_clear_tx_end_interrupt, etc. which are called from the isr and not properly inlined. |
rmt_ll_enable_tx_err_interrupt and Anyway, if I inline rmt_ll_enable_tx_err_interrupt using |
...but a new crash appears: 0x401631e9: rmt_ll_enable_rx_end_interrupt at esp-idf/components/hal/esp32/include/hal/rmt_ll.h:246 |
I did what I did back in August with version 4.4.1: I properly inlined all functions in Now I'm monitoring if the problem is gone again. |
No problems so far after inlining. What were the changes you made to the 4.4 branch? |
I'm encountering a similar problem (slightly different trace) in version 4.4.2 and 4.4.4. I'm calling rmt_driver_install with the ESP_INTR_FLAG_IRAM flag.
should it not be the other way around?
I don't know if this solves any issues yet, but it does not look correct to me. |
Please reopen. |
Problem Description
When compiled with -Os, using RMT and accessing the flash at the same time results in a crash (Cache disabled but cached memory region accessed).
The problem is in
https://github.com/espressif/esp-idf/blob/release/v4.4/components/hal/esp32/include/hal/rmt_ll.h
The functions there are not really "inline" when compiled with -Os. Thus they end up in flash unreachable during flash operations.
Solution: Use
__attribute__((always_inline))
(I think you defined it FORCE_INLINE_ATTR).I've seen in uart_ll.h the low level functions are inlined properly. But e.g. in i2c_ll.h they are not either! I haven't tried anything with I2C or looked into all the other ll files yet, but maybe other peripherals suffer from a similar bug. Whoever fixes rmt_ll.h should check the other components, too.
Code to reproduce this issue
Debug Logs
The text was updated successfully, but these errors were encountered: