nreset 0.18 disable

I have a customized PCB with nrf52840. Pin 0.18 is used as CS pin in SPI communication. 

I want to disable the nreset function and I add this CONFIG_GPIO_AS_PINRESET=n in .conf file 

When I click flash it still shows 

[ ###### ] 0.000s | Program file - Checking image [ ##### ] 0.000s | Check image validity - Initialize device info [ ########## ] 0.000s | Check image validity - Check region 0 settings [ ############### ] 0.000s | Check image validity - block 1 of 2 [ #################### ] 0.006s | Check image validity - Finished [ ############# ] 0.000s | Program file - Programming [ ########## ] 0.000s | Programming image - block 1 of 1 [ #################### ] 0.000s | Programming image - Write successful [ #################### ] 0.248s | Program file - Done programming
[ ###### ] 0.000s | Verify file - Check image [ ##### ] 0.000s | Check image validity - Initialize device info [ ########## ] 0.000s | Check image validity - Check region 0 settings [ ############### ] 0.115s | Check image validity - block 1 of 2 [ #################### ] 0.006s | Check image validity - Finished [ ############# ] 0.000s | Verify file - Verifying [ ########## ] 0.000s | Verifying image - block 1 of 1 [ #################### ] 0.000s | Verifying image - Verify successful [ #################### ] 0.255s | Verify file - Done verifying
Enabling pin reset.
Applying pin reset.

I read across the platform and I found someone mentioned NCIR and some mentioned system_nrf52840.c but those answers are more than 1 years ago so I am not sure whether those are relevant.

I am using J-LINK for flash and printk though RTT.

What else I need to add after adding CONFIG_GPIO_AS_PINRESET=n ? 

Parents
  • Hi,

    There are two things that needs to be adressed in order to not use pin reset.

    The first is to don't enable pin reset in  your firmware. You describe CONFIG_GPIO_AS_PINRESET=n but that is deprecated, so if using a recent SDK release (>= v2.5.0) you need to adjust your devicetree as explained in this post.

    The second is that when programming west flash needs to be called with the "--softreset" option. If calling it direclty, just add that option. If programming from nRF Connect for VS Code, set "nrf-connect.flash.softreset": true in your VS Code configuration.

  • sorry for asking this dumb question

    1. add this in the overlay file
    &uicr {
    /delete-property/ gpio-as-nreset;
    };

    2. where to add this ?  CMakeLists.txt ? or launch.json? or some other files in VSCode? 

    or can i add nrf-connect.flash.softreset=y to extra cmake arguments in build configuration on vscode? 

    "nrf-connect.applicationOptions": {
    "/home/eith/ncs/v2.5.0/zephyr/samples/basic/blinky": {
    "flash": {
    "softreset": true,
    "skipBuild": false
    }
    }
    }

    launch.jason

    {
        // Use IntelliSense to learn about possible attributes.
        // Hover to view descriptions of existing attributes.
        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
        "configurations": [
            {
                "type": "nrf-connect",
                "request": "launch",
                "name": "Launch the active build configuration",
                "config": "${activeConfig}",
                "runToEntryPoint": "main"
            }
        ]
    }

  • yes i understand the first step, I want to ask where to put the 2nd step 

    you mentioned put the below piece of code in VS Code configuration , may I ask which file ?

    "nrf-connect.applicationOptions": {
        "/home/eith/ncs/v2.5.0/zephyr/samples/basic/blinky": {
        "flash": {
        "softreset": true,
        "skipBuild": false
    }
    }
    }

  • For the second step the simplest is to use the GUI in VS Code. Go to File -> Preferences -> Settings, search for "nrf-connect.flash.softreset" and tick the box. As shown here:

    ...

  • Hi Einar, if i disabled the reset correctly, when I press the ifboot/reset button on nrf52840dk , there should be no action right? 

    or is there any other method to check if i change 0.18 from reset to a normal GPIO correctly? 

    After i done so, it should be able to use as CS pin for spi communication right?

  • The reset button on the DK is connected to the onboard debugger, and will reset the nRF via the debugger. This is independen of the reset pin on the nRF.

    xuezhi_zed said:
    or is there any other method to check if i change 0.18 from reset to a normal GPIO correctly? 

    The simplest which I use is to connect a jumper wire from P0.18 to GND and release it again (pin reset is active low with an internal pull-up). If that resets the device, pin reset is enabled. If not, it is not enabled.

    xuezhi_zed said:
    After i done so, it should be able to use as CS pin for spi communication right?

    Yes

Reply
  • The reset button on the DK is connected to the onboard debugger, and will reset the nRF via the debugger. This is independen of the reset pin on the nRF.

    xuezhi_zed said:
    or is there any other method to check if i change 0.18 from reset to a normal GPIO correctly? 

    The simplest which I use is to connect a jumper wire from P0.18 to GND and release it again (pin reset is active low with an internal pull-up). If that resets the device, pin reset is enabled. If not, it is not enabled.

    xuezhi_zed said:
    After i done so, it should be able to use as CS pin for spi communication right?

    Yes

Children
No Data
Related