Configuring PIN 0.00 and P0.01 as GPIO

I am trying to use P0.00 and P0.01 as GPIOs on nrf5340 DK board. I have opened SB1 and SB2. Also, soldered SB3 and SB4. I am using blinky example to test the configuration. However, I can not set the logic levels. The Pin 0.00 set to  logic 0.

I have modified prj.conf to enable internal RC oscillator. prj.conf looks as follows

CONFIG_GPIO=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH=y

Please find the complete project at GITHUB link: nrf5430_playground/blinky at master · surendranadkarni/nrf5430_playground (github.com)

Would you please help?

  • Hi,

    When I test the code with the configuration from your last post, this works as expected if I build for nrf5340dk_nrf5340_cpuapp. However, it does not work when building for nrf5340dk_nrf5340_cpuapp_ns. Is that what you are doing?

    If so, the problem is that TF-M does respect CONFIG_SOC_ENABLE_LFXO=n. I have reported this to the maintainers. I do not have an elegant solution for now, but you can simply comment out these two lines in the implementation of spu_periph_init_cfg() in <SDK>/modules/tee/tf-m/trusted-firmware-m/platform/ext/target/nordic_nrf/common/nrf5340/target_cfg.c:

        /* Configure properly the XL1 and XL2 pins so that the low-frequency crystal
         * oscillator (LFXO) can be used.
         * This configuration can be done only from secure code, as otherwise those
         * register fields are not accessible.  That's why it is placed here.
         */
        nrf_gpio_pin_control_select(PIN_XL1, NRF_GPIO_PIN_SEL_PERIPHERAL);
        nrf_gpio_pin_control_select(PIN_XL2, NRF_GPIO_PIN_SEL_PERIPHERAL);

Related