Bad SD Card + Crash Theories #2

by Octapoo

Thursday, April 22, 2021 at 20:48:00 UTC

Return to the Summary in Ecstatic Lyrics Blog

So I had another look at that card, this time trying to make the data logger itself read it. It turns out the card is completely dead. It's just that, if there's no card inserted, then the data logger blinks a different LED to indicate an error, but if there is a card inserted, even if the card doesn't work, it'll happily blink the same LED as if the card were working.

So that's just wonderful.

As for the theory that the GPS fell off, I have the same sticky foam on the GPS right now and I've stuck it to several things and let it sit for days just in case it wanted to fall off, but it's still quite sticky and doesn't easily come off of anything. So I think the crash must have removed it.

That's making me more fond of the idea that the GPS just wasn't ready. When testing it in my house, it often first comes up with a fix that's as far as a block away, then takes a minute to figure out exactly where I'm at. I think it may have just had one of those early fixes and thus been mistaken about where it was.

I already have a switch on the controller which enables the motor, so that it doesn't accidentally turn on if I bump the control stick. So I added some code so that, if I flip that switch before the GPS is ready, it sounds the alarm on the plane to warn me that I'm about to fuck up. This will also be useful to let me know if the GPS signal starts having any problems in the air as well.

I also discovered last week that if I put my fingers on the bottom of the circuit board, it can lock up the whole thing. It seemed to be related to me touching the pins for the quartz crystals, so I guess it is just fucking up the CPU and causing a program crash. So I enabled the watchdog timers on all three chips, which should be fairly effective since the watchdog timer runs on a separate internal oscillator, but it seems to have only kind of helped...

178265.015: Sensors: GPS parsing error. 178265.065: Sensors: GPS parsing error. 178265.065: Sensors: TWI reset. 178265.082: Sensors: TWI reset. 178265.115: Sensors: GPS parsing error. 178265.149: Master: sensors CRC error 178265.165: Master: sensors CRC error 178265.184: Master: sensors CRC error 178265.301: Sensors: Gyroscope failure. 178265.301: Sensors: Compass failure. 178265.317: Sensors: Compass failure. 178265.317: Sensors: TWI reset. 178265.318: Sensors: watchdog reset 178276.545: Sensors: Gyroscope failure. 178277.530: Sensors: GPS parsing error. 178277.646: Master: sensors CRC error

...and then it locked up.

It got at least one watchdog reset in there. There may have been more as the CRC errors might have been from the chip locking up half-way through an SPI transfer. However, at the end, the thing was locked up for good until I did a manual reset.

I think maybe this could be fixed if I got oscillators in a can so that I eliminate the analog circuitry of the quartz crystals from the board, but I don't know that I should worry about it since it doesn't happen if I don't touch the circuit, and the compass & gyroscope errors are TWI errors and I can't fix the fact that TWI is flaky as fuck. There's already code to watch if the TWI is just being unresponsive and reset it, but in one of the finger-touching tests it got so broken that even though the chip was constantly resetting it, it never recovered.

Maybe my expectations are too high for how resilient it should be to this, but like I put my multimeter on my fingers and it thinks they're a couple of megaohms, and during the test I grounded myself, so I don't understand where the problem is coming from. ...but at least I've never seen it when I'm not touching the circuit, so I do have the option of just not touching it.


If you were logged in, there would be a comment submission form here.
Creating an account is easy. You literally just type in a name and a password.
I don't want your email address, so there won't be any links in any emails to click.

Return to the Summary in Ecstatic Lyrics Blog