Npm1300 + nrf5340 reset configuration

Hello,

i'm developing a board based on nrf5340 and i want to use npm1300 as the pmic. My board is very constrained in terms of space so i'm trying to trade-off the flexibility in terms of testability (extra buttons, test-points, leds, etc.) with this. I read a lot the documentation of both nrf5340 and npm1300 and i would like to confirm that i understood well about the reset options.

Short recap of the valuable infos:

- npm1300 resets using 1 button connected to the SHPHLD pin or using 2 buttons (one on SHPHLD, the other on GPIO0). In both cases, button(s) needs to be pressed for t>tresetbut. The mode (1 or 2 buttons) needs to be set using proper register configuration.

- nrf5340 resets using 1 button on the RESET pin.

- the reference design at Fig.49 of npm1300 Product specifications v.1.1 shows a 2 button configuration with 1 button on SHPHLD and the other button connected to both GPIO0 of npm1300 and RESET of nrf5340.

Being space constrained, i would like to add just 1 button to the board. The idea is to use it for the reset of both npm1300 and nrf5340 so, respect to the reference design, i would connect the button with both SHPHLD and RESET pin of nrf5340.

Is this a legit configuration considering that i need to program nrf5340 over and over for tests using the SWD port of a Segger J-link?

My question arises from the fact that in the boards i developed until now, the MCU (and all the stuff used for programming such as memory, etc.) was always supplied with VDD while reset pin was triggered. In this case, due to the fact that the reset of npm1300 causes a power cycle on the nrf5340, i wonder if this could cause trouble to the programming phase. In your reference design this is not an issue because if the nrf53x reset is triggered the npm1300 is still active because of the 2-buttons configuration.

Any clarification on this matter is appreciated!

Thank you,

Francesco

Parents
  • Hi,

    - npm1300 resets using 1 button connected to the SHPHLD pin or using 2 buttons (one on SHPHLD, the other on GPIO0). In both cases, button(s) needs to be pressed for t>tresetbut. The mode (1 or 2 buttons) needs to be set using proper register configuration.

    Yes. See LPRESETCONFIG. See default values (0x00) here to see the default mode for this. As I read it, single button long press enabled is the default.

    - nrf5340 resets using 1 button on the RESET pin.

    Yep. See nRF5340 Pin Reset.

    - the reference design at Fig.49 of npm1300 Product specifications v.1.1 shows a 2 button configuration with 1 button on SHPHLD and the other button connected to both GPIO0 of npm1300 and RESET of nrf5340.

    That makes sense yes.
    I think this has two possible functions:

    You can enable two-button reset.

    Or you can use the GPIO on the nPM1300 to reset the nRF5340 if if you get nPM1300 errors, for example using PO.RESET, seeOutput under nPM1300 GPIO Pin Configuration.

    Is this a legit configuration considering that i need to program nrf5340 over and over for tests using the SWD port of a Segger J-link?

    You do not need the RESET pin to program the nRF5340. Ref  Programming Custom nRF5340 Board Using nRF5340 Development Kit .

    So I do not believe this will become an issue.

    Regards,
    Sigurd Hellesvik

  • Hi Sigurd,

    thank you for the very detailed feedback, but i feel like there are two ways to read your answer:

    1) The configuration i propose (1 button for both nPM1300 reset and nrf5340 reset) is legit;

    2) The configuration i propose is NOT legit, but not needing the reset on the nrf5340 to program it i can just drop this connection (1 button for the nPM1300 reset and Vdd on the nrf5340 reset) and continue using only one button in total

    Which one? :D

    Frax

  • Heh, good that you ask.

    The configuration you propose is legit when it comes to a programming perspective.
    Because you will not trigger the nPM1300 reset during programming if you never connect anything to the reset pin at during programming. Aka it will not matte rif the pins are connected or not.

    I cannot see anything that would be bad with connecting these pins right now.
    However, I will ask a colleguea to be sure I have not missed anything.

  • My doubt for programming is the following: let's assume i connected the button to both nPM1300 and nrf5340 and the reset line is driven by the programming interface. When i run the "program!" button the programmer pull down the reset line to be sure that the device is in a known state. Because of the electrical connections the nrf5340 is reset but also subject to a power-cycle due to the nPM1300 been reset as well. After the reset it could happen that the device is still "off" and the programming fails? Or does it wait for the mcu to boot and everything goes fine?

    It's probably me overthinking too much, but concurrencies and race conditions make me tripping Smiley

    Thank you for the patience

    Frax

Reply
  • My doubt for programming is the following: let's assume i connected the button to both nPM1300 and nrf5340 and the reset line is driven by the programming interface. When i run the "program!" button the programmer pull down the reset line to be sure that the device is in a known state. Because of the electrical connections the nrf5340 is reset but also subject to a power-cycle due to the nPM1300 been reset as well. After the reset it could happen that the device is still "off" and the programming fails? Or does it wait for the mcu to boot and everything goes fine?

    It's probably me overthinking too much, but concurrencies and race conditions make me tripping Smiley

    Thank you for the patience

    Frax

Children
  • frax84 said:
    When i run the "program!" button the programmer pull down the reset line to be sure that the device is in a known state.

    If you do not connect the reset line to the programmer (only SWDIO, SWCLK, GND and VDD), the programmer will use Soft Reset instead of pin reset to enter a known state.

    frax84 said:
    due to the nPM1300 been reset as well.

    No reset pin to programmer => During programming the nPM1300 reset line is not changing* => nPM1300 will not be reset.

    *Unless you press the reset button by mistake during programming ofc.

    frax84 said:

    It's probably me overthinking too much, but concurrencies and race conditions make me tripping Smiley

    Thank you for the patience

    It is good that you ask, no worries! Keep the questions coming until you are content with your understanding.

    So, I am sure that this won't be an issue with programming. I am still checking to see if it is a problem for anything else.

  • Oh, and by the way:
    Do you have an nRF5340DK and an nPM1300 EK?

  • Ok! Things are getting clearer!

    Considering all that you said and my constraints i would like to proceed like this:

    1) Reset button connected to the SHPHLD pin of nPM1300;

    2a) GPIO (GPIO0..3) pins connected to the RESET pin of the nrf5340 (no pull-up needed). In this case i can HARD RESET the nrf5340 for specific events happening on the nPM1300;

    2b) Alternatively, i can connect GPIO0..3 to a GPIO pin of the nrf5340 and manage any event interrupt from nPM1300 in the MCU software (i.e. i can trigger a SOFT RESET for an error event on nPM1300);

    3) SWD port (SWDIO & SWDCLK) connected to nrf5340 without reset line;

    In this way:

    1) When i program the nrf5340 using SWD port the programmer will send a SOFT RESET to put the board in a known state and proceed with the programming of the chip;

    2) When i want to reset my custom board MCU i can proceed in two ways:

    a) (long) push the button (>10s default). In this way the nPM1300 will reset and will cause a power cycle that will pull down VOUT1 (See Fig.49 in the previous post) for tPWRDN (= 100ms) on the nrf5340 that will reset as well;

    b) configure the INTENEVENTSSHPHLDSET register of the nPM1300 to trigger a GPIO interrupt on the EVENTSHPHLDBTNPRESS (or RELEASE) event. This interrupt can HARD RESET the nrf5340 in "2a" configuration or SOFT RESET the nrf5340 in "2b" configuration.

    This should make it. I have been a bit verbose to support the community.

    Please correct me if i wrote some bullshits Smiley

    Oh, and by the way:
    Do you have an nRF5340DK and an nPM1300 EK?

    I have the nRF5340DK and ordered the nPM1300EK. I'll start experimenting in few days. I'm studying the stuff at the moment Nerd

  • frax84 said:
    1) Reset button connected to the SHPHLD pin of nPM1300;

    Sounds good.

    frax84 said:
    2a) GPIO (GPIO0..3) pins connected to the RESET pin of the nrf5340 (no pull-up needed). In this case i can HARD RESET the nrf5340 for specific events happening on the nPM1300;

    Maybe not all, but one of the GPIOs.

    frax84 said:
    2b) Alternatively, i can connect GPIO0..3 to a GPIO pin of the nrf5340 and manage any event interrupt from nPM1300 in the MCU software (i.e. i can trigger a SOFT RESET for an error event on nPM1300);

    Yep. 2a and 2b can be done at the same time, cause you can just use GPIO0 for 2a and the rest for 2b.

    frax84 said:
    1) When i program the nrf5340 using SWD port the programmer will send a SOFT RESET to put the board in a known state and proceed with the programming of the chip;

    Yep.

    frax84 said:
    a) (long) push the button (>10s default). In this way the nPM1300 will reset and will cause a power cycle that will pull down VOUT1 (See Fig.49 in the previous post) for tPWRDN (= 100ms) on the nrf5340 that will reset as well;

    Correct. That is the exact use-case for this feature.

    frax84 said:
    b) configure the INTENEVENTSSHPHLDSET register of the nPM1300 to trigger a GPIO interrupt on the EVENTSHPHLDBTNPRESS (or RELEASE) event. This interrupt can HARD RESET the nrf5340 in "2a" configuration or SOFT RESET the nrf5340 in "2b" configuration.

    Sounds good to me, but I must admit I am not 100% sure here (cause it is a tad more complex). I recommend testing it.

    frax84 said:
    I have been a bit verbose to support the community.

    We appreciate it!

    frax84 said:
    I have the nRF5340DK and ordered the nPM1300EK. I'll start experimenting in few days. I'm studying the stuff at the moment Nerd

    Brilliant! I recommend that you test the setup with the DK+EK to be sure that it works. We are all human, so even though we in support here are skilled, we can be wrong sometimes as well. So if you tested it, you will know that it works for sure.

  • Nice!
    Of course i will test everything i can. There is a lot of room to play with these kits.

    Thank you again for the very fruitful discussion!

    Frax

Related