So I have a Micromod ATP with a Micromod Teensy processor installed. The issue I am having is that the code I’ve uploaded only runs when it is booted by connecting to my laptop. When I plug the ATP into external power (5V 1A either through VIN/GND or through the USB-C port) all of the sensor/ATP power LEDs light up, but the code doesn’t run.
Interestingly, if I boot it up by plugging in my laptop, connect 5V 1A to VIN/GND, then unplug my laptop from the USB-C port, everything continues working as expected. So it seems like the external power is ok to power the board once the processor has booted correctly.
I assume this is something to do with the bootloader/POST. I feel like this may be something obvious, but I haven’t found anything in the documentation matching this behavior.
Is the teensyduino add on being used? Run through the steps here https://learn.sparkfun.com/tutorials/mi … ware-setup and note that you need to press the ‘boot’ button @ upload when changing the code, and re-try?
So I was actually able to debug this one by adding a screen into the system to see where it was getting stuck while running on external power. This one was my fault.
I had a function signature like this:
bool setupRelays() {...}
This function did setup work the returned a bool on whether or not the setup was successful. For this function I had forgotten to include a return statement returning the result.
I imagine what was going on here is that when the arduino was plugged into my laptop the serial port was able to recognize a hung process and restart the arduino (not sure about this one, a guess) whereas on external power it would just hang on failure (while (1); loops in failure cases).
Sounds plausible to me - good work!