Skip to main content
Associate III
October 15, 2024
Solved

STM32F412G-DISCO: Turn on LD6 (PWR) LED when microcontroller is powered on

  • October 15, 2024
  • 4 replies
  • 1598 views

We want to turn on the LED when the microcontroller is powered on. Before the program is executed.

Is it possible to achieve this with just the program, without changing the HW?

Specifically, we want to program LD6(PWR) of STM32F412G-DISCO.

Best answer by Andrew Neil

@pass3master wrote:

Specifically, we want to program LD6(PWR) of STM32F412G-DISCO.


But that LED is not programmable: it is hard-wired to the 5V supply - there is no connection to the STM32:

AndrewNeil_0-1729006153219.png

https://www.st.com/resource/en/schematic_pack/mb1209-f412zgt6-d04_schematic.pdf#page=4

4 replies

PGump.1
Senior II
October 15, 2024

Hi,

Isn't that done with JP3...

Kind regards
Pedro

AI = Artificial Intelligence, NI = No Intelligence, RI = Real Intelligence.
Associate III
October 15, 2024

Thank you for your answer.
Sorry for being st*pid. What does JP3 mean?

PGump.1
Senior II
October 15, 2024

Look on STM32F412G-DISCO for JP3...

AI = Artificial Intelligence, NI = No Intelligence, RI = Real Intelligence.
Karl Yamashita
Principal
October 15, 2024

Is there a specific reason you want to turn on the LED before the STM32 is initialized and running?

A better approach is to blink the LED to indicate the FW is running and didn't hard fault.

If a reply has proven helpful, click on Accept as Solution so that it'll show at top of the post.CAN Jammer an open source CAN bus hacking toolCANableV3 Open Source
Senior III
October 15, 2024

You can connect one transistor with its input biased to turn it on, connect the base curcuit to one gpio. At boot time gpio is in input mode. When the program runs, you can turn off the transistor. Hope this helps.  You can fine tune this idea with mosfet, optocoupler etc...

Andrew Neil
Andrew NeilBest answer
Super User
October 15, 2024

@pass3master wrote:

Specifically, we want to program LD6(PWR) of STM32F412G-DISCO.


But that LED is not programmable: it is hard-wired to the 5V supply - there is no connection to the STM32:

AndrewNeil_0-1729006153219.png

https://www.st.com/resource/en/schematic_pack/mb1209-f412zgt6-d04_schematic.pdf#page=4

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Associate III
October 16, 2024

Thank you for your response.
I see that the LED was coming directly from the 5V supply.
Now that I understand, I will close it.

Sco
ST Employee
October 16, 2024

In the default design, LD6 is not programmable. 

if you want to program LD6, the way is :

Step1: To remove R9.

Step2: To connect a GPIO(you can use resource from Arduino connector) to LD6 directly.

Step3: Program the GPIO you use.

Note that, brightness of LD depends on GPIO output capability.

 

Andrew Neil
Super User
October 16, 2024

@Sco wrote:

Step2: To connect a GPIO (you can use resource from Arduino connector) to LD6 directly


Don't connect directly - connect via a suitable resistor!

eg 510 ohms is used for the other green LED:

AndrewNeil_0-1729065367832.png

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.