Help needed with GPIO and 32kHz Crystal issues on custom nRF52832 board

Hello everyone,

I'm experiencing some issues while trying to program an nRF52832 CIIA on a custom PCB. Specifically, I cannot get the GPIO pins or the external 32kHz crystal to work properly. However, I can run programs, debug, and use printk through RTT without issues.

On the hardware side, I'm fairly confident that the design is correct as I followed the guidelines from the nRF52832 hardware design documentation. The GPIO pins I have available (P0.9 and P0.21) are showing floating voltages.

Here’s what I’ve tried so far:

  • Running the Blinky example: it compiles and runs, but the GPIOs do not respond.
  • Setting all GPIOs on the SoC to Low Level and setting internal Pull-Downs, but the pins remain floating.
  • Created a custom board with a .dts file from scratch.
  • Tested with some pre-existing board definitions as well.
  • Tried various SDK versions through VSCode with nRF Connect SDK and Zephyr, but no luck so far.


The prj.conf:

CONFIG_GPIO=y

CONFIG_DEBUG=y

CONFIG_PRINTK=y

CONFIG_LOG=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_RTT_CONSOLE=y
CONFIG_UART_CONSOLE=n

CONFIG_LOG_MODE_IMMEDIATE=y
CONFIG_DEBUG_THREAD_INFO=y
CONFIG_THREAD_MONITOR=y
CONFIG_ASSERT=y

CONFIG_NO_OPTIMIZATIONS=y

CONFIG_CONSOLE=y
CONFIG_LED=y

# if XTAL=y it crashs
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
# CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH=n



Any suggestions on how to resolve this would be greatly appreciated. If there's something I could be missing in terms of configuration or setup, please let me know.

Thanks in advance!

Parents
  • Hi,

    It does looks like you have tried troubleshooting well. You mentioned that the GPIOs also have problem. Please make sure that you have properly initialized them in your code. As for the external crystal issue, please make sure that you have the .dts file written correctly. Same for the GPIO pins.

    Have you tried maybe to run you code on any DK, just to make sure that the issue is not isolated to your custom hardware?

    Regards,

    Priyanka

Reply
  • Hi,

    It does looks like you have tried troubleshooting well. You mentioned that the GPIOs also have problem. Please make sure that you have properly initialized them in your code. As for the external crystal issue, please make sure that you have the .dts file written correctly. Same for the GPIO pins.

    Have you tried maybe to run you code on any DK, just to make sure that the issue is not isolated to your custom hardware?

    Regards,

    Priyanka

Children
  • Hi Priyanka,

    I'll test it on the SDK as soon as I can.

    Meanwhile, I've been working on the GPIOs. I can change the pull-up/pull-down configurations on some pins while the main program is running and I detect the voltage changes.

    Additionally, after using the gpio_pin_configure_dt() function, I can see the output register update during debugging, but there's no corresponding change in the pin voltage

    As example, pin 9 is configurated ( and checked on the PINCNF[] register during debugging) as  GPIO_OUTPUT_HIGH and GPIO_PULL_DOWN

    This pin appears in the builded file zephyr.dts as:

    	aliases {
    		muxen = &mux_en;
    	};
    	
    	leds {
    		mux_en: mux_en {
    			gpios = < &gpio0 0x9 0x0 >;
    			label = "MUX_EN";
    		};


    I would appreciate any recommendation meanwhile I proceed to try on another DK boards.

    Thank you for your attention!

  • Hi,

    You could maybe try to force the correct output mode with pull-down, try specifying the GPIO flags directly:

    mux_en: mux_en {
    gpios = <&gpio0 9 GPIO_OUTPUT_HIGH | GPIO_PULL_DOWN>;
    label = "MUX_EN";
    };

    You could also try a minimal test case with only the GPIO configuration and toggling. If pin 9 is still unresponsive, then maybe you could try with another GPIO pin too.

    -Priyanka

Related