I am using both cores with core1 handling my real-time code and core0 doing the USB communication to the PC.
Coding in Arduino IDE using https://github.com/earlephilhower/arduino-pico - A shout out to Earl for a fantastic job - I didn't want to bother him with this one as it seems deeper.
I have verified that it is core1 hanging as I added code to reboot core1 with a command I send to core0 and it restarts and goes back to work (until it hangs again). I didn't want to use the traditional debugger as I need the real time so stepping through doesn't work and this bug is occasional. What I did was add a line tStat = value; periodically through the core1 code and then when it hangs I read out the value with a call to core0.
So here is the code that hangs, checking on some variable about what we are doing this time: It gets called from:When it hangs (not every trial) the report is that tStat is 201
Why would it hang on a return? or... how is the program stack getting corrupted?
Thank you in advance for your assistance.
Coding in Arduino IDE using https://github.com/earlephilhower/arduino-pico - A shout out to Earl for a fantastic job - I didn't want to bother him with this one as it seems deeper.
I have verified that it is core1 hanging as I added code to reboot core1 with a command I send to core0 and it restarts and goes back to work (until it hangs again). I didn't want to use the traditional debugger as I need the real time so stepping through doesn't work and this bug is occasional. What I did was add a line tStat = value; periodically through the core1 code and then when it hangs I read out the value with a call to core0.
So here is the code that hangs, checking on some variable about what we are doing this time:
Code:
// Check if it's an AA, A0, BB, or B0 trialint isAABB() { tStat = 200; if (OdorL < 6 && OdorR < 6) { // it's AA or A0 tStat = 201; return 1; } else if (((OdorL > 5) || (OdorL == 0)) && // BB or B0 ((OdorR > 5) || (OdorR == 0))) { tStat = 202; return 2; } else { tStat = 203; return 0; // false, normal AB trial }}
Code:
tStat = 102; switch (isAABB()) { // Find what trial type tStat = 1025;
Why would it hang on a return? or... how is the program stack getting corrupted?
Thank you in advance for your assistance.
Statistics: Posted by Gavin53 — Thu Dec 05, 2024 6:19 pm — Replies 0 — Views 10