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

How to debug print on Rigado BMD-200?

Hi everyone,

I am using the nRF51 SDK 10.0 with the Rigado BMD-200 Evaluation Kit and want to print debug messages to UART or something similar.

I am trying from main my main function with

void debug_log_init() {
#ifdef ENABLE_DEBUG_LOG_SUPPORT
	// Initialize module
	app_trace_init();
app_trace_log("nRF51 booting.\r\n");
#endif
}

Then I am using miniterm on OSX with the following settings:

--- Miniterm on /dev/cu.usbmodem142311: 38400,8,N,1 ---

But I see nothing. No debug prints or anything.

Update 1: I made sure that ENABLE_DEBUG_LOG_SUPPORT is turned on, so that is definitely not the problem.

Update 2: So according to Rigado's guide at www.rigado.com/.../BMD-200-EVAL-UG-V1.0.pdf, flow control is always on. In my custom_board.h I have:

#define RX_PIN_NUMBER  9
#define TX_PIN_NUMBER  10
#define CTS_PIN_NUMBER 3
#define RTS_PIN_NUMBER 2
// Hardware flow control.
#define HWFC           true

And then on OSX I used

screen -f /dev/cu.usbmodem1a121 38400

to try and display the output. The -f should turn on the flow control (according to developer.apple.com/.../screen.1.html). However that still did not work. Screen remains entirely empty.

I also tried it with CTS and RTS swapped since Rigado's guide is ambiguous to me which of the two should be RTS and which one CTS, but that does not work other with all other things unchanged.

What am I doing wrong? How can I print stuff?

  • Hi Raphael,

    What are you using to connect to eval kit? I connected a factory programmed eval kit directly to my OS X machine, issued screen -f /dev/tty.usbmodem1411 and I was able to communicate with our built-in firmware (BMDware) without any changes.

    Flow control is not always on. The documentation is not clear, but that issue only applies to the built-in JLink CDC Virtual Com Port rather than just "in general" for the BMD-200. The JLink drivers require flow control if you are using the VCP through the interface IC (on board USB connector). However, if you are connecting via a different USB VCP device, then flow control is likely not needed.

    The default app_trace_init() implementation does not have flow control enabled (see app_trace.c around line 49). Make sure to cut traces P0.09 and P0.10 if using an external USB VCP.

  • Another option is to send me an archive of the project and I can debug it here. If that's something you'd like to do, let me know.

  • The eval kit is connected via USB (through J-Link OB I guess) to my mac, no additional hardware is involved. So how can I get app_trace_init to enable the flow control? Do I need to change app_trace.c or is there a way without modifying files of the SDK?

  • If you are using the J-Link OB and are enabling flow control with screen (as I did), then you shouldn't have to do anything but update the pin definitions which you've already done.

    Where did you modify the pin definitions? I was able to get the SDK example Heart Rate Monitor working and the eval kit with app_trace.c by doing the following: Add ENABLE_DEBUG_LOG_SUPPORT as a build define Call app_trace_init() in main.c after buttons_leds_init(); Added app_trace_log("test\r\n"); after calling app_trace_init(). In board_pca10028.h I changed the RX, TX, CTS, and RTS pins to match the BMD-200 Eval Kit pinout. You can also download our custom board file and use that instead with BOARD_CUSTOM as a build define however, for just the UART, that is not necessary.

    Then from terminal I connected via screen -f and received output from the running application.

  • OK, next iteration, getting closer, but it still does not work: Now I am getting tons of � characters in screen.

    At the same time I got the UART example in /nRF51_SDK_10.0.0/examples/peripheral/uart to work. However, completely different to the general app_template and what the SDK 10 docs say about using the app_trace library, the UART is manually set up there and I am getting a feeling that is the reason why it works.

    I am going to send you a copy of the code so you can try and reproduce it.

Related