Skip to main content
Visitor
July 9, 2026
Question

LED label in STM32CubeMX may be incorrect for NUCLEO64 STM32G431

  • July 9, 2026
  • 3 replies
  • 52 views

Hello Community

This is my first post here, and I have started learning about the STM32G4xx processors. So I might very well have got something wrong here. I like to ask about a detail in the pin-out picture of the STM32G431 Nucleo64 board in STM32CubeMX software.

 

When I look at the schematics for this Nucleo board, it seems that the PA5 pin can activate the LD2 LED and not the LD1. I guess, that for the typical beginner start blink software, you normally use LD2. When I look at the same picture for the NUCLEO64 STM32G474 board, this PA5 pin activate LD2.

The same pin is used for input to an OP-AMP. Would it be possible to use it if you disconnect the SB6 jumper?

3 replies

Peter BENSCH
ST Technical Moderator
July 9, 2026

Welcome ​@Backflip, to the community!

It is always advisable to first take a look at the basic rules of forum boards. In the community’s case, you can find them right on the first page at the top right under “Ready to get started?” under Tips on posting:

In your case, I am missing the versions of the software and firmware used and the steps to create your project. If I create an empty project for a NUCLEO-G474RE using the current CubeMX 6.18.0 and the current firmware STM32Cube_FW_G4_V1.6.3, the correct LD2 is found on PA5.

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
BackflipAuthor
Visitor
July 9, 2026

Hello Peter

Thanks for the advise.

Actually, before I posed my question, I updated to the 6.18.0, and it seems that I got the same issue than the previous version. 

Yes, for the NUCLEO-G474RE the Pin label seems correct. It is the NUCLEO-G431RB that I am asking about in the CubeMX Pinout wiew. You see the screen dump above with a red marking ring around the issue. I think this marking should have been (LD2) like for the G474RE.

Regards /Backflip

Peter BENSCH
ST Technical Moderator
July 9, 2026

You caught me - I should not only have skimmed your question, but read it properly.

This appears to be another typo going back at least as far as CubeMX 6.16.1, as I was able to confirm after a brief check. The cause turned out to be two XML files located in the CubeMX installation folder under:

db\plugins\boardmanager\boards\bsp

  • NUCLEO-G431RB_Configs.xml  
  • NUCLEO-G431RB_Modes.xml

You can edit them with a text editor and replace every occurrence of the string LD1 with LD2, then your pinout will be generated correctly.

I’ll also inform ​@mƎALLEm  so that the behaviour is corrected in the next version.

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
mƎALLEm
ST Technical Moderator
July 9, 2026

Hello ​@Backflip and welcome to the community,

For your question:

The same pin is used for input to an OP-AMP. Would it be possible to use it if you disconnect the SB6 jumper?

Yes you can use that GPIO for the OPAMP input while removing SB6.

For the CubeMx, I’ll escalate internally for analysis and fix (internal ticket for follow-up: CDM0064210) as in the schematic the reference is LD2: 

Thank you ​@Peter BENSCH for the notification.

Hope that helps.

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
BackflipAuthor
Visitor
July 9, 2026

Thank you for your replies. Good for me to know, that this marking should have been LD2. I wondered that, I may had got something else wrong about this.

It seems to me, that CubeMX assumes, that the SB6 jumper is installed, so you cannot use CubeMX to set the PA5 as input for OPAMP2. But I guess, that you can use some HAL function to do it. Am I right?

 

mƎALLEm
ST Technical Moderator
July 9, 2026

Thank you for your replies. Good for me to know, that this marking should have been LD2. I wondered that, I may had got something else wrong about this.

It seems to me, that CubeMX assumes, that the SB6 jumper is installed, so you cannot use CubeMX to set the PA5 as input for OPAMP2. But I guess, that you can use some HAL function to do it. Am I right?

 

CubeMx doesn’t care if SB6 is soldered or not. So remove SB6 and configure PA5 for OPAMP function either in CubeMx or using directly the HAL.

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.