-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DISCO_L072CZ_LRWAN1 LOW POWER #222
Comments
@evandavey This issue has an incomplete or old issue template.For future reference please use an up to date clone of the repository before raising issues. Many thanks. |
Thank you for raising this detailed GitHub issue. I am now notifying our internal issue triagers. |
The SX12... drivers look considerably out of date relative to https://github.com/Lora-net/LoRaMac-node/tree/master/src/radio. The SX1276 driver for example has a call to SX1276SetBoardTcxo(...) which is not used in the mbed driver. It also looks like there is some work on a new SX126X driver here: https://github.com/Lora-net/sx126x_driver. This look like a much better design with a HAL abstraction that could be used to de-couple the SX12... driver logic from the framework implementation, however it looks like a lot of work to port across as the MBED implementation is very opinionated. These libraries also seem to account for gpio_deinit for low power. |
I'm trying to deep sleep DISCO_L072CZ_LRWAN1 between transmissions and facing the same issues: TXCO needs to be manually put off by PA_12 & VDD_MCU draws ~450uA after lorawan initialization. I step-debugged the lorawan.initialize(..) function while measuring the current. The current increases at the call to _radio->random() in LoRaPHY.cpp. It seems that the SPI peripheral remains enabled after first transmission. Disabling SPI between transmissions removed the 450uA. Added this code in TX_DONE event:
And this in the beginning of send_message() function:
Hope Mbed team would provide an API to disable/enable SPI. |
@MustafaYassin thank you for your solution. I can confirm this also working on a custom STM32L432 targit with SX1276. I can get as low as 3µA between transmits. Did you improve this implementation, or have some other insights or ideas to solve in a better way? Currently I'm trying to get it working using the |
Hi @MustafaYassin @sillevl |
@sillevl @UnCanard14 |
@UnCanard14 you can see my implementation at https://github.com/vives-dust/firmware/commit/afadd3e9885bcfee6d2807edeaca738f342d845f @MustafaYassin Your solution is almost identical like the implementation i settled with. I can confirm this works correctly and solves the problem. I develloped on a custom board. |
@sillevl |
Thank you @sillevl @MustafaYassin for your answers! I tried @MustafaYassin solution but I'm still at 6mA. On the hardware side, I removed the SB37<->NRST bridge to be able to supply the card with usb and added a jumper wire onto SB37 which we could connect to CN12(5) to be able to continue flashing my card. I placed JP9 in poistion 1-2 (jumper facing down when looking at the board with the antenna at the bottom). I didn't remove the board's LED and resistors, which consume a bit of power (I'm guessing their total consumption won't save me 6mA). To take my measurements, I use a lab power supply that gives me a voltage of 4.5V, allowing me to simulate my batteries, and I add an amperemeter in series in the circuit to measure the board's power consumption. |
@UnCanard14 You better measure the current at VDD_USB, VDD_RF & VDD_MCU instead of +5V to get only MCU current. Hope these help. |
Dear Lora user with STM32L0 or STM32WL, |
FYI I used STM32L0 on custom boards by the past with 3µA sleep mode without any issue with this PR (now merged) So with basic board with only STM32L0 you should be able to achieve this 3µA sleep. |
This is a follow-on from #119 which never seems to have adequately resolved.
In addition to getting ~300uA on VDD_MCU when the event loop is idle, I always see ~1mA on VDD_USB. I believe this is due to TCXO being powered by PA_12 (with JP9 in position 1-2) and this always staying high in the SX1276 library. If JP9 is in position 2-3 then the 1mA shifts to VDD_LRA (since this hard-wires TCXO to always on).
So problem 1 is how to control PA_12/TCXO so it is off when the event loop is idle. This could be done manually by setting sx1276-lora-driver.tcxo to NC and manually turning it on before a send and off following a send but this seems a bit hacky.
And problem 2 is how to further reduce MCU consumption in deep sleep.
Both of these are crucial for a battery powered IoT application which is the target of this library.
The text was updated successfully, but these errors were encountered: