Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

M4 Express + Arduino not running code via Battery
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

M4 Express + Arduino not running code via Battery

by pcmofo on Mon Jul 13, 2020 8:49 am

I'm using the M4 with Arduino and I'm loading code onto it via Microsoft Code and Platform IO which has been working great.

When I load the code via Code + Platform IO using a PC it runs fine. Sometimes I need to restart the serial monitor to get it to restart the program though

When I unplug from the PC and plug into a USB battery bank the board turns on but does nothing. It's wired to an Adafruit Sound FX board and I hear the pops from it sending the reset UART commands but no button response or LEDs light on the rest of the hardware.

I haven't noticed until now as I have started more extensive code and testing. Any idea what might be happening?

pcmofo
 
Posts: 21
Joined: Wed Sep 09, 2009 4:57 pm

Re: M4 Express + Arduino not running code via Battery

by adafruit_support_bill on Mon Jul 13, 2020 9:07 am

Do you have a test for serial connection somewhere in your program? There is no serial connection when running on battery power, so code as below would just hang:

Code: Select all | TOGGLE FULL SIZE
while (!Serial) {
    ; // wait for serial port to connect.
  }

adafruit_support_bill
 
Posts: 78708
Joined: Sat Feb 07, 2009 10:11 am

Re: M4 Express + Arduino not running code via Battery

by pcmofo on Mon Jul 13, 2020 2:17 pm

adafruit_support_bill wrote:Do you have a test for serial connection somewhere in your program? There is no serial connection when running on battery power, so code as below would just hang:

Code: Select all | TOGGLE FULL SIZE
while (!Serial) {
    ; // wait for serial port to connect.
  }

Thanks Bill, one of my libraries had this line in it. It's working fine now.

pcmofo
 
Posts: 21
Joined: Wed Sep 09, 2009 4:57 pm

Please be positive and constructive with your questions and comments.