cancel
Showing results for 
Search instead for 
Did you mean: 

Can't start first code with NUCLEO-H755ZI-Q

JZhan.15
Associate

I bought a new NUCLEO-H755ZI-Q board. It's my first STM32. I use MXCube to create a new project for MDK-ARM. I tried both STM32H755ZI and Nucleo-H755ZU-Q. And I enter my code in Application/User/CM7/Core/main.c . Between line 163 "/* USER CODE BEGIN WHILE" and line 166 "/* USER CODE END WHILE */". Rebuild all target files and press F8 download to chip. But it can't work. Can any one give me a hand please? Thanks a lot.

My Code is:

HAL_GPIO_WritePin(GPIOB,GPIO_PIN_0,GPIO_PIN_SET);

 HAL_Delay(1000);

 HAL_GPIO_WritePin(GPIOB,GPIO_PIN_0,GPIO_PIN_RESET);

 HAL_Delay(1000);

4 REPLIES 4
Imen.D
ST Employee

Hello @JZhan.15​ and welcome to the STM32 Community,

Please share your ioc file to check your clock configuration and code.

You can get insprired from this article GPIO feature overview to setup the pin and GPIO port in STM32CubeMX.

Refer to the GPIO_IOToggle examples within STM32CubeH7 MCU package, you may re-use sections available in the example or get inspired from them.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
JZhan.15
Associate

@Imen DAHMEN​ 

I tried two project. Using MXCube and select by MCU. Another select by board. Both won't run.

Here are my two progects. Thanks for help :)

Imen.D
ST Employee

Hi @JZhan.15​ ,

Please precise what do you expect exactly as result ?

I checked your "board" project, it seems the PB0 is not initialized.

So, you should add this initialization

GPIO_InitStruct.Pin = GPIO_PIN_0;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF11_ETH;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);

Also, I got an HAL_ERROR, and the MCU goes to the Error_Handler in the main. So, after commenting the Boot_Mode_Sequence code, the Led blinked.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

Hi @JZhan.15​ ,

Do you have still this problem to solve?

If you still need help, feel free to ask your question in more detail.

When your question is answered, please close this topic by choosing "Select as Best".

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen