2024-03-11 08:58 AM
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.
Solved! Go to Solution.
2024-03-12 03:23 AM
Understood. Thanks for the feedback, we will correct in the next version.
Ulysses
2024-03-12 01:56 AM
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
2024-03-12 03:18 AM
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.
2024-03-12 03:23 AM
Understood. Thanks for the feedback, we will correct in the next version.
Ulysses