Skip to main content
Explorer
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.

    This topic has been closed for replies.
    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

    Graduate II
    October 15, 2024

    Hi,

    Isn't that done with JP3...

    Kind regards
    Pedro

    Explorer
    October 15, 2024

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

    Graduate II
    October 15, 2024

    Look on STM32F412G-DISCO for JP3...

    Graduate II
    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.

    Graduate II
    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...

    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

    Explorer
    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.

    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.

     

    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