danak6jq / RAK3172

Port of STM32WLxx example for RAK3172
29 stars 11 forks source link

High power consumption in Debug configuration and errors in Release configuration #4

Closed IoTopenTech closed 2 years ago

IoTopenTech commented 2 years ago

In Debug mode the RAK3172 (without any other peripheral connected) takes 5-6mA when not transmitting. imagen

In Release mode the project does not compile. imagen

danak6jq commented 2 years ago

Release configuration - added missing include path.

High power consumption:

Check IOC file settings

image
IoTopenTech commented 2 years ago

Thanks @danak6jq :-) Now it compiles in Release configuration... Unfortunately the power consumption between transmissions (even with the Disable low power option unchecked) is still above 500uA... I will keep investigating this issue aiming to get something around 10uA. imagen

danak6jq commented 2 years ago

I'm updating this workspace to use v1.2 of the STM32WL firmware, and will have a look at power consumption afterward. Please let me know what you discover ; perhaps there's some power use as a result of the RAK3172 dev platform?

IoTopenTech commented 2 years ago

Nice @danak6jq

I've already been trying V1.2 with STM32CubeIDE 1.9 (this is my current project https://github.com/IoTopenTech/myIoTopenTech/tree/master/TiposDeDispositivos/TTNMAD_SOUND/STM32CUBEIDE/ttnmad_noise).

The power consumption in idle is a little better (200uA), but not yet near 10uA. imagen

I'm using a RAK3272 breakout board... so there is nothing else connected to the RAK3172

danak6jq commented 2 years ago

Here's why my repo has an idle current of 5-6mA - I configure the mote to Class C. You have to tweak that for your application :-)

image
IoTopenTech commented 2 years ago

I've found something interesting. Tying the RX pin of USART2 to GND the consumption is reduced to 1.5uA. There must be someproblem with the usart2 periphal that awakes the microcontroller, but I cannot find it yet. imagen

danak6jq commented 2 years ago

Is this perhaps related to the LPUART component?

I've found something interesting. Tying the RX pin of USART2 to GND the consumption is reduced to 1.5uA. There must be someproblem with the usart2 periphal that awakes the microcontroller, but I cannot find it yet. imagen

danak6jq commented 2 years ago

OK, probably not LPUART, but I note the pull-ups are disabled on the port pins, wonder if, while asleep, this allows an input buffer to float into high-current use

image
danak6jq commented 2 years ago

After changing the LoRaWAN application setting to Class A, I see a steady-state current consumption to the RAK3172E eval board (measured in series with the battery) of 2.7mA (!) Now I have to figure out what's using that power; the radio uses ~5mA, so this is probably inadequate low-power mode in the CPU...

IoTopenTech commented 2 years ago

That board includes a CH340. Could it be getting some power?

danak6jq commented 2 years ago

That's what I'm thinking. The LoRa-E5 Minis I've tested power-down much lower, though I don't recall the exact number, I'll have to measure it again. Also the RAK3172E has a battery-sense voltage divider that's good for ~3uA by itself IIRC.

IvanAmg commented 2 years ago

Hi! @danak6jq Also tested the port with my application and currently my lowest current value is 1.57 mA. I'm not capable of reaching any lower value, however, in order to discard any hardware consumption I've tested @IoTopenTech repository mentioned earlier, and the lowest value is ~512.70 uA. Even if I configure my LoRa settings (Class A, US915), and USART1 (which I use with my application) the current stay with the uA value. Any advice would be awesome! Thanks in advance.

danak6jq commented 2 years ago

Hello @IvanAmg - have you tried disabling the SWDIO / debugger? That runs the current use up 1-2mA.

Reminds me I need to re-measure current use with SWDIO disabled.

IvanAmg commented 2 years ago

Apologies for the late reply! But, actually yes, those pins are disabled. image This is what my project looks like.