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

Pin 9 and Pin 10 as GPIO with ble_app_buttonless_dfu

Hi All,

I know this question seems to have been asked many times already but still does not seem to work for us even after checking forum answers.

Hardware: Fanstel BT832 (nRF52832)

Desired function: Pin 9: PWM, PIN 10: GPIO

We initially started development with ble_app_uart as a template. We followed the instruction to add: CONFIG_NFCT_PINS_AS_GPIOS to our SES project options as in this discussion. it works correctly.

We then migrated development over to ble_app_buttonless_dfu as a starting template and we cannot get them to work. We even added the following lines as in other discussions.

const uint32_t UICR_ADDR_0x20C    __attribute__((at(0x1000120C))) __attribute__((used)) = 0xFFFFFFFE;
#define CONFIG_NFCT_PINS_AS_GPIOS

When we go back flash our code with ble_app_uart base, everything is working fine.

Are there other preprocessor definition that must be added in this situation? Or are the any that must be removed?

  • Hi,

    Can you check that the UICR register is written correctly?

    nrfjprog --memrd 0x1000120C
    0x1000120C: FFFFFFFE                              |....|

    I tested by setting CONFIG_NFCT_PINS_AS_GPIOS in the ble_app_buttonless_dfu project in SDK 16.0.0, and the UICR register is written correctly.

    Best regards,
    Jørgen

  • Hi Jørgen,

    Thank you very much for checking on our issue. I somehow got it to work but I am not sure what the issue was or the solution. I have 3 prototype boards that I have been testing and here is what happened.

    1. Opened our modified ble-app-buttonless project (We are on SDK16.0.0) . double check my preprocessor defines commented out extra code below and then flashed on all 3 boards.

    const uint32_t UICR_ADDR_0x20C    __attribute__((at(0x1000120C))) __attribute__((used)) = 0xFFFFFFFE;
    #define CONFIG_NFCT_PINS_AS_GPIOS

    2. Followed your instructions for nrfjprog --memrd 0x1000120C. Error. nrfjprog too old and needed update. Did not get the version prior to update but we orginally were on SDK14.2 for our ble_app_uart base.

    3. Download and install nRF-Command-Line-Tools_10_7_0_Installer. No restart.

    4. Followed your instructions for nrfjprog --memrd 0x1000120C. Fail. Output 0x1000120C: FFFFFFFF (All three were the same)

    5. Clean project, rebuild, flash and check nrfjprog --memrd 0x1000120C again. Fail. Output 0x1000120C: FFFFFFFF

    6. Saved work and restarted computer.

    7. Opened up original ble-app-buttonless-dfu and changed preprocessor definitions to include CONFIG_NFCT_PINS_AS_GPIOS. Flash on 1 board.

    8. Checked nrfjprog --memrd 0x1000120C. Success. Output 0x1000120C: FFFFFFFE

    9. Opened my modified ble-app-buttonless-dfu project. Clean, rebuild and flash.

    10. Checked nrfjprog --memrd 0x1000120C. It worked. Success. Output 0x1000120C: FFFFFFFE

    Tested on all boards and it seems to work consistently now. I suspect that it maybe due to old version of nRF-Command-Line-Tools and restart.

Related