Replies: 4 comments 2 replies
-
Hi @rtborg , To me, that does not sound like random corruption, but some application issue. Have you ruled out your app by trying some simple sample app from the tree? Or maybe hack your app so none of your threads do anything, see if the stacks continue to grow, and if not, enable parts of the app until you see the issue surface. It's odd to me that all of the stacks grow like this. Could there be some interrupt that is constantly firing, pushing onto each thread, and somehow not popping everything off? Can you use a debugger and debug one of the threads, maybe a simple one like the idle thread, and watch the stack pointer to see what is causing it to increase? Or at least see if it increments by a consistent amount each time. You could also look at that data getting added to the stack, and see if it is random or has a pattern and give clues to what causes it. Let us know what you find |
Beta Was this translation helpful? Give feedback.
-
I created a minimal Zephyr application which only blinks a LED and logs to console, however the issue persists. When tracing thread stack usage with the proto:~$kernel stacks
0x80003330 shell_uart (real size 8192): unused 37 usage 8155 / 8192 (99 %)
0x80003a50 sysworkq (real size 8192): unused 514 usage 7678 / 8192 (93 %)
0x80002228 logging (real size 8192): unused 855 usage 7337 / 8192 (89 %)
0x80003798 idle (real size 4096): unused 4008 usage 88 / 4096 ( 2 %)
0x80003860 main (real size 8192): unused 584 usage 7608 / 8192 (92 %)
0x80008d00 IRQ 00 (real size 4096): unused 31 usage 4065 / 4096 (99 %) I tried making some sense of the values that are scattered in the stacks, but can't find a pattern. The commonality is that they are single bytes with one flipped bit - instead of Same thing occurs when logging is disabled. Here's the result of minimal application running for less than a minute, with logging in idle thread: proto:~$kernel stacks
0x80003330 shell_uart (real size 8192): unused 7384 usage 808 / 8192 ( 9 %)
0x80003a50 sysworkq (real size 8192): unused 7992 usage 200 / 8192 ( 2 %)
0x80002228 logging (real size 8192): unused 7980 usage 212 / 8192 ( 2 %)
0x80003798 idle (real size 4096): unused 4008 usage 88 / 4096 ( 2 %)
0x80003860 main (real size 8192): unused 7744 usage 448 / 8192 ( 5 %)
0x80008d00 IRQ 00 (real size 4096): unused 3848 usage 248 / 4096 ( 6 %)
proto:~$kernel stacks
0x80003330 shell_uart (real size 8192): unused 7224 usage 968 / 8192 (11 %)
0x80003a50 sysworkq (real size 8192): unused 4951 usage 3241 / 8192 (39 %)
0x80002228 logging (real size 8192): unused 3311 usage 4881 / 8192 (59 %)
0x80003798 idle (real size 4096): unused 4008 usage 88 / 4096 ( 2 %)
0x80003860 main (real size 8192): unused 5517 usage 2675 / 8192 (32 %)
0x80008d00 IRQ 00 (real size 4096): unused 3848 usage 248 / 4096 ( 6 %) I'm attaching a dump of the main_stack.txt |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hi @DerekSnell, [00:01:45.669,000] <err> os: ***** USAGE FAULT *****
[00:01:45.677,000] <err> os: Illegal use of the EPSR
[00:00:37.485,000] <err> os: ***** USAGE FAULT *****
[00:00:37.493,000] <err> os: Attempt to execute undefined instruction
[00:00:08.247,000] <err> os: ***** MPU FAULT *****
[00:00:08.254,000] <err> os: Data Access Violation
[00:02:04.827,000] <err> os: ***** BUS FAULT *****
[00:02:04.834,000] <err> os: Instruction bus error Disabling EDMA does not rectify the problem, however disabling LVGL altogether stops the crashes. I run [00:01:26.920,000] <err> os: ***** MPU FAULT *****
[00:01:26.928,000] <err> os: Instruction Access Violation
[00:01:26.936,000] <err> os: r0/a1: 0x00000001 r1/a2: 0x00000058 r2/a3: 0x40cc0000
[00:01:26.947,000] <err> os: r3/a4: 0x00000001 r12/ip: 0x00005385 r14/lr: 0x3007a505
[00:01:26.958,000] <err> os: xpsr: 0x80000000
[00:01:26.966,000] <err> os: Faulting instruction address (r15/pc): 0x80100d64
[00:01:26.976,000] <err> os: >>> ZEPHYR FATAL ERROR 20: Unknown error on CPU 0
[00:01:26.986,000] <err> os: Current thread: 0x80124a38 (main)
[00:01:26.995,000] <err> os: Halting system The LR is loaded with address of
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a custom board using MIMXRT1166CVM5A and SDRAM Winbond W9812G6KB-6I running ar 148.5 MHz. When flashing a simple application, the stack utilization of the threads seems to rise on its own, without the thread work being modified in any way. For example, at beginning of application run, the stacks are:
After a few minutes of running, the following appears:
which eventually leads to a crash:
However, the crash description varies each time, along with the duration it takes to appear.
I am thinking that the problem is in SDRAM and possible corruption in reading or writing, however I am not 100% sure it's that. I tried running a bare-metal MCUXpresso application which constantly reads and writes to the whole SDRAM, and it runs for hours with no fault.
I am using same DCD to initialize the flash in both Zephyr and MCUXpresso.
Any pointers will be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions