2021-09-25 08:09 AM
I'm using a Nucleo -64 stm32f030r8 board.
I've looked at various "blinky" tutorials and they all seem to just pick a a pin out of the air as the LED pin and then flash it through HAL_Toggle_Pin. I have the datasheet for the device but I seem to be blind, stupid and/or a combination of the two.
Can some kind soul step me through the "process" you use to determine which pin ld2 (the green led) is on? I created an stm32 project from the IDE wizard selecting the correct board but no pin is assigned as default as the LED. I can compile, upload and debug etc, it's just me not being able to figure out the LED assignment. Something very obvious I'm sure!
(as a side note, the IDE runs really poorly on my Debian testing desktop and frequently crashes but I can cope with that for now).
Solved! Go to Solution.
2021-09-25 08:13 AM
And 3s after I post, at my wits end, I discover the answer. I had created a project for the MCU not the board. Selecting from the board selection dialog sorted this out! So, minus several million points for me....
2021-09-25 08:13 AM
And 3s after I post, at my wits end, I discover the answer. I had created a project for the MCU not the board. Selecting from the board selection dialog sorted this out! So, minus several million points for me....
2021-09-25 08:31 AM
The user manual for the board will also contain this information.
2024-08-02 08:42 PM
To expand on TDK's answer:
In the User Manual there is a section usually titled "Hardware layout and configuration" and if your board has built-in LED's there is a subsection titled "LEDs".
I have 2+ boards with built-in LEDs and both user manuals had this convention but your mileage may vary.
In the "LEDs" subsection there will be information which includes the LED numbers, usually in form LD#. Beside the LED number will be a signal number possibly (which you should note down) and a pin number, such as PB4. The pin number requires some decoding; for a pin number PB4, the pin number is 4 on GPIO B.
If the user manual is for multiple board models, as it is for the Nucleo-64 boards, there may be a table of pin, signal, and function correspondences. The signal number you noted should help verify that the pin number corresponds to the correct signal for targeting the LED.