This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF52832 disable reset pin segger embedded studio

Hi,

We have custom hardware that includes an NRF52832 microcontroller. Currently pin 0.21 is mapped as reset pin and i cannot seem to figure out how to change this using segger embedded studio. What we are trying to do is using the pin for other purposes then resetting the microcontroller.

I have found that i need to disable the define CONFIG_GPIO_AS_PINRESET, but i cannot seem to find it anywhere in my project. When i change the define in system_nrf52.c to CONFIG_GPIO_AS_PINRESET_x it still seems to use pin21 as Reset. Help would be very much appreciated to sort out this problem.

we are using SDK version 15.0.0

kind regards,

Tim

  • Hi Tim.

    You will have to remove the preprocessor definition CONFIG_GPIO_AS_PINRESET.

    This can be done by opening your project settings->select the common configuration->Preprocessor->Preprocessor Definitions

    See picture below:

    Best regards,
    Joakim

  • Hi Joakim,

    thanks for your response, that was indeed what i was looking for. The only problem is when i remove CONFIG_GPIO_AS_PINRESET pulling the pin low will still draw current and seems to reset the module. Is there anything else that could cause this? I have added a screenshot of my project settings.

  • After removing the CONFIG_GPIO_AS_PINRESET it is important to load up nRFgoStudio and erase the chip before programming it again. This is what solved the problem for me.

  • Step 1: Update the Preprocessor Definitions

    1. Open your project in Segger Embedded Studio: Start Segger Embedded Studio and load your project.

    2. Access the Project Options:

      • Click on your project in the Project Explorer window to select it.
      • Go to the menu bar and select Project > Edit Options. Alternatively, right-click on your project in the Project Explorer and choose Options.
    3. Navigate to Preprocessor Definitions:

      • In the Options dialog, expand the Preprocessor section under Common Configuration.
      • Click on Preprocessor Definitions.
    4. Add the Preprocessor Definition:

      • Add NRF_RESET_PIN=18 to the list of definitions.
      • Click OK to apply the changes.

      Step 2: Update the SDK Configuration File

      1. Open the sdk_config.h file: Locate the sdk_config.h file in your project. This file typically resides in the config folder or a similar configuration directory.

      2. Modify the sdk_config.h file: Add or modify the following definitions to configure P0.18 as the reset pin:

      #define NRF_RESET_PIN 18
      1. Save the sdk_config.h file:

        Save the changes to the sdk_config.h file.

      Step 3: Ensure Proper Pin Configuration

      1. Check the Pin Configuration: If there are any additional pin configuration settings required (such as enabling the reset functionality), ensure they are also defined in the sdk_config.h or appropriate initialization code.

        For example, you might need to include:

      #define CONFIG_GPIO_AS_PINRESET 1
      1. This setting tells the Nordic SDK to configure the specified GPIO pin as a reset pin.

      2. Initialize the Reset Pin in Code (if necessary): In your main application code, ensure that the GPIO pin is properly initialized if required. The Nordic SDK usually handles this, but verify to ensure there are no additional steps needed.

      Example Changes in sdk_config.h

      Here's a sample snippet of how your sdk_config.h file might look after making these changes:

      #ifndef SDK_CONFIG_H
      #define SDK_CONFIG_H

      // Enable pin reset
      #define CONFIG_GPIO_AS_PINRESET 1

      // Define the reset pin number
      #define NRF_RESET_PIN 18

      // Other configurations...

      #endif // SDK_CONFIG_H

    Related