Hi Parvaneh,
Hello all, I find your response to my question in Dvel Archive. I changed the parameter of gpio_new() that I am calling in my gpio_init_pin() (I changed it from 0 to 1 to have output direction). But I keep getting same error: imx6_gpio_init@gpio.c:96 Invalid GPIO Assertion failed: bank->data == v (libplatsupport/src/plat/imx6/gpio.c: imx6_gpio_set_level: 136) My question is that could it be because of pin number that I pass to gpio_new function. Here I have copied parts of my code: ...
I had a closer look at the drivers and the issue does seem to lie with the pin number that you pass to gpio_new, this causes gpio_new to fail and return an error. From the first email, I see that you pass pin number 28 to the gpio_new function. gpio_new calls a GPIO pin initialisation function, and inside this function it calls another function to mux the GPIO pin so that it is the active pin out of the group of pins in its corresponding pad [1]. Unfortunately, in the GPIO pin mux function we do not have code to mux pin number 28 out [2]. So to resolve your problem, you would have to add an additional switch case to be able to set the bits in the register which controls the pad that pin number 28 is located in. Consider going through page 2028 in the i.MX6Dual/6Quad reference manual as it may be helpful. Sincerely, Damon [1] https://github.com/seL4/util_libs/blob/master/libplatsupport/src/plat/imx6/g... [2] https://github.com/seL4/util_libs/blob/master/libplatsupport/src/plat/imx6/m...