You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There were crashes (MPU faults and instruction access violations) when the chat script size increased. Debugging showed that the script’s memory alignment was causing issues, leading to invalid instruction execution.
[00:00:09.736,000] <err> os: ***** USAGE FAULT *****
[00:00:09.736,000] <err> os: Illegal use of the EPSR
[00:00:09.736,000] <err> os: r0/a1: 0x0802ff8c r1/a2: 0x08033130 r2/a3: 0x00000008
[00:00:09.736,000] <err> os: r3/a4: 0x73253c00 r12/ip: 0xaaaaaaaa r14/lr: 0x0802e051
[00:00:09.736,000] <err> os: xpsr: 0x2000001e
[00:00:09.736,000] <err> os: Faulting instruction address (r15/pc): 0x73253c00
[00:00:09.736,000] <err> os: >>> ZEPHYR FATAL ERROR 35: Unknown error on CPU 0
[00:00:09.736,000] <err> os: Fault during interrupt handling
[00:00:09.736,000] <err> os: Current thread: 0x20013a20 (idle)
[00:00:09.798,000] <err> os: Halting system
I added __aligned(8) to the MODEM_CHAT_SCRIPT_CMDS_DEFINE and MODEM_CHAT_SCRIPT_DEFINE macros. This ensures proper memory alignment and prevents crashes, even when the script size changes.
Testing:
Without alignment: Crashes when the script grows beyond a certain size.
With __aligned(8): Works fine, even with a larger script.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
There were crashes (MPU faults and instruction access violations) when the chat script size increased. Debugging showed that the script’s memory alignment was causing issues, leading to invalid instruction execution.
here is the script definations:
Here are my sample stack sizes:
As a solution:
I added
__aligned(8)
to the MODEM_CHAT_SCRIPT_CMDS_DEFINE and MODEM_CHAT_SCRIPT_DEFINE macros. This ensures proper memory alignment and prevents crashes, even when the script size changes.Testing:
Without alignment: Crashes when the script grows beyond a certain size.
With __aligned(8): Works fine, even with a larger script.
Updated the macros like this:
Can anyone shed some light on this issue? Am I doing something wrong/ missing some configs here?
Beta Was this translation helpful? Give feedback.
All reactions