Big STM32 boards topic

Hello JTP,

I have same problem it seems it consumes 0,37 mA at sleep mode. Did you solve your problem ?

You need to be specific about your hardware and software and make some serious attempts to track down the cause.

What low power mode is being used? List everything connected.

Holding a signal against an internal pullup will typically cost 100 uA, against an external one more. Leaving an I2C bus to a de-powered peripheral enabled will cost a lot. Leaving a TCXO running, similarly…

Hello cslorabox,

Brief summary :
Thanks for your quick response. As hardware, I am using STM32L412KB with Semtech1276 RFM9
5W module.They are communicating over SPI interface. I also have LIS3DH accelerometer which is connected to STM32L412 over I2C line. As a software I am using Konstantin Belyalov’s lora library for STM32 and LIS3DH library of Fabio Tota.
For STM32 i am using HAL driver. MCU is woken up every 30 seconds with RTC. I use standby mode for the rest of the time (I also tested it with stop mode as well). Lora is used in sleep mode. When i use lora without sleep mode 2,5 mA is consumed but when i make lora enter in sleep mode, consumption is decreased to 0,37 mA.
I tested different GPIO configuration in order to decrease consumption accoding to AN4899 but i could not make current consumption lower than 0,37 mA. At last, i changed all gpio pings to analog and pulldown.
“Leaving an I2C bus to a de-powered peripheral enabled will cost a lot”. What do you mean with this sentence ? Because in our desing I2C pins are pulled-up. I tested it with digital output pull-up but current consumption didn’t change. I didnt do something with TCXO, i only set lora into sleep mode. I think it should do itself.

Thanks in advance.

Part numbers are a help, but really it would take examining the actual implementation detail of schematic and software to find the fault.

Consider going around and evaluating each I/Os sleep level compared to any internal or external pulling resistors.

See if you can get the radio out of the circuit entirely and measure the current without it.

Consider desoldering the accelerometer, or make sure you’ve gotten it into the right mode - I have one from another brand that consumes more current on power-on, and only hits low consumption when it’s been explicitly configured to the proper mode.

To understand whats going on, why the sleep current is higher than you think\want you really do have to start from the begining.

Trying to troubleshoot why a complete design, processor, LoRa device, I2C stuff and more does not provide a low sleep current is I have found, not very informative.

Start at the beginning.

What is the sleep current with just the processor and no other components ?

What happens when you add a LoRa device ?

What happens when you start adding I2C stuff ?

Thanks for your advices,
According to your directions, i checked GPIOs pin at standby and see that one of them seems to be floating (0,156 V at pulldown). And some GPIOs migth be misconfigured. I quickly test it and the consumption didnt change yet but i will check GPIOs pin by pin. I will let you know the result but it may take some time.

Then i will desolder LORA and ACC if i could not correct the consumption with GPIOs.

Does anyone have experience with these STM32F411CEU6 boards?

This board appears to be the nextgen of the older STMF103 based blackpills. It comes with STM32F411 that is more powerful, has more memory, floating point support and a USB-C connector. It comes with a bootloader that has USB support.

Available here.

The board is supported by the STM32 Arduino Core and supported by PlatformIO.

It has spare solder pads for a SOIC-8 chip on the bottom which is probably for adding a flash chip (and may also fit FRAM).

What are your thoughts about this board?

Any experience with deep sleep power usage?


Andreas Spiess has recently tested this board in his benchmark of STM32 boards (includes tips):

No idea, but I’m not sure why an F4 would be a good choice.

A while back after studying pinouts and concluding it should work I swapped out the STM32F103 on a bluepill with an STM32L073 that makes a great choice for low power sensors; admittedly I then never actually did anything with it…

Hello everybody,

I want to update my problem with latest tests. When i did desolder the Lora SX1276 and ACC, i can actually see the 7 uA consumption with STM32L412KB standby mode. I found some GPIOs are misconfigured and i can decrease the consumption from 0,37 mA to 0,18 mA. I can’t decrease further yet but i continue to change the configuration of GPIOs.

By the way i could not find any configuration to shutdown TCXO. Could you help me with this ?
I attached the schematic of my circuit.
STM with LORA.pdf (241.8 KB)

Thanks in advance

If the TCXO supply comes from or is controlled by a GPIO, you can shut it down, if it doesn’t you cannot…

Hello guys,

I want to update my situation again. Finally i can decrease the current consumption to 10 uA. First of all i start using stop mode instead of standby mode (I think gpio internal pull up pull downs not working in standby mode). Secondly, i disconnected dio3, dio4 and dio5 pins of sx1276. I think they consume power because they connected to 5V tolerant pins. Lastly, accelerometer SA0 pin was grounded. As design perspective it was not wrong but consumes to much energy according to datasheet. I changed it and connected to VCC. I hope these information helps someone who is going crazy :slight_smile:) and thank you for helping me.

Best Regards

Hello nicomedia,
I have made my own STM32 board with STM32L051 and RFM95W. I can power down to 1,5 - 1,9 uA in sleep mode with a BME280 attached. checkout https://www.iot-lab.org/blog/370/ for some inspiration.
Regards, Leo.

2 Likes

Hello everyone.
I have stm32 bluepill and lora module sx1276. I am using the guide made by: www.iotbyskovholm.dk/?Q=content/ibm-lmic-stm32cubemx. Unfortunately, the LoRa module is not transmitting, the program sends the “EV_TXSTART unkown event” message all the time. On thethingsnetwork, my node has an online status, but has not sent any package. Does anyone know what the problem is?

I would like to use an STM32 HAL code in STM32 Cube IDE and not an Arduino.

n1 n2

I have no experience with stm32CubeMX but it appears that join requests are sent, but the join accept is not received. Either because latter is not sent or because it is not received/recognized by the node.

This indicates that the event is triggered by the LoRaWAN stack but is not handled by your application code.

Do you have access to a nearby gateway and its traffic in the TTN console? Do you see any join accept downlink messages in respons to join requests?

Please don’t post screenshots of code. See: How do I format my forum post? [HowTo]

1 Like

Yes, I have my gateway.
n1

Here is the code of app:
http://www.iotbyskovholm.dk/?q=content/ibm-lmic-stm32cubemx

The events with green lightning icon are join accepts sent to your node.
So the issue is with the node not seeing/recognizing the join accepts.

This often indicates a timing issue (causing downlink message not to be recognized), but may also relate to EV_TXSTART not being handled.
The issue will have to be further investigated in the code on your node (but stm32CubeMX currently exceeds my knowledge).

The “unknown event” is separate from the EV_TXSTART - something has changed / been added in to the heart of MCCI LMIC recently which I haven’t traced yet that fires an event that’s not recognised by the user facing code.

That was added more than a year ago already somewhere in v3.0 IIRC. The “unknow event” in that case is caused by not handling the event in the event handler in some of the included examples, which were later fixed but the issue still occurs when using older versions of the examples with newer versions of the library, or worse use examples from a totally different library.

But see:

The file set you can download here LINK TO FILE ZIP - unzip into its own folder so it is easy to find for you later on - see video first.

The file set is the original IBM LMIC version 1.6 but stripped for everything which were sensor or board specific, so it contain only the core IBM Lmic files and the HAL.c modified for STM32CubeMX - it will help your undestanding

Which apparently is not MCCI LMIC for the Arduino framework.
(Unless the reference to IBM LMIC in the description is incorrect and MCCI LMIC may have been used as the source instead. I haven’t verified.)

@SzymonJk If you don’t want to use the Arduino framework but STM32Cube then it may also be worth having a look at Semtech’s LoRaMac-node library. There will probably exist an implementation for STM32Cube.

I just noticed that you posted the same question in a different topic.

Never post the same question in different topics or else that wil cause a fragmented mess in the responses and cause other users wasting their time!

You had already received the following answer there from @cslorabox

Which you did not mention here and ignored because you did not respond to @cslorabox.
This wastes peoples’ time in their efforts trying to help you.

1 Like