In the GPIO_DRV_OutputPinInit() function located in fsl_gpio_driver.c, the function calls the GPIO_HAL_SetPinDir() function that enables the pin prior to setting up the GPIO output features.
If an output is set to active low, it will be active as soon as the GPIO_HAL_SetPinDir() function is called, prior to the GPIO_HAL_WritePinOutput() call with the outputPin->config.outputLogic of 1.
Calling GPIO_HAL_WritePinOutput() prior to GPIO_HAL_SetPinDir() appears to correct the issue.
Hello Luciano,
Yes , in my personal opinion, you are right .
Strictly speaking, we should first configure the logic level(0 or 1) , then set the gpio to output direction.
You can change the two HAL function position , then build the ksdk_platform_lib again, then use the function :
GPIO_DRV_OutputPinInit() .
Hope it helps
Have a great day,
Alice
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
I've already reworked the order slightly. This bug actually causes our board to go into a reset loop, as it turns on components that draw too much power before we can negotiate more power over the USB connection.
Hi Luciano,
Sorry for the inconvenient to you !
BR
Alice