cancel
Showing results for 
Search instead for 
Did you mean: 

How to Blink onboard LED on a NUCLEO-H755ZI-Q WITHOUT using BSP - only HAL?

smallkitties3
Associate II

Have got the NUCLEO-H755ZI-Q board with the STM32H755ZI chip on it and able to use the BSP package and drive the three LEDs and also perform debugging.

However, whenever tried to build a new project and select STM32H755ZI (not NUCLEO-H755ZI-Q) and configure the project based on the settings in NUCLEO-H755ZI-Q the code does not run. Nor is debugging possible. Also, used the neat Compare Projects tool; but nothing that would impact it stood out.

Have already looked in this online ST-forum and the https://github.com/STMicroelectronics/STM32CubeH7/tree/master and cannot find a simple example of configuring a blinky for a this dual-core or any other - that does not rely on BSP.

All is needed are snapshots of the STM32CubeMX setup.

Thank you and peace to all.

6 REPLIES 6
gbm
Lead III

What kind of help do you expect without providing any code nor CubeMX picture? All you need to do is to configure the LED port line as output in CubeMX, then add 4 lines of code to SysTick ISR.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
SofLit
ST Employee

Hello @smallkitties3 and welcome to the community,


Simply, click on "Unselect All" button to prevent CubeMx to generate the BSP code and configure the GPIOs according to your needs.

SofLit_0-1734598976222.png

I've attached a project where Green, Red, Yellow leds are toggling on NUCLEO-H755 board. The project was generated with CubeMx v6.13 starting from a the board (Bsp generation disabled from the beginning).

Hope that answers your question.

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.

@smallkitties3 wrote:

 the code does not run. Nor is debugging possible. 


What, exactly, do you mean by that?

What happens when you try to debug?

 

To answer the question in your title: "How to Blink onboard LED on a NUCLEO-H755ZI-Q WITHOUT using BSP - only HAL?" - you simply use the HAL_GPIO_... functions to turn the LED on & off:

  • HAL_GPIO_WritePin( led_GPIO_port, led_GPIO_Pin, GPIO_PIN_RESET )
  • HAL_GPIO_WritePin( led_GPIO_port, led_GPIO_Pin, GPIO_PIN_SET )

or

  • HAL_GPIO_TogglePin( led_GPIO_port, led_GPIO_Pin )

Hello gdm,

To answer your question, I expected snapshots of how to configure CubeMX for the STM32H755ZI to do a simple blinky of either of the embedded LEDs.

My Configuration already has: (see CubeMX attached snapshot)
1) The three LEDs selected
2) In RCC, the HSE & LSE were disabled and the HSI RC is configured in Clock Configuration
3) Both SYS_M4 & SYS_M7 are using SysTick for the Timebase Source

Not sure what "add[ed] 4 lines of code to SysTick ISR" you're speaking about as that was not required when using the BSP. Code Generator already took care of those settings.

Thank you for your reply. 

Hello SofLit,

Thank you for this suggestion and attaching the project. However, the process in suggestion masks the process of configuration and the Categories section (in Pinout & Configurations tab) still has the BSP listed as a remanent.

The very purpose for purchasing this development/discovery board was to learn how to design and program the onboard dual-core.

Thank you for your reply and welcome.

Hello Andrew Neil, 

By "the code does not run" portion, the meaning was that both STM32H755ZI generated ELFs were uploaded externally using the Programmer and after hard-reset the code did not evidently run ("no blinky"). This was in opposition to the experience when the NUCLEO-H755ZI-Q BSP generated ELFs were externally uploaded using the Programmer.

By the "Nor is debugging possible" portion, the meaning was that:
1) After full Flash erasure, using Programmer; a debug connection attempt was only possible after entering bootloader.
2) Then, when a CubeIDE debug launch-group was performed it resulted in:
Info : default port : 7184
Info : Remote address: 127.0.0.1
Info : stlinkserver already running, exit
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Shutting down...
Exit

That, however, was not experienced with the NUCLEO-H755ZI-Q project (using BSP) debugging launch-group. The launch-group debugging would erase, upload new program, and start the debugging process. Furthermore, it did not care if the chip was in bootloader mode - and still made a connection even after full Flash erasure.

Lastly, yes, you are correct; that is how to use HAL to blink an LED. But the original question was more on how to configure the project in CubeMX while selecting STM32H755ZI - and not rely on selecting the NUCLEO-H755ZI-Q package during the project creation process.

Thank you for your reply