nRF52833 (P0.18) nRST cannot be used as GPIO

I am using nRF52833DK, zephyr v2.7.0.

I want to disable hardware nRST to use P0.18 as GPIO.

What I did

Added to Kconfig : CONFIG_GPIO_AS_PINRESET=n

Removed : gpio-as-nreset

But it is still enabled.

When I check UICR,

nrfjprog --family NRF52 --memrd 0x10001200

0x10001200: 00000012

It seems to be attached.

Please tell me how to use nRST (P0.18) as GPIO.

Parents
  • Hi

    The simplest thing to do would probably be to add the following in the .overlay file of your project, as it is set as a reset pin by default in most board files by default and likely is for you as well. I realize I didn't show how to remove a set device tree setting:

    &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.

    Best regards,

    Simon

  • /delete-property/ gpio-as-nreset

    I added it, but it had the same effect.
    I also edited the dts file of nrf52833dk (I know it's an inappropriate method) and deleted the property.
    How can I analyze this problem?

  • Should have taken this into effect with NCSv2.7.0.
    Can you check in your build folder project_folder\build\sample_name\zephyr.dts and see the &uicr node has the gpio-as-nreset removed.

    Since this is pin 18 you are using, make sure that you have right configuration of pin 18 in your pinctrl.

    How are you testing that the nreset is still enabled using this gpio? 

  • I don't know the exact cause, but I was able to use P0.18 as a GPIO.
    Apparently, in my environment, when building with the GUI, code changes are sometimes not reflected.
    It works fine by building with the CLI.

    However, my real goal is to assign it to the SPI MOSI pin, which is still not working.
    SPI is not working on other ports either, so I will look into it a bit more.
    Also, is it possible to use P0.18 as the SPI MOSI pin?

Reply
  • I don't know the exact cause, but I was able to use P0.18 as a GPIO.
    Apparently, in my environment, when building with the GUI, code changes are sometimes not reflected.
    It works fine by building with the CLI.

    However, my real goal is to assign it to the SPI MOSI pin, which is still not working.
    SPI is not working on other ports either, so I will look into it a bit more.
    Also, is it possible to use P0.18 as the SPI MOSI pin?

Children
No Data
Related