(Related to low power) Please tell me how to use the STM32L151C8T. please help me.

Post here first, or if you can't find a relevant section!
myksj1105
Posts: 95
Joined: Sun Jun 18, 2023 11:35 am
Answers: 2

(Related to low power) Please tell me how to use the STM32L151C8T. please help me.

Post by myksj1105 »

(Related to low power) Please tell me how to use the STM32L151C8T. please help me.

hello. Nice to meet you.

Reference link 1: https://github.com/stm32duino/STM32LowPower
Reference link 2: viewtopic.php?t=2396

@STM32ardui
You're right. 'STM32F103C8' power consumption is very high.

[Test results]
MCU: STM32F103C8
- deep sleep mode: about ~30mA
- shutdown mode: about ~9mA
As shown in the results above, power consumption is too large.

Therefore, we are planning to create a new one as ‘STM32L151C8T’.
I've never made 'STM32L151C8T', so I don't know how to make it usable with 'STM32'. help.

Q1. Circuit-wise, it looks the same as ‘STM32L151C8T’ and ‘STM32F103C8’. Can I make the circuit diagram the same as before? Will it work without problem?
2. Can boot loader use ‘generic_boot20_pc13’?

If anyone knows, please help me.
Thank you
by STM32ardui » Wed Jun 12, 2024 8:12 am
myksj1105 wrote: Wed Jun 12, 2024 7:57 am So, it looks like the STM32 chip can be programmed directly without a separate bootloader. Is this right?
That's right.

ST puts a bootloader on each processor during manufactoring.
So if you buy a board without additional bootloader for USB etc. or you want to design and solder your own board, you need a ST Link V2. And if have a ST LInk V2, I think you can use it always.

The "new" package based on HAL need more memory than the older one from Roger Clark.
But you are not limited on older processors.
An additional bootloader also need some space in memory.
Go to full post
STM32ardui
Posts: 142
Joined: Mon May 06, 2024 1:46 pm
Answers: 1
Location: Germany

Re: (Related to low power) Please tell me how to use the STM32L151C8T. please help me.

Post by STM32ardui »

Arduino LowPower library is made for several µC, Some have idle mode, sleep mode, deep sleep ...

As far as I know STM32xxx only have sleep mode.
So what should a "deep sleep mode" be?
Are you're talking about stop mode?

From STM32LowPower.cpp:

Code: Select all

void STM32LowPower::deepSleep(uint32_t ms)
{
  if ((ms != 0) || _rtc_wakeup) {
    programRtcWakeUp(ms, DEEP_SLEEP_MODE);
  }
  LowPower_stop(_serial);
}
Again I suggest to buy at first a nucleo board from ST, where you have everything and test it correctly.
And why an old STM32L1xxx?

myksj1105 wrote: Wed Jun 12, 2024 6:27 am 2. Can boot loader use ‘generic_boot20_pc13’?
I see this question in several of your postings and I still have no idea, what you are talking about ...
myksj1105
Posts: 95
Joined: Sun Jun 18, 2023 11:35 am
Answers: 2

Re: (Related to low power) Please tell me how to use the STM32L151C8T. please help me.

Post by myksj1105 »

@STM32ardui Thank you for your reply.

I don't know much, so my explanation may be wrong.

----------------------------------------------------------------
1. Looking at the order in order to use MCU: STM32F103C8,
2. Created through circuits, PCB, etc.
3. bootloder download: https://github.com/rogerclarkmelbourne/ ... _pc13.bin/
4. ST-LINK Utility uploading: generic_boot20_pc13.bin
5. Maple DFU Driver2.0
6. Arduino IDE firmware injection

This is because it proceeds in the above order.
----------------------------------------------------------------


Operates via external interrupter. It works well.
----------------------------------------------------------------

Code: Select all

#include "STM32LowPower.h"
volatile int repetitions = 1;
#define BUZZER PB7
const int pin = PA0;
void setup() {
  pinMode(pin, INPUT); pinMode(BUZZER, OUTPUT); 
  tone(BUZZER,1000,100); delay(500);
  Serial.begin(115200);
  Serial.println("STEP-1");
  delay(3000); 
  Serial.println("STEP-2");
  tone(BUZZER,1000,100); delay(500);
  LowPower.begin();
  LowPower.attachInterruptWakeup(pin, repetitionsIncrease, RISING, SHUTDOWN_MODE); // SLEEP_MODE
}
void loop() {
  tone(BUZZER,1000,100); delay(1000);  
  LowPower.shutdown();  
}
void repetitionsIncrease() {
  repetitions ++;
}
The source code is driven by an ‘external interrupter’. It drives well.
----------------------------------------------------------------


1. ‘STM32L151C8’ coding is possible in STM32Duino.
2. Also, the circuit seems to be similar to 'STM32F103C8'.
STM32ardui
Posts: 142
Joined: Mon May 06, 2024 1:46 pm
Answers: 1
Location: Germany

Re: (Related to low power) Please tell me how to use the STM32L151C8T. please help me.

Post by STM32ardui »

Why do you want to use 4 years old stuff from rogerclarkmelbourne, that is made for STM32F103?
And why you want to upload an additional bootloader?
If you have a ST Link V2 stick, you can upload with ArduinoIDE and STM32CubeProgrammer on each processor.
myksj1105
Posts: 95
Joined: Sun Jun 18, 2023 11:35 am
Answers: 2

Re: (Related to low power) Please tell me how to use the STM32L151C8T. please help me.

Post by myksj1105 »

@STM32ardui

1. I have ST Link V2.
2. STM32CubeProgrammer doesn’t work as a serial monitor?
STM32ardui
Posts: 142
Joined: Mon May 06, 2024 1:46 pm
Answers: 1
Location: Germany

Re: (Related to low power) Please tell me how to use the STM32L151C8T. please help me.

Post by STM32ardui »

myksj1105 wrote: Wed Jun 12, 2024 7:40 am 2. STM32CubeProgrammer doesn’t work as a serial monitor?
No.
You have to connect an additional serial/USB-adapter to serial pins and connect it to PC.
myksj1105
Posts: 95
Joined: Sun Jun 18, 2023 11:35 am
Answers: 2

Re: (Related to low power) Please tell me how to use the STM32L151C8T. please help me.

Post by myksj1105 »

@STM32ardui

Thank you.
I set up CDC and it works fine.

So, it looks like the STM32 chip can be programmed directly without a separate bootloader. Is this right?
STM32ardui
Posts: 142
Joined: Mon May 06, 2024 1:46 pm
Answers: 1
Location: Germany

Re: (Related to low power) Please tell me how to use the STM32L151C8T. please help me.

Post by STM32ardui »

myksj1105 wrote: Wed Jun 12, 2024 7:57 am So, it looks like the STM32 chip can be programmed directly without a separate bootloader. Is this right?
That's right.

ST puts a bootloader on each processor during manufactoring.
So if you buy a board without additional bootloader for USB etc. or you want to design and solder your own board, you need a ST Link V2. And if have a ST LInk V2, I think you can use it always.

The "new" package based on HAL need more memory than the older one from Roger Clark.
But you are not limited on older processors.
An additional bootloader also need some space in memory.
myksj1105
Posts: 95
Joined: Sun Jun 18, 2023 11:35 am
Answers: 2

Re: (Related to low power) Please tell me how to use the STM32L151C8T. please help me.

Post by myksj1105 »

@STM32ardui

You're right.I was wrong.
It has been resolved.

I have one last question.
1. The peripheral circuits of ‘STM32F103C6’ and ‘STM32F103C8’ are the same.
2. 'STM32L151C8', 'STM32F103C8'
Also, are the peripheral circuits of the above two the same?
STM32ardui
Posts: 142
Joined: Mon May 06, 2024 1:46 pm
Answers: 1
Location: Germany

Re: (Related to low power) Please tell me how to use the STM32L151C8T. please help me.

Post by STM32ardui »

myksj1105 wrote: Wed Jun 12, 2024 8:19 am 2. 'STM32L151C8', 'STM32F103C8'
Also, are the peripheral circuits of the above two the same?
You have to learn how to search more successfully in internet. ;)
If you reduce the part number to a generic STM32L1, you may find an application note AN3216 -
Getting started with STM32L1xxx hardware development
. And in chapter 7 you will find a reference design.

Also you should search with "STM32L151 board":
There is one at AliExpress and one from MicroOE. So you can study, how they arrrange parts on the board. Of course I can't understand, why chinese manufactors still use quarz in HC49 package ...

Also ST offers two evaluation boards for the STM32L152. 12 € without tax is not so expensive to get a board for tests, that will work.
Post Reply

Return to “General discussion”