cancel
Showing results for 
Search instead for 
Did you mean: 

Why would cube IDE not generate code for a free and available GPIO pin

DMAYE.1
Associate II

The GPIO clock is the only code that seemed to be generated under the initialization function. the other necessary code such as the following was not created.

GPIO_InitTypeDef GPIO_InitStruct;

GPIO_InitStruct.Pin = GPIO_PIN_8;

GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;

GPIO_InitStruct.Pull = GPIO_NOPULL;

GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;

HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);

In the setup GUI I had selected the pin PC8, and set it to a GPIO_Output yet the above code was not generated.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @DMAYE.1​ ,

Thanks for the share of your ioc file which allowed me to know the main reason of the GPIO configuration code disappearance.

In fact, in the case of the stm32H7 Dual Core , when the pin is not linked to an IP that we have already started its activation by choosing on which cortex it is assigned, this pin remains free, i.e, it does not know on which cortex it is up to.

For its configuration to be correctly generated, you have to choose the cortex of this pin by right click on the pin, click on the Pin Reservation and then check one of the two cortex.

Once you generate your project, you will find the complete GPIO code in the /*Configure GPIO pin : PC8 */ section under main.c/MX_GPIO_Init function 🙂 .

0693W000008G18ZQAS.png 

Hope my answer helped you, when your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Thanks for your contribution, Khouloud

View solution in original post

7 REPLIES 7
KnarfB
Principal III

Never seen before. What tool / version ? What chip?

DMAYE.1
Associate II

stm32 cube IDE

latest version I think 1.5.1

Nucleo-144 STM32H755ZI-Q

Khouloud ZEMMELI
ST Employee

Hello @DMAYE.1​ 

Thanks for your feedback,

Could you please share your ioc file to check your problem?

Thanks, Khouloud

DMAYE.1
Associate II

Yes, and Thank you in advance! the .ioc file is attached.

Hi @DMAYE.1​ ,

Thanks for the share of your ioc file which allowed me to know the main reason of the GPIO configuration code disappearance.

In fact, in the case of the stm32H7 Dual Core , when the pin is not linked to an IP that we have already started its activation by choosing on which cortex it is assigned, this pin remains free, i.e, it does not know on which cortex it is up to.

For its configuration to be correctly generated, you have to choose the cortex of this pin by right click on the pin, click on the Pin Reservation and then check one of the two cortex.

Once you generate your project, you will find the complete GPIO code in the /*Configure GPIO pin : PC8 */ section under main.c/MX_GPIO_Init function 🙂 .

0693W000008G18ZQAS.png 

Hope my answer helped you, when your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Thanks for your contribution, Khouloud

DMAYE.1
Associate II

Thank you so much. That is the issue. I was looking for the pin assignment under the system gpio tabs. It wasn't in that setup. And I think it should be. Thank you once again.​

Always welcome @DMAYE.1​  🙂

Khouloud