This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Debugging data from nrf51822

Hello Everyone,

I am new to BLE world. Currently using MDBT40 which has nrf51822 as core: www.raytac.com/.../MDBT40-ANT-D.pdf

I am following this repo:github.com/.../arduino-nRF5 in which nrf51822 can be programmed using arduino IDE. Nrf is running S130 and is being programmed using J-link with SWD programming.

Arduino IDE provides serial monitor to debug data which is printed using Serial.print() function but it doesn`t works with nrf51822 which is programmed using J-link. Is there any software in which I can print data which needs to be debugged? I tried nrf-sniffer and followed the documentation, however it get stuck in between and none of the device is visible. Am I on right track? Are there any other tools to monitor the data?

Thanks in advance

  • nRF Sniffer is for radio interface, that won't help with UART. If you have any mean how to connect to UART (serial) PINs on your board (e.g. popular FTDI "serial to USB" cable) then you can observe debug print outs in any terminal (e.g. PuTTY).

  • Thank you for the reply. However I have made a custom board and none of the pin is left to configure as tx and rx. So it is difficult to connect "FTDI serial to USB"converter to the board. Is it possible from SWD pins of the jlink?

  • Sorry but you make your question more and more confusing. Could you just tell us what you have, what you want to do, what you've tried and how/why it didn't work?

  • Sorry for making it confusing. I have a custom board in which raytacs MDBT40 is the core. All the gpios and other pins are used by motors, buzzer, and other peripheral. The only pins left to access are swd programming pins (swdclk,swdio). I am programming the board using jlink with swd programming. So it is possible to use same pins (swdio,swdclk) for debugging data? Like in arduino we connect arduino to pc uaing usb and open serial monitor to debug the data. So whether same is possible with jlink and MDBT40?

  • Well there are two ways how to use or repurpose SDW "programming" PINs but I'm afraid none o these will be available for you (at least from your description it sounds like only SWDCLK and SWDIO are used and these are fixed, no magic with them, also as I see nRF51 PIN layout these two options are not even supported by the chip):

    • Using SWO which is dedicated PIN for specific debugging printout protocol defined by ARM (supported by nRF52 but not supported by nRF51 from what I see).
    • Switching some "optional" SWD PINs such as nRESET to GPIO and configuring it as UART Tx to transport debugging messages to the host (this is nice trick on nRF52 but again nRF51 seems to have nRESET merged with SWDIO and no alternative GPIO function possible).

    So if you really need some debug messaging I recommend to sacrifice some PIN from "motors, buzzer and others".

Related