Gpio_imx demo doesnt' work with FreeRtos on imx7 when linux is running

When I start the gpio_imx demo form bootloader (Colibri iMX7 # Prompt) the demo works fine.
When I boot the linux, the bootloader start the gpio_imx, but the gpio doesn’t work correctly.
The push buttons and the led isn’t working.

Please have a look here. To quote and reiterate as per the note

The interrupt part of the demo only works as long as Linux is not running. The reason for that is that Linux uses the same GPIO bank too, and reconfigures interrupts. The easiest way to use GPIO in interrupt mode on FreeRTOS while using Linux is to assign a complete GPIO bank to FreeRTOS and disabling the GPIO bank in Linux’ device tree.

Is there a way under the linux implementation to enable/disable GPIO or functions on a pin by pin basis.

Not really, the complete bank is assigned to Linux or not, and if it is assigned, it will handle the interrupt… There are two interrupts per GPIO bank, so in theory you could split it up, but the current driver expects both interrupts and requests them…

Note that you still can use pins in the same bank for other purpose from the Linux side, just not as a GPIO.