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

Initializing UART for BLE-NUS

Hi,

Using ble-app-uart sdk9 example:

  1. Is there a difference where I initialize uart in main? My code is able to run when I shifted the uart_init() after ble_stack_init on my custom board, but gets stucks at softdevice initializing ble stack if uart_init() comes before ble_stack_init.

  2. Why is it on my custom board, using uart-ble, only baud rates of 2400 or 1200 would allow ble_nus_init to run without getting stuck? (ie. higher baud rates would meant that the code gets stuck inside ble_nus_init)

  3. If my GPIO pins are unconnected/floating, is it ok to define them as RTS and CTS pins? or RTS/CTS have to be physically wired to something?

Parents
  • This seems very odd.

    1. I tried the "ble_peripheral\ble_app_uart" example and tried to call uart_init() both before and after ble_stack_init(). I was not able to reproduce your issue.

    2. The baudrates shouldn't have anything to do with ble_nus_init() at all.

    3. UART pins should not be left floating.

    Does your board have an external low frequency XTAL?

    Can you please follow RK's advice and debug and step through your code to pinpoint the errors? Here is a guide on debugging. The errors you describe just doesn't make sense at all so we will need some hard facts to be able to help you.

Reply
  • This seems very odd.

    1. I tried the "ble_peripheral\ble_app_uart" example and tried to call uart_init() both before and after ble_stack_init(). I was not able to reproduce your issue.

    2. The baudrates shouldn't have anything to do with ble_nus_init() at all.

    3. UART pins should not be left floating.

    Does your board have an external low frequency XTAL?

    Can you please follow RK's advice and debug and step through your code to pinpoint the errors? Here is a guide on debugging. The errors you describe just doesn't make sense at all so we will need some hard facts to be able to help you.

Children
No Data
Related