Skip to main content
Graduate
March 11, 2024
Solved

Possible bug in ST25NFC_Embedded_Lib_ST25R3911B_1.5.0

  • March 11, 2024
  • 1 reply
  • 1281 views

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.

    This topic has been closed for replies.
    Best answer by Ulysses HERNIOSUS

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

     

    Ulysses

    1 reply

    Technical Moderator
    March 12, 2024

    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

    CanRFAuthor
    Graduate
    March 12, 2024

    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.

    Technical Moderator
    March 12, 2024

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

     

    Ulysses