Date
1 - 5 of 5
NRF52832 and GPIO #gpio #nrf52832
forum.contas@...
Not sure if I'm going to have any help on this, but anyway:
I've a standard NRF52832 module that has connected to pin 5 a red LED. If I flash the module (through JLink) with the Arduino framework, the led blinks without any problem. So there isn't a hardware issue. Since the module is not a standard supported board, but it's a common supported processor, for using zephyr I've chose a similar board either the nrf52832_mdk or another that uses the same processor, created an overlay file to point the default LED to the correct pin and port (Port 0, pin 5), and flashed the blinky sample example. It didn't work... So I've checked several different based NRF52832 boards, checked that there was no pin conflicts on the DTS, only had enabled the CONFIG_GPIO=y on the prj.conf file, but nothing works. Flash it with the Arduino framework for the NRF, the link blinks. Also flashing, for example the Zephyr BLE beacon example, works without any issue, so it seems I'm missing something crucial on the GPIO front. I've tested with several different flags, like GPIO_OUTPUT, GPIO_OUTPUT_HIGH and so on, but nothing works. So... any ideas of what I'm doing wrong, so that this simple GPIO is failing? |
|
Erik Englund
Are you sure that your board boots correctly? ( debug through gdb or just simple serial output ) What version of the SDK are you using? Is MCUBoot activated in your prj.conf? |
|
forum.contas@...
Hi, No MCUBoot.
toggle quoted message
Show quoted text
And yes, the board boots correctly and I can use GDB to debug. I can see the GPIO driver calls, the values that are set and so on. My prj.conf file is as simple as it can get: CONFIG_GPIO=y nothing else. If I flash for example the BT beacon example, it works fine, so not probably not an issue with the board. I've tried anything more complex, since I'm stuck with the simpler case :) An example of the debug session: 84 gpio_pin_set(gpio_dev, led->gpio_pin, 1); |
|
Erik Englund
Have you done the initialization by running gpio_pin_configure with GPIO_OUTPUT_ACTIVE as third argument ? Just to be clear, you´re trying to set pin p0.05 ? That´s located on chip pin7 (QFN48 pkg) ? Chip pin 5 is routed to p0.03. Med vänlig hälsning Erik Englund Innoware Development AB Hyttvägen 13 73338 SALA Org.nr. 556790-2977 www.innoware.se |
|
forum.contas@...
Ok, found the issue:
It was do to pin mapping naming. I was assuming that the pinmaps in Arduino D5, D6, and so on, corresponded to a direct GPIO map, so D5->GPIO_5 and so on... and that's not true. After using the correct pin number on Zephyr, it works as it should. |
|