cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX - Where did GPIO 16-bit port access functions go?

frank2
Associate
Posted on July 17, 2014 at 16:31

Hi

Migrating from STM32F4-Discovery_FW_V1.1.0 to STM32Cube_FW_F4_V1.3.0 firmware creates some difficulties with regards to GPIO port access.  The functions below are not available anymore or did I miss something?  Port bit access and manipulation are well supported.

GPIO_ReadInputData()

GPIO_ReadOutputData()

GPIO_Write()

GPIOx->IDR and GPIOx->ODR can be used to access the ports and write your own port access functions.

A lot of code reworking is now necessary to convert old code to the HAL based firmware.  I do support the new HAL based firmware as it is a step in the right direction.  STM32CubeMX developers seems to just omit functions available in older firmware with no communication or explanation in this regard.  

Is there somebody at ST whom can shed any light on this subject?  

Thanks
3 REPLIES 3
Posted on July 18, 2014 at 13:10

Hi adlam.frank,

The STM32Cube embedded software solution is based on STM32 Hardware Abstraction Layer HAL. The STM32Cube HAL Layer is the replacement of the Standard Peripheral Library (StdPeriphLib).

The STM32CubeMX generated code is based on HAL library and not on StdPeriphLib.

The HAL GPIO driver provides the following APIs:

  • HAL_GPIO_Init()
  • HAL_GPIO_DeInit()
  • HAL_GPIO_ReadPin()
  • HAL_GPIO_WritePin()
  • HAL_GPIO_TogglePin()

And it offers two new features compared to StdPeriphLib GPIO driver:

  • A pin can be configured as EXTI with interrupt or event generation
  • Alternate field allows selection of the Alternate function for a pin (AFxx)

For more details please refer to:

Customers currently using Standard Peripheral Libraries will be helped through Migration guides (will be soon online).

Thank you for your interest in our STM32Cube solution.

With regards.
frank2
Associate
Posted on July 21, 2014 at 09:10

Hi 

I tried to convert a project based on the Standard Peripheral Library (StdPeriphLib) to the STM32 Hardware Abstraction Layer HAL with the aim not to be dependent or backward compatible on any old libraries.  Having done what you have recommended in your reply and comprehending the differences between Standard Peripheral Library (StdPeriphLib) to the STM32 Hardware Abstraction Layer HAL, initiated my initial post.  The answer maybe in part of your response which is quoted below.

''Customers currently using Standard Peripheral Libraries will be helped through Migration guides (will be soon online).''

It maybe implies that the STM32 Hardware Abstraction Layer HAL or part thereof was released before proper documentation (migration guides) was ready for customers.  This creates a basis for confusion and frustration.

May I request the STM32Cube developers to be mindful of this in the future?  

Thanks
Posted on July 21, 2014 at 14:43

Hi adlam.frank,

We hear your frustration and take all feedback and suggestions into consideration and are working hard to improve the STM32Cube experience for everyone.

Keep submitting feedback and we'll keep working to make a better STM32Cube !

With regards.