This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

GPIO port 1 unable to read with MCUBoot added

I've recently upgraded my SDK to 1.6.0 and I am now unable to read the state of P1.00 but I am able to read the state of P0.28.

I've stripped the project down to just a gpio setup and pin read loop.

If I remove the MCUBOOT define I can read the pin on GPIO 1 but when I add it in I can't.

I am now testing with a nRF5340-DK with a basic button example.

Any ideas will be gratefully received.

Thank you,

Neil

Parents
  • I have had similar issues with 1.6.1  where my interrupts configured  for Pin P1.1 don't work while  it's fine if I use 1.5.1

    I tried editing v1.6.1\zephyr\boards\arm\nrf5340dk_nrf5340\nrf5340_cpunet_reset.c (I use secure build).. i saw the code uses the pins 0 and 1 (of port 1) so i commented the usage.. I HAVE NO IDEA what's the side effect of this is (yet) but if i do this, i can get interrupts on my configured pin

    Like you mentioned, this issue happens only if you use BLE.. if you have a simple application without BLE (and hence no netcore), life is good.. but who would need nrf5340 if that's the use case :-)

    static void remoteproc_mgr_config(void)
    {
    /* UARTE */
    /* Assign specific GPIOs that will be used to get UARTE from
    * nRF5340 Network MCU.
    */
    #if 0 ///---------------------- commented these lines
    CPUNET_UARTE_PORT_TRX->PIN_CNF[CPUNET_UARTE_PIN_TX] =
    GPIO_PIN_CNF_MCUSEL_NetworkMCU << GPIO_PIN_CNF_MCUSEL_Pos;
    CPUNET_UARTE_PORT_TRX->PIN_CNF[CPUNET_UARTE_PIN_RX] =
    GPIO_PIN_CNF_MCUSEL_NetworkMCU << GPIO_PIN_CNF_MCUSEL_Pos;
    NRF_P0->PIN_CNF[CPUNET_UARTE_PIN_RTS] =
    GPIO_PIN_CNF_MCUSEL_NetworkMCU << GPIO_PIN_CNF_MCUSEL_Pos;
    NRF_P0->PIN_CNF[CPUNET_UARTE_PIN_CTS] =
    GPIO_PIN_CNF_MCUSEL_NetworkMCU << GPIO_PIN_CNF_MCUSEL_Pos;
    #endif
    /* Route Bluetooth Controller Debug Pins */
    DEBUG_SETUP();

    /* Retain nRF5340 Network MCU in Secure domain (bus
    * accesses by Network MCU will have Secure attribute set).
    */
    NRF_SPU->EXTDOMAIN[0].PERM = 1 << 4;
    }
    #endif /* !CONFIG_TRUSTED_EXECUTION_NONSECURE */

Reply
  • I have had similar issues with 1.6.1  where my interrupts configured  for Pin P1.1 don't work while  it's fine if I use 1.5.1

    I tried editing v1.6.1\zephyr\boards\arm\nrf5340dk_nrf5340\nrf5340_cpunet_reset.c (I use secure build).. i saw the code uses the pins 0 and 1 (of port 1) so i commented the usage.. I HAVE NO IDEA what's the side effect of this is (yet) but if i do this, i can get interrupts on my configured pin

    Like you mentioned, this issue happens only if you use BLE.. if you have a simple application without BLE (and hence no netcore), life is good.. but who would need nrf5340 if that's the use case :-)

    static void remoteproc_mgr_config(void)
    {
    /* UARTE */
    /* Assign specific GPIOs that will be used to get UARTE from
    * nRF5340 Network MCU.
    */
    #if 0 ///---------------------- commented these lines
    CPUNET_UARTE_PORT_TRX->PIN_CNF[CPUNET_UARTE_PIN_TX] =
    GPIO_PIN_CNF_MCUSEL_NetworkMCU << GPIO_PIN_CNF_MCUSEL_Pos;
    CPUNET_UARTE_PORT_TRX->PIN_CNF[CPUNET_UARTE_PIN_RX] =
    GPIO_PIN_CNF_MCUSEL_NetworkMCU << GPIO_PIN_CNF_MCUSEL_Pos;
    NRF_P0->PIN_CNF[CPUNET_UARTE_PIN_RTS] =
    GPIO_PIN_CNF_MCUSEL_NetworkMCU << GPIO_PIN_CNF_MCUSEL_Pos;
    NRF_P0->PIN_CNF[CPUNET_UARTE_PIN_CTS] =
    GPIO_PIN_CNF_MCUSEL_NetworkMCU << GPIO_PIN_CNF_MCUSEL_Pos;
    #endif
    /* Route Bluetooth Controller Debug Pins */
    DEBUG_SETUP();

    /* Retain nRF5340 Network MCU in Secure domain (bus
    * accesses by Network MCU will have Secure attribute set).
    */
    NRF_SPU->EXTDOMAIN[0].PERM = 1 << 4;
    }
    #endif /* !CONFIG_TRUSTED_EXECUTION_NONSECURE */

Children
  • Thank you for your input, I was comparing SDK versions and they all set these pins, so I'm not sure what has changed.  Hopefully I'll get a reply from Nordic soon.

    I don't need the net core to access the uart so probably safe to delete.

  • i didn;t make this change earlier for the same reasons (previous sdk has the same code) but given that piece of code is the only one that uses the pins in question, i tried it yesterday and it worked.. I had also removed all arduino pin definitions from the dts files in zephyr\boards\arm\nrf5340dk_nrf5340 but that didn't help..

    I have another ticket where i have requested why does this solve my problem.. hoping to hear back there as well 

Related