cancel
Showing results for 
Search instead for 
Did you mean: 

Possible bug in ST25NFC_Embedded_Lib_ST25R3911B_1.5.0

CanRF
Associate

We use ST25NFC_Embedded_Lib_ST25R3911B_1.5.0 for our current project.

There are some example inside.

In all example in stm32l4xx_hal_msp.c are the following code:

/* Configure all GPIO port pins in Analog Input mode (floating input trigger OFF) except debug pins */
GPIO_InitStruct.Pin = GPIO_PIN_All & (!(GPIO_PIN_13|GPIO_PIN_14));

GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_All & (!(GPIO_PIN_3));

But & (!(GPIO_PIN_ should be & (~(GPIO_PIN_

Please fix this in next release.

1 ACCEPTED SOLUTION

Accepted Solutions

Understood. Thanks for the feedback, we will correct in the next version.

 

Ulysses

View solution in original post

3 REPLIES 3
Ulysses HERNIOSUS
ST Employee

Hi CanRF,

 

I agree with you that a bit-negation should be used here.

However I am wondering which misbehavior you observed: GPIO pins should be by default already in Analog mode, so I think above is more or less a NOP when run out of RESET.

BR, Ulysses

GPIO_PIN_All & (!(GPIO_PIN_13|GPIO_PIN_14))

and 

GPIO_PIN_All & (!(GPIO_PIN_3))

results to 0

in HAL_GPIO_Init() is

assert_param(IS_GPIO_PIN(GPIO_Init->Pin));
that checks that GPIO_InitStruct.Pin is not 0.

This code never works with assert_param() enabled.

Understood. Thanks for the feedback, we will correct in the next version.

 

Ulysses