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

How to declare the UART module?

Hi all.

I need some suggestion how to use UART module in the nRF52 using nRF5_SDK_12.2.0 and the softdevice $132(it would affect?)

I would like use RX to receive information from a PC no matter the baudrate or buffer size just be able to receive information. I waste the whole day trying to do this but I always got fatal error after the declaration APP_UART_FIFO_INIT

const app_uart_comm_params_t comm_params =
      {
          RX_PIN_NUMBER,
          TX_PIN_NUMBER,
          RTS_PIN_NUMBER,
          CTS_PIN_NUMBER,
          APP_UART_FLOW_CONTROL_ENABLED,
          false,
          UART_BAUDRATE_BAUDRATE_Baud115200
      };

    APP_UART_FIFO_INIT(&comm_params,
                         UART_RX_BUF_SIZE,
                         UART_TX_BUF_SIZE,
                         uart_event_handle,
                         APP_IRQ_PRIORITY_HIGHEST,
                         err_code);

      APP_ERROR_CHECK(err_code);

Thanks,

Parents
  • @Kristin

    Sorry I dont know the specific error code. I just got "App:ERROR", "Fatal error" using Termite and the MCU keeps restarting in the APP_ERROR_CHECK() after APP_UART_FIFO_INIT()

    I place the same initialization for UART in the SDK 11 and it works. but not in the SDK 12.2 (maybe my mistake?) I had my whole program in the SDK 12.2 but not the UART part...

    Any suggestion how to add to the experimental_app_ble_blinky UART RX/TX capable?

    Thanks

Reply
  • @Kristin

    Sorry I dont know the specific error code. I just got "App:ERROR", "Fatal error" using Termite and the MCU keeps restarting in the APP_ERROR_CHECK() after APP_UART_FIFO_INIT()

    I place the same initialization for UART in the SDK 11 and it works. but not in the SDK 12.2 (maybe my mistake?) I had my whole program in the SDK 12.2 but not the UART part...

    Any suggestion how to add to the experimental_app_ble_blinky UART RX/TX capable?

    Thanks

Children
No Data
Related