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"
            }
        ]
    }

  • Hi,

    The simplest is probably to make a file called app.overlay in your project folder (the same folder where you have prj.conf and CMakeLists.txt, and in that file add just this:

    &uicr {
            /delete-property/ gpio-as-nreset;
        };

    PS: If you have your own board files for your custom board you can also just remove gpio-as-nreset from the .dts file for your custom board.

  • 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:

    ...

Reply Children
Related