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

SDK • Re: Adding to queue_t causes hardfault after working fine for minutes

$
0
0
my money would be on memory corruption/stack overflow by your program. about the only way that could crash is if spin lock pointer is corrupted
Yup, that was it. The interrupt handler wrote bits into the buffer without checking for the buffer's remaining capacity. When there was just one bit more than specified by the protocol (due to electrical noise or whatever) the buffer would overflow and bits would be written into some other memory. The queue structure happened to be right next to the buffer... Sometimes it takes some pain to find simple mistakes like that :roll: .
Thank you very much for pointing that out!

Cheers

Statistics: Posted by penguins_can_fly — Tue Feb 27, 2024 1:17 pm



Viewing all articles
Browse latest Browse all 8051

Trending Articles