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

NRF52832 UART Reset

Hi,

I'm trying to get a custom PCB working. I can use either the plain peripheral UART, or the ble-app-uart example projects on the NRF52-DK and they work, but they don't on my custom board. I'm using different pins for RX and TX and I've changed them accordingly. Regardless of whether I use the plain UART or the BLE UART, the project keeps resetting the nrf52832. I always end up in the NRF_DRV_UART_EVT_ERROR case of the uart_event_handler(). What could be causing this? It should be straightforward but I just can't get it to work. The main.c file of the plain uart project is attached.

main.c

  • Hi Adam,

    You are using pins 9 and 10 for UART, and these pins are configured as NFC antenna pins by default.

    Here's the information from page 110 of the product specifications: infocenter.nordicsemi.com/.../nRF52832_PS_v1.0.pdf

    20.2.2 NFC antenna pins
    Two physical pins can be configured either as NFC antenna pins (factory default), or as GPIOs P0.09 and
    P0.10.
    When configured as NFC antenna pins, the GPIOs on those pins will automatically be set to DISABLE state
    and a protection circuit will be enabled preventing the chip from being damaged in the presence of a strong
    NFC field. The protection circuit will short the two pins together if voltage difference exceeds approximately 2
    V.
    For information on how to configure these pins as normal GPIOs, see NFCT and UICR chapters. Note that
    the device will not be protected against strong NFC field damage if the pins are configured as GPIO and an
    NFC antenna is connected to the device. The pins will always be configured as NFC pins during power-on
    reset until the configuration is set according to the UICR register.
    These two pins will have some limitations when configured as GPIO. The pin capacitance will be higher on
    these pins, and there is some current leakage between the two pins if they are driven to different logical
    values. To avoid leakage between the pins when configured as GPIO, these GPIOs should always be at the
    same logical value whenever entering one of the device power saving modes. See Electrical specification.
    

    Take a look at the "uicr_config" example in the SDK on how to configure the UICR to set these pins as GPIO.

    Add this line to "uicr_config.h"

    const uint32_t UICR_NFCPINS __attribute__((at(0x1000120C))) __attribute__((used)) = 0xFFFFFFFE;
    
  • Hi James. That solved the problem. Great work.

Related