nf9160dk reset 52840

In my app on the nrf9160DK, I have the need for the 9160 to reset the 52840. I currently have it working with the following settings:

for 9160 prj.conf:
CONFIG_BOARD_NRF52840_GPIO_RESET=y
CONFIG_BOARD_NRF52840_GPIO_RESET_PIN=23

for 52840 prj.conf:
CONFIG_BOARD_NRF9160DK_NRF52840_RESET=y
CONFIG_BOARD_NRF9160DK_NRF52840_RESET_P1_02=y
The 9160 uses the GPIO code copied from zephyr/boards/arm/nrf9160_pca10090/nrf52840_reset.c This works *most* of the time, however occasionally the 52840 won't restart and I have not tracked down exactly why yet. The current solution is cooperative in that the 52840 initiates the reset via code and I suspect the 52840 is in a bad state and the reset code is not being executed. It seems like it should be straight forward to connect 9160 GPIO output directly to the nReset pin on the 52840, but I can't find the options.
Does it make sense to connect to nReset and if so, can somebody give me an example of the config options? I am using NCS 1.4.1 which I know is old, but don't have the option to bring it up to date at the moment.
Thanks,
Mike
Parents
  • Hi Mike,

    Could you check what is the status of the pin P0.24 of nRF52840? Default state is low if not set by nRF52840. In this state, it disconnects nRF9160 P0.23 from nRF52840 P1.02. P0.24 needs to be high to enable the connection between P0.23 on nRF9160 and P1.02 nRF52840.

    If you want, you could use pin P0.24 on nRF9160 which is connected to pin P0.18 which is the default reset pin on nRF52840. The switch which enables the connection is controlled by P0.16 on nRF52840.

    Regarding configuration options, you could try to remove second line in nrf52840 prj.conf and specify pin P0.24 in the second line of nRF9160 prj.conf.

    Best regards,
    Dejan

  • I think I want to use P0.18 to do the reset. That seems the most solid way to reset the chip and independent of the state of the running app, right?

    I have been looking at the 9160DK user guide and found the table in section 5.7.1 that describes the routing. After reading it a few times I think I finally understand what's going on. I believe I need to add code to 52840 to set P0.16 output+high so that P0.24 goes to P0.18, and on 9160 the reset code needs to configure P0.24 as output and raise/lower/toggle/something when I want to reset 52840.

    I am working on this at home with few tools beyond a volt meter. Is that sufficient to check the status of P0.24 and what would I look for?

  • Hi Mike,

    miked531 said:
    I believe I need to add code to 52840 to set P0.16 output+high so that P0.24 goes to P0.18, and on 9160 the reset code needs to configure P0.24 as output and raise/lower/toggle/something when I want to reset 52840.

    This is correct.

    miked531 said:
    I am working on this at home with few tools beyond a volt meter. Is that sufficient to check the status of P0.24 and what would I look for?

    For determining the status of the pin, the easiest would be to read the status of the GPIO register. You can read more about GPIO in chapter 6.4 of the product specification.

    Best regards,
    Dejan

Reply
  • Hi Mike,

    miked531 said:
    I believe I need to add code to 52840 to set P0.16 output+high so that P0.24 goes to P0.18, and on 9160 the reset code needs to configure P0.24 as output and raise/lower/toggle/something when I want to reset 52840.

    This is correct.

    miked531 said:
    I am working on this at home with few tools beyond a volt meter. Is that sufficient to check the status of P0.24 and what would I look for?

    For determining the status of the pin, the easiest would be to read the status of the GPIO register. You can read more about GPIO in chapter 6.4 of the product specification.

    Best regards,
    Dejan

Children
Related