I'm encountering random crashes with my test application, which is essentially blinky on steroids. The app code is here: https://github.com/digitalentity/tinygo_gotchas/blob/master/src/ticker_crash/main.go. This is an extract from a different up to create a smaller repro environment.
Nothing really complicated, but it sometimes dies with a message fatal error: undefined instruction with sp=0x20000fd4 pc=0x00000091 or similar to the console.
The biggest problem is that they are not deterministic - sometimes the app can run for hours, sometimes is crashes within minutes which makes debugging really hard. Right now I have it running under GDB for about 1h without any sign of issue.
I never saw crashes when using time.Sleep(), it started when I started adding time.Ticker for a more accurate intervals. I can't use Sleep because I need to reasonably accurately run the closed loop controller every 2ms and this inverval needs to be measured more or less accurately.
I would appreciate any pointers.
I'm encountering random crashes with my test application, which is essentially
blinkyon steroids. The app code is here: https://github.com/digitalentity/tinygo_gotchas/blob/master/src/ticker_crash/main.go. This is an extract from a different up to create a smaller repro environment.Nothing really complicated, but it sometimes dies with a message
fatal error: undefined instruction with sp=0x20000fd4 pc=0x00000091or similar to the console.The biggest problem is that they are not deterministic - sometimes the app can run for hours, sometimes is crashes within minutes which makes debugging really hard. Right now I have it running under GDB for about 1h without any sign of issue.
I never saw crashes when using
time.Sleep(), it started when I started addingtime.Tickerfor a more accurate intervals. I can't useSleepbecause I need to reasonably accurately run the closed loop controller every 2ms and this inverval needs to be measured more or less accurately.I would appreciate any pointers.