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

UART Application Problem

Hello all,

I'm stuck in the use of the UART.

I have used the code from the UART example and the UART application for iPhone. I'm using eclipse because I don't want to pay licences to KEIL if I can do it for free. So I have configure the makefile and the UART code is compiling and is executing in the nRF6310. I use for uploading the program nRF Studio with SoftDevice S110.

I have added some messages for traceability through the UART port at the init and it works. LED 0 gets ON. Then I connect the Ipod and LED 0 -> OFF and LED 1 -> ON. Then I send a message from the Iphone and the nRF get stuck and the app disconnects.

When using the debugging with Eclipse, most of the times it blocks at the call BLE_STACK_HANDLER_INIT from ble_stack_init.

What I'm doing wrong? Could anyone that has encountered similar problems give me some hints?

Thanks in advance. M.

  • Have you had a look at this question?

    It seems that what actually happens is that Eclipse makes GDB jump directly to the application's reset handler, instead of starting at the reset handler.

    Another way to solve it seems to be to set the program counter manually on reset, as shown in the attached screenshot. The exact address you should set it to will be dependent on the softdevice version used, but you can read it out at address 0x04 in the flash of the chip. With softdevice 5.2.0 it should be 0x114BD, 5.2.1 0x114CD and 6.0.0-alpha1 0x11D35.

    eclipse-fix.png

  • Thanks for the tip about Eclipse debugging. I use Eclipse for almost every kind of development I do.

    However, I also use the typical tracing through serial port to see the execution point and still it gets stuck at the connection level. I saw that I can send messages from the terminal (uart connection) to the iphone but if I do nothing for more than 3 seconds, the nRF blocks.

    And if I send a message from the iphone to the nRF, it blocks also inmediately (no possibility even to trace anything).

    Have anyone had a similar problem with this application?

    Regards, M.

  • Please make sure that your app_error_handler does not do a reset, and try to halt the chip there to see if an error of some kind occurs.

    By default, the error handler does a reset, so if some kind of error occurs, the device will reset directly, and abruptly ending any UART communication.

Related