arduino / ArduinoCore-mbed

348 stars 202 forks source link

Portenta H7: Incorrect UART1 output when on battery #926

Closed mrubioroy closed 3 months ago

mrubioroy commented 4 months ago

Hi,

I'm trying to power a Portenta H7 with a LiPo battery [1]. I've tried a dead simple sketch that works as expected when on USB power, but not when on battery:

void setup() {
  Serial1.begin(9600);
  while (!Serial1);
}

void loop() {
  static int i = 0;
  Serial1.println(i);
  delay(200);
  i++;
}

When powered with the battery, sometimes the UART1 output is OK and sometimes it is only until 15 (without the \n), the green LED then starts blinking at about 4 or 5 Hz for a few seconds and it then restarts at 0 (hence the 150):

0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
150
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

Some other times I've seen it arrive to higher values then restart. It happens also if I increase the delay to 1000. Some other times it won't start at all and it remains blinking green at 4-5 Hz.

The battery voltage is 3.8V when not connected, slightly over its nominal voltage (3.7V). When connected to the Portenta H7, I measure 2.8V between the + and - battery pins which seems rather low. Is the Portenta H7 consuming too much? The sketch is quite simple, already... tempImageZ8Sx3U

I read UART1 on the breakout board with a USB-UART adaptor. I am using the latest available board version 4.1.5.

What does the green blinking mean? I am doing something wrong?

[1] VARTA 2P/LPP 503562 S, 2400 mAh with NTC thermistor.

mrubioroy commented 3 months ago

I think it was due to bad ground connection. Still, when I use the SD card it no longer works. Too much current draw?