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

52833 can not set P0.09 as general GPIO

I have define CONFIG_NFCT_PINS_AS_GPIOS, but the pin is always low, even if the OUT register is high.

>nrfjprog --memrd 0x1000120C
0x1000120C: FFFFFFFF                              |....|

I have read 0x1000120C(NFCPINS), it is FFFFFFFF, what's wrong with it?

Parents
  • Hi,

    You should get the UICR configured correctly if you build your firmware with CONFIG_NFCT_PINS_AS_GPIOS. Did you remember to do a reset after programming the firmware? That is required as the UICR is only read during reset.

  • 1. Firmware can reset by itself, isn't it?

    2.If P0.10 have a external pull up, does it have influence?

    3.Does DK board can validate this?

    When I use DK board(PCA10056), read 0x1000120C(NFCPINS), it is FFFFFFFF;

    I use my custom board, read 0x1000120C(NFCPINS), it is FFFFFFFE, Through the reg is right, but the pin is always in low level.

  • Hi,

    great-master said:
    1. Firmware can reset by itself, isn't it?

    Regarding the DK you are right that the firmware should reset the device after writing to NFCPINS. Perhaps the code snippet is never run? Did you define CONFIG_NFCT_PINS_AS_GPIOS for the project (so that it applies to all files), or did you by a mistake define it in just a single file?

    great-master said:
    2.If P0.10 have a external pull up, does it have influence?

    The pull-up should not be relevant. If the pin is configured as a GPIO input, it would pull the pin high. But the pull is so low that it would not matter much for the state when the pin is output.

    great-master said:
    3.Does DK board can validate this?

    What do you mean? The way you an check from firmware if NFCPINS are enabled is to read the NFCPINS register. And this can be done on the DK or any other board.

    Overall, regarding the DK, it is expected that the pins does not work if you read FFFFFFFF from 0x1000120C (NFCPINS). However, on the custom board where you read FFFFFFFE this should work. So there seems to be two issues here, which may or may not have a common cause. Can you share the code you use to configure the pin as output and set it high?

Reply
  • Hi,

    great-master said:
    1. Firmware can reset by itself, isn't it?

    Regarding the DK you are right that the firmware should reset the device after writing to NFCPINS. Perhaps the code snippet is never run? Did you define CONFIG_NFCT_PINS_AS_GPIOS for the project (so that it applies to all files), or did you by a mistake define it in just a single file?

    great-master said:
    2.If P0.10 have a external pull up, does it have influence?

    The pull-up should not be relevant. If the pin is configured as a GPIO input, it would pull the pin high. But the pull is so low that it would not matter much for the state when the pin is output.

    great-master said:
    3.Does DK board can validate this?

    What do you mean? The way you an check from firmware if NFCPINS are enabled is to read the NFCPINS register. And this can be done on the DK or any other board.

    Overall, regarding the DK, it is expected that the pins does not work if you read FFFFFFFF from 0x1000120C (NFCPINS). However, on the custom board where you read FFFFFFFE this should work. So there seems to be two issues here, which may or may not have a common cause. Can you share the code you use to configure the pin as output and set it high?

Children
Related