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

PCA100040 uart example gets stuck

Hello,

A stupid newbie question: APP_UART_FIFO_INIT seems to get stuck while trying to run example code.

Only modification I have made is the usage of SEGGER_RTT for debug. Does that mess up the uart somehow?

Best regards, Sampo

  • Hi Sampo! Could you provide some more information? What SDK are you using? Which Softdevice? Are you not able to build the example? Or does it not work when you flash it to the nRF52 DK? Are you using the ble_app_uart example? All the relevant information you can provide will help others to solve your problem.

  • Hello Joakim,

    Sorry to have this so broadly defined. I'm using nRF5_SDK_14.0.0, and I'm using the examples/peripheral/uart The ble_app_uart example works like charm, but not the uart example for connecting serial devices to the PCA100040 board. I can compile the example, flash it, run it, and it seems to run until it calls the macro APP_UART_FIFO_INIT. I did remove the RTT debug code and just used LEDs for testing. So with the code:

    bsp_board_led_on(2);
    APP_UART_FIFO_INIT(&comm_params,
                         UART_RX_BUF_SIZE,
                         UART_TX_BUF_SIZE,
                         uart_error_handle,
                         APP_IRQ_PRIORITY_LOWEST,
                         err_code);
    

    bsp_board_led_on(1);

    The second led newer gets lit up...

  • I can't seem to replicate your problems. When testing with your code, both LEDS light up. Are you sure you didn't make any other changes to the code? Maybe you could upload your main.c and sdk_config.h files?

  • Hello Joakim, Sorry for the slow reply, it's finally harvesting season here in Finland, I actually managed to solve this.

    It turned out that simply linking in the nrf_log libraries together with segger RTT messed up the uart somehow, even tough I did not make any calls to those libs. I was trying to enable RTT logging for my uart app to connect an ultrasonic distance sensor. It turned out that without logging libs linked in, the UART works like charm.

    This was a good discovery, because my next step would be mixing up the ble_app_uart example and the uart example to allow me to transfer the readings from the sensor to a mobile phone and the ble_app_uart actually uses nrf_log libraries.

    On some EKG logging systems we have had to write a custom UART implementation using GPIO and I hope I will get away with less stuff as this is kind of hobby project for me.

    But now I need to fight with the sensor it self. But this is the nature of embedded development, bang your head against a wall until you get trough only to find the next wall.

  • I'm glad you figured it out.
    Good luck with your future development, and you are always welcome to post another question if you have any more problems!

Related