iMX6SX: GPIO_Init() resets IMR of all pins (gpio_imx driver @FreeRTOS)

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

iMX6SX: GPIO_Init() resets IMR of all pins (gpio_imx driver @FreeRTOS)

ソリューションへジャンプ
1,657件の閲覧回数
kubiznak_petr
Contributor V

I hit on an issue with the gpio_imx driver shipped with the FreeRTOS BSP v1.0.1 (FreeRTOS_BSP_1.0.1_iMX6SX\platform\drivers\src\gpio_imx.c). In the beggining of the GPIO_Init() function, GPIO_IMR and GPIO_EDGE_SEL registers are cleared:

    /* Register reset to default value */
    GPIO_IMR_REG(base) = 0;
    GPIO_EDGE_SEL_REG(base) = 0;

Anyway, the function serves for initialization of a single GPIO pin. When called to reinitialize a pin configuration at runtime, the settings of IMR and EDGE_SEL registers are lost for all pins on that port. I believe this is a bug and the aforementioned code should be masked to only affect a single bit, as follows:

    /* Register reset to default value */
    GPIO_IMR_REG(base) &= ~(1U << pin);
    GPIO_EDGE_SEL_REG(base) &= ~(1U << pin);

Can someone please confirm this is a correct fix? Or would that cause any side effects?

ラベル(2)
タグ(3)
0 件の賞賛
返信
1 解決策
1,497件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi Petr

fix seems as quite sensible, I do not think it would cause any side effects.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,498件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi Petr

fix seems as quite sensible, I do not think it would cause any side effects.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信
1,497件の閲覧回数
kubiznak_petr
Contributor V

Great, thank you Igor.

0 件の賞賛
返信