cancel
Showing results for 
Search instead for 
Did you mean: 

CRH support missing in stm32f1xx_ll_gpio.h ?

Willunen
Associate III
Posted on March 05, 2018 at 20:48

Using TrueStudio for STM32 v.9.0.0  and STMCubeMX v.4.24.0

STM32F100C8 and Low Layer drivers.

I noticed that LL support for GPIO ports above GPIO_PIN_7 does not work. I tried to use GPIO_PIN_13 on GPIOC but saw that PIN_5 was being configured instead. Browsing through stm32f1xx_ll_gpio.h, I noticed that CRL is, but CRH isn't used anywhere.

Also RCC_MCO doesn't work, as it is on GPIOA PIN_8.

------------

And shouldn't stm32f1xx_hal_conf.h refer to LL drivers instead of HAL drivers when you selected LL in STM32CubeMX?

It says:

#define HAL_CORTEX_MODULE_ENABLED

#define HAL_DMA_MODULE_ENABLED

#define HAL_FLASH_MODULE_ENABLED

#define HAL_GPIO_MODULE_ENABLED

#define HAL_PWR_MODULE_ENABLED

#define HAL_RCC_MODULE_ENABLED

and then:

#ifdef HAL_RCC_MODULE_ENABLED

 #include 'stm32f1xx_hal_rcc.h'

#endif /* HAL_RCC_MODULE_ENABLED */

#ifdef HAL_GPIO_MODULE_ENABLED

 #include 'stm32f1xx_hal_gpio.h'

#endif /* HAL_GPIO_MODULE_ENABLED */

   

#ifdef HAL_DMA_MODULE_ENABLED

  #include 'stm32f1xx_hal_dma.h'

#endif /* HAL_DMA_MODULE_ENABLED */

   

#ifdef HAL_ETH_MODULE_ENABLED

  #include 'stm32f1xx_hal_eth.h'

#endif /* HAL_ETH_MODULE_ENABLED */

Shouldn't that be:

#ifdef HAL_RCC_MODULE_ENABLED

 #include 'stm32f1xx_ll_rcc.h'

#endif /* HAL_RCC_MODULE_ENABLED */

#ifdef HAL_GPIO_MODULE_ENABLED

 #include 'stm32f1xx_ll_gpio.h'

#endif /* HAL_GPIO_MODULE_ENABLED */

   

#ifdef HAL_DMA_MODULE_ENABLED

  #include 'stm32f1xx_ll_dma.h'

#endif /* HAL_DMA_MODULE_ENABLED */

   

#ifdef HAL_ETH_MODULE_ENABLED

  #include 'stm32f1xx_ll_eth.h'

#endif /* HAL_ETH_MODULE_ENABLED */
1 ACCEPTED SOLUTION

Accepted Solutions
Imen.D
ST Employee
Posted on March 22, 2018 at 10:04

Hello,

We would inform you that 

GPIO LL driver issue is fixed in 

the new patch of

STM32CubeF1 Firmware package V1.6.1.

Kind Regards

Imen

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

View solution in original post

6 REPLIES 6
Willunen
Associate III
Posted on March 06, 2018 at 10:28

As an addition to the second question about including HAL drivers instead of LL drivers: a screenshot

0690X00000604ReQAI.jpg

No doubt I'm doing something wrong, but I can't find what....

Imen.D
ST Employee
Posted on March 06, 2018 at 13:45

Hello

Lunenburg.Wilko

,

I want to thank you for your issues report.

The issue for LL GPIO pins is already confir

med and will be fixed in the next release.

https://community.st.com/0D50X00009XkYowSAF

.

About

including HAL drivers instead of LL drivers, Iwill check and raise internally your feedback.

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on March 06, 2018 at 14:48

 ,

 ,

Thanks Imen, I solved it this way by adding this to MX_GPIO_Init

RCC->,APB2ENR |= RCC_APB2ENR_IOPCEN, , ,  , , ,  , , ,  , , ,  , , ,  , , , , //enable APB2_clock GPIOC

 ,

GPIOC->,CRH |= GPIO_CRH_MODE13_1, , ,  , , ,  , , ,  , , ,  , , ,  , , ,  , , ,  , , ,  ,//PC13 output

 ,

GPIOC->,CRH &,= ~GPIO_CRH_CNF13, , ,  , , ,  , , ,  , , ,  , , ,  , , ,  , , ,  , , ,  , , ,  ,//PC13 push pull

And by changing the stm32f1xx_hal_conf.h like this:

♯ ifdef HAL_RCC_MODULE_ENABLED

 ,

 , ♯ include 'stm32f1xx_ll_rcc.h' , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , //changed from _hal_ to _ll_

 ,

♯ endif /* HAL_RCC_MODULE_ENABLED */

♯ ifdef HAL_GPIO_MODULE_ENABLED

 ,

 , ♯ include 'stm32f1xx_ll_gpio.h'

 ,

♯ endif /* HAL_GPIO_MODULE_ENABLED */

 ,

.

.

.

 ,

Kind Regards,

Wilko

Posted on March 10, 2018 at 10:10

Hello Imen,

You said '

About 

including HAL drivers instead of LL drivers, I will check and raise internally your feedback'. I do not think that is needed as the file stm32f1xx_hal_conf.h isn't used at all. I deleted it with no ill effects. The correct Includes are done in main.h.

Kind Regards,

Wilko

Posted on March 12, 2018 at 10:18

Hello

Lunenburg.Wilko

,

After check and regenerated an example using STM32CubeMX version 4.0. The generated stm32f1xx_hal_conf.h is not conformal to stm32f1xx_hal_conf_template.h contains an extra include of 'main.h' !So, you should remove the extra include of main.h.

This issue is already reportedinCubeMx team.

Kind Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Imen.D
ST Employee
Posted on March 22, 2018 at 10:04

Hello,

We would inform you that 

GPIO LL driver issue is fixed in 

the new patch of

STM32CubeF1 Firmware package V1.6.1.

Kind Regards

Imen

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