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

nrf51822 uart example doesn´t work

Hey pro´s, first thanks for this great community! I´ve read a lot of conntents here, and there is a huge amount of knowledge in this forum! But since 2 weeks i´ve got a problem i can´t solve...

I use a small board with a 51822 on it, programmed by a st-link via open-ocd. I work on a mac, so i use gcc. Since here no problem... First i tried a blinking-led-program, without softdevice, everythings fine. Second i tried the HRS-Example from SDK10 with the S110. I changed the makefile so the ram is allocated right, used mergehex to merge the compiled hex with the s110, burned it via open-ocd, everythings fine. The app on my iphone recognizes the board in 2 seconds, everythings ok.

As i need a ble-uart connection for my project, i tried the ble-uart-example next. compiled fine, but the app doesn´t find the nrf?!?!?? After some minutes for a few second "nodric hrs" popped on, but i couldn´t connect.

Any ideas what i´ve done wrong? Thanks a lot

Grettings from germany Tobias

  • It is hard/impossible to help you without any code or error logs, sorry. You should debug the application. To do this, my advice would be:

    1. Program the S110 SoftDevice once on the device. You can use nRFgo Studio or the nRF5x-Command-Line-Tools (only compatible with a Segger tools) or OpenOCD with any compatible SWD probe. Have a look at my answer if you are looking to do this with OpenOCD and make. It will be much more faster if you do not need to program the SD each time.
    2. Enable GDB to debug your application (without merging with the SD) using the GNU ARM Eclipse plugin. You will find many tutorial on how configure gdb.

    I used the same toolchain as you (I am running Linux). Please post here more details on the error or stack trace.

  • Hi metch, thanks for your response! I didn´t set up eclipse and gdb yet, will try this today. In the meantime i tried the HTS-Example, works fine...

    Here is what i do: -Edit the linker script to ram-length 2000 in the armgcc folder (of the example) -Terminal to the armgcc-folder (of the example) -make -copy the s110.hex from the components folder into the build folder -"mergehex -m s110.hex build.hex -o merged-hex" (where build.hex is the freshly made) -"openocd -s /usr/local/Cellar/open-ocd/0.8.0/share/openocd/scripts/ -f interface/stlink-v2.cfg -f target/nrf51.cfg" -second terminal "telnet 127.0.0.1 4444" -"halt", "nrf51 mass_erase", "flash write_image erase mergerd.hex 0", "reset" -connect the iphone app

    Surely this takes longer upload time due to the softdevice flashed everytime, but for the first examples i can live with that wait-time...

    I´ve done this procedure with the : "ble_app_hrs" example, works fine "ble_app_hts" example, works fine "ble_app_uart" example, can´t find the device in the iphone app

    While i trying to set up eclipse, can you maybe try out the uart-example in your toolchain? Maybe the problem is in the SDK10...

    Thanks, Tobias

    UPDATE: tried the same procedure with the ble_app_rsc example, works fine....

    Second UPDATE: i´ve tested the procedure now with SDK11 and S130 instead of S110. The RamLength in the makefile should be 1F80. HRM and HTS works fine, UART no device found....

    Third UPDATE: i´ve downloaded SDK 8.0.0, and with this SDK the UART example works as it should...

Related