<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How to debug print on Rigado BMD-200?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10561/how-to-debug-print-on-rigado-bmd-200</link><description>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</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 10 Dec 2015 09:32:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10561/how-to-debug-print-on-rigado-bmd-200" /><item><title>RE: How to debug print on Rigado BMD-200?</title><link>https://devzone.nordicsemi.com/thread/39302?ContentTypeID=1</link><pubDate>Thu, 10 Dec 2015 09:32:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d862f00e-02b8-45be-85b9-c45484b0516a</guid><dc:creator>Raphael</dc:creator><description>&lt;p&gt;Together with Eric I figured out the problem:&lt;/p&gt;
&lt;p&gt;I changed the pins in both nrf_drv_config.h to&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#if (UART0_ENABLED == 1)
#define UART0_CONFIG_HWFC         NRF_UART_HWFC_ENABLED
#define UART0_CONFIG_PARITY       NRF_UART_PARITY_EXCLUDED
#define UART0_CONFIG_BAUDRATE     NRF_UART_BAUDRATE_38400
#define UART0_CONFIG_PSEL_TXD 9
#define UART0_CONFIG_PSEL_RXD 10
#define UART0_CONFIG_PSEL_CTS 2
#define UART0_CONFIG_PSEL_RTS 3
...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and in custom_board.h&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define RX_PIN_NUMBER  9
#define TX_PIN_NUMBER  10
#define CTS_PIN_NUMBER 2
#define RTS_PIN_NUMBER 3
// Hardware flow control.
#define HWFC           true
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;However, the most annoying and at least to me least obvious problem was that the loop code from the app_template example&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;for (;;) {
	power_manage();
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;froze up the application because the SoftDevice was apparently not properly setup previously.&lt;/p&gt;
&lt;p&gt;So replacing that loop in main() with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;for (;;) {
	nrf_delay_ms(10);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and of course including nrf_delay.h fixed the problem and I can now see stuff in terminal (screen -f /dev/cu.usbmodem1a121 38400).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to debug print on Rigado BMD-200?</title><link>https://devzone.nordicsemi.com/thread/39300?ContentTypeID=1</link><pubDate>Wed, 09 Dec 2015 20:39:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c299900-bfbe-45d7-a090-fe5d30d1009e</guid><dc:creator>Raphael</dc:creator><description>&lt;p&gt;OK, next iteration, getting closer, but it still does not work:
Now I am getting tons of � characters in screen.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;I am going to send you a copy of the code so you can try and reproduce it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to debug print on Rigado BMD-200?</title><link>https://devzone.nordicsemi.com/thread/39299?ContentTypeID=1</link><pubDate>Wed, 09 Dec 2015 00:12:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93513182-b08f-4499-9064-03a8be0729d3</guid><dc:creator>Eric Stutzenberger</dc:creator><description>&lt;p&gt;If you are using the J-Link OB and are enabling flow control with screen (as I did), then you shouldn&amp;#39;t have to do anything but update the pin definitions which you&amp;#39;ve already done.&lt;/p&gt;
&lt;p&gt;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(&amp;quot;test\r\n&amp;quot;); 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.&lt;/p&gt;
&lt;p&gt;Then from terminal I connected via screen -f and received output from the running application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to debug print on Rigado BMD-200?</title><link>https://devzone.nordicsemi.com/thread/39298?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2015 23:36:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4fa463b-8437-48ce-8a67-077b5a8bcf91</guid><dc:creator>Raphael</dc:creator><description>&lt;p&gt;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?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to debug print on Rigado BMD-200?</title><link>https://devzone.nordicsemi.com/thread/39296?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2015 23:32:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa09139b-79cc-4685-b810-039d3dfb0a01</guid><dc:creator>Eric Stutzenberger</dc:creator><description>&lt;p&gt;Another option is to send me an archive of the project and I can debug it here.  If that&amp;#39;s something you&amp;#39;d like to do, let me know.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to debug print on Rigado BMD-200?</title><link>https://devzone.nordicsemi.com/thread/39295?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2015 23:31:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eae2039f-161b-4511-82c1-7520133944e3</guid><dc:creator>Eric Stutzenberger</dc:creator><description>&lt;p&gt;Hi Raphael,&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;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 &amp;quot;in general&amp;quot; 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.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to debug print on Rigado BMD-200?</title><link>https://devzone.nordicsemi.com/thread/39297?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2015 21:36:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b91ae0d-eec6-479e-97a0-f81c62a6e09d</guid><dc:creator>Raphael</dc:creator><description>&lt;p&gt;So according to Rigado&amp;#39;s guide at &lt;a href="https://www.rigado.com/wp-content/uploads/BMD-200-EVAL-UG-V1.0.pdf"&gt;www.rigado.com/.../BMD-200-EVAL-UG-V1.0.pdf&lt;/a&gt;, flow control is always on.
In my custom_board.h I have:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#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
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And then on OSX I used&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;screen -f /dev/cu.usbmodem1a121 38400
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to try and display the output.
However that still did not work.&lt;/p&gt;
&lt;p&gt;I also tried it with CTS and RTS swapped since Rigado&amp;#39;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.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to debug print on Rigado BMD-200?</title><link>https://devzone.nordicsemi.com/thread/39294?ContentTypeID=1</link><pubDate>Tue, 01 Dec 2015 00:05:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:517fb0d9-b338-40a6-9aa2-8ef0657750e9</guid><dc:creator>Eric Stutzenberger</dc:creator><description>&lt;p&gt;Also, depending on your JLink driver version, it requires RTS to be low before it will acknowledge any received data on the RX line of the JLink CDC UART connection.  Try enabling Hardware Flow Control on the PC side UART.  I believe this is fixed in one of the 5.0+ JLink driver versions but I do not remember which off hand.&lt;/p&gt;
&lt;p&gt;Hope this helps,
Eric&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to debug print on Rigado BMD-200?</title><link>https://devzone.nordicsemi.com/thread/39301?ContentTypeID=1</link><pubDate>Mon, 30 Nov 2015 18:39:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00913c4b-61e6-4724-9420-3b54d60809ab</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;The board is using other pins for TX and RX. Change&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define RX_PIN_NUMBER  11
#define TX_PIN_NUMBER  9
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define RX_PIN_NUMBER  9
#define TX_PIN_NUMBER  10
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Based on the &lt;a href="https://www.rigado.com/?wpdmdl=1648"&gt;BMD-200 reference design&lt;/a&gt;. If you enable hardware flow control, make sure to change those pin definitions aswell.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to debug print on Rigado BMD-200?</title><link>https://devzone.nordicsemi.com/thread/39293?ContentTypeID=1</link><pubDate>Mon, 30 Nov 2015 17:25:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4829f19c-2c18-43f4-9fcb-d66b23838981</guid><dc:creator>Raphael</dc:creator><description>&lt;p&gt;Yes, I tried with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void debug_log_init() {
#ifdef ENABLE_DEBUG_LOG_SUPPORT
#pragma message &amp;quot;ENABLE_DEBUG_LOG_SUPPORT on.&amp;quot;
  // Initialize module
  app_trace_init();
  app_trace_log(&amp;quot;nRF51 booting.\r\n&amp;quot;);
#endif
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;ENABLE_DEBUG_LOG_SUPPORT is turned on and the preprocessor message is printed during compilation&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to debug print on Rigado BMD-200?</title><link>https://devzone.nordicsemi.com/thread/39292?ContentTypeID=1</link><pubDate>Mon, 30 Nov 2015 17:01:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90db39f2-01d8-41eb-ab77-da745e3fcac1</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;Is ENABLE_DEBUG_LOG_SUPPORT defined globally in the preprocessor symbols? app_trace_log is defined as printf if so.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>