BSP and nRF52 custom board - P0.9/P0.10 GPIO LED issue

Hi Everyone,

So I have a custom board with an LED on P0.9. I have confirmed it works by applying power to it, so no issue with the LED itself or the way it is connected.

I created a custom_board.h from the pca10040.h mapping LED_1 to P0.9. I commented out everything to do with the other LEDs.

I also have a button on my custom board and mapped this out to P0.16 and through the BSP this works fine.

My application is a modification to the SDK11 ble_app_uart example so the LED should be blinking when it is advertising, as it does on the DK. I can confirm the PCB is advertising, but the LED is not blinking. It is calling bsp_led_indication() fine and I see it trying to blink the LED but nadda.

What silly thing have I overlooked?

  • Ok, solved this and thankfully don't feel so silly.

    It appears pins 0.9 and 0.10 for the nRF52 are set for use with the NFC antenna out of the box. So in the preprocessor you need to set CONFIG_NFCT_PINS_AS_GPIOS to turn them into GPIOs.

  • I edited the heading because as more and more nRF52 custom boards are built this could keep coming up.

  • Using command line development relying on the makefile, this preprocessor needed to be added in the makefile. Using a custom board within the blinky project I added line 144 CFLAGS += -DCONFIG_NFCT_PINS_AS_GPIOS within the makefile. It would not work placed inside the pca10056.h file.

  • We all got caught by these at some time or other .. and the rest:

    // Important Heardware Pin Options - used in system_nrf52.c, typically added to project options
    // ===============================
    // ENABLE_SWO activates SWO pin, otherwise SWO pin is available as GPIO
    // ENABLE_TRACE activates TRACE pins, otherwise TRACE pins are available as GPIOs
    // CONFIG_NFCT_PINS_AS_GPIOS bypasses NFC input circuitry and enables 2 GPIO pins, otherwise 2 pins are NFC only
    // CONFIG_GPIO_AS_PINRESET activates pin reset, otherwise pin nRESET is available as GPIO
    

Related