2015-07-28 04:52 AM
Combination of GPIO_MODE_AF and EXTI_MODE is non-working.
In my case that was NSS pin in SPI Slave Mode.HAL code (stm32fxxx_hal_gpio):/*--------------------- GPIO Mode Configuration ------------------------*/
/* In case of Alternate function mode selection */
if((GPIO_Init->Mode == GPIO_MODE_AF_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_OD))
and /* In case of Output or Alternate function mode selection */
if((GPIO_Init->Mode == GPIO_MODE_OUTPUT_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_PP) ||
(GPIO_Init->Mode == GPIO_MODE_OUTPUT_OD) || (GPIO_Init->Mode == GPIO_MODE_AF_OD))
{Solution:Change code by applying mask:
/*--------------------- GPIO Mode Configuration ------------------------*/
/* In case of Alternate function mode selection */
if((GPIO_Init->Mode & GPIO_MODE) == GPIO_MODE_AF_PP)
{
and
/* In case of Output or Alternate function mode selection */
if ((GPIO_Init->Mode & GPIO_MODE) != GPIO_MODE_INPUT)
{
2015-08-03 03:10 AM
Hi isaev.michael,
What do you mean by ''Combination of GPIO_MODE_AF and EXTI_MODE is non-working''? and which product are using? -Shahrzed-2016-02-07 08:27 PM
Hi, shahrzad !
In one of my projects I need to do some work on SPI Slave with hardware NSS when it come inactive (end of session). In my first post I meant that when I combine GPIO_MODE_AF_xx (SPI Slave NSS in input mode) and GPIO_MODE_IT_xx, alternative function will not be activated, as code of HAL_GPIO_Init() checks for equality with GPIO_MODE_AF_PP and GPIO_MODE_AF_OD without masking interrupt mode bits. Processos doesn't prohibit such combinations, and all works fine after some correction of HAL_GPIO_Init() code.2016-03-01 05:45 AM
Hi isaev.michael,
Thanks for your feedbacks and contribution. I will check this with our developpement team and come back to you. -Hannibal-