SparkFun Forums 

Where electronics enthusiasts find answers.

Discussions about processor boards have here!
User avatar
By cpmcgrat
#239312
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.
#239332
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:
Code: Select all
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).
 Topic permissions

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum