Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5087

SDK • Re: RP2040 (pico sdk) strange behaviour (and crash) around gpio IRQ default handler

$
0
0
Thank you @carlk3 for reply.

This is what I was suspecting as well as one of the causes, however, the suspect seems to be hiding very deep. Using mechanisms from SDK and FreeRTOS (PICO_USE_STACK_GUARDS for the main stack and canaries + stack overflow hooks for RTOS) doesn't seem to show any problems. What's interesting yesterday morning I changed two things: the core speed from 133MHz to 100MHz and I moved all the ISRs from RAM back to flash. Now I can see the system has been running for over 18 hours with no issues. Could this be a clue to someone?

Regarding your suggestion: as far as I understand there are two types of stack corruption:
1. stack overflow - where there's not enough stack space to proceed with the code execution
2. stack overwrite - automatic arrays overwrite, dangling pointers, etc.

To the experts out there - what stack corruption causes did you happen to encounter in your career? What would be the "first to go" places to start looking at things where you're convinced that there are no automatic arrays in your code and you're carefully checking all the pointers? Perhaps you could point out some good-to-read sources for this type of issue? (I think I've read all of the internet on this topic regarding cortex M0+, yet I know that's not true...).

Back in the day, I had an issue with an arithmetic overflow of a result register - it took a while to figure out that at the HardFault exception, the xPSR shows as well the overflow flag and this pointed me to the right place for further looking. However here this path leads to nowhere.

Statistics: Posted by AlanW004 — Sun Mar 24, 2024 5:37 am



Viewing all articles
Browse latest Browse all 5087

Trending Articles