<?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>nrf52832 UART data reception from another MCU and printing it over serial terminal</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/104218/nrf52832-uart-data-reception-from-another-mcu-and-printing-it-over-serial-terminal</link><description>Hi, currently I am working with a TI mmWave radar which gives integer value as output. When I try to fetch this data via UART TX and RX pins, they are not received and printed properly. Instead, an unknown value is printed over serial terminal. Is there</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 04 Oct 2023 14:46:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/104218/nrf52832-uart-data-reception-from-another-mcu-and-printing-it-over-serial-terminal" /><item><title>RE: nrf52832 UART data reception from another MCU and printing it over serial terminal</title><link>https://devzone.nordicsemi.com/thread/448862?ContentTypeID=1</link><pubDate>Wed, 04 Oct 2023 14:46:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0cade953-dda8-4d2f-bc96-a9f4fd82844a</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Thank you for the clarification, and for the diagram - this is very helpful for me to see.&lt;/p&gt;
[quote user="Jayasurya K"]My aim was to receive the values, and if a value is received, an LED should be blinking. And in the radar part the parsing was not done by us. TI&amp;#39;s internal team did it. THey said that the 4,1,1,1,1 values are sent in terms of ASCII characters. I am able to read hello world from the radar module but not the number values. I hope you have a clarity now. I am also attaching a simple illustration of what the[/quote]
&lt;p&gt;Does this mean that the 4,1,1,1,1 values are sent as &lt;a href="https://www.asciitable.com/"&gt;the Oct 004 and 001, or does it mean that they are being sent as Oct 064 and 061&lt;/a&gt;?&lt;br /&gt;If the radar always outputs characters (like in the &amp;#39;hello world&amp;#39; case), then there should be no issue seeing them on the UART, which is why I suspect that the readings might be sent as binary values instead of ASCII characters, leading to an incorrect parsing.&lt;br /&gt;&lt;br /&gt;Do you have access to a logic analyzer? This would let us see exactly what it is that is being sent between the devices, without any uncertainty.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 UART data reception from another MCU and printing it over serial terminal</title><link>https://devzone.nordicsemi.com/thread/448672?ContentTypeID=1</link><pubDate>Tue, 03 Oct 2023 13:38:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00b2c556-aec4-42d3-aaef-71066122fe62</guid><dc:creator>Jayasurya K</dc:creator><description>&lt;p&gt;Hi Karl,&lt;/p&gt;
&lt;p&gt;Let me explain you in a detailed way. So this IWRL6432 module gives values over RS232 each second which is updated by an internal radar operation(transmission and reception using antennas). Initially, these values were sent in binary format. I was able to read them using a serial terminal but not using nRF52. I did not even want to print the values as I thought there will be data loss as 2 UART are being used simultaneously. My aim was to receive the values, and if a value is received, an LED should be blinking. And in the radar part the parsing was not done by us. TI&amp;#39;s internal team did it. THey said that the 4,1,1,1,1 values are sent in terms of ASCII characters. I am able to read hello world from the radar module but not the number values. I hope you have a clarity now. I am also attaching a simple illustration of what the issue is.&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Drawing13.jpeg" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 UART data reception from another MCU and printing it over serial terminal</title><link>https://devzone.nordicsemi.com/thread/448625?ContentTypeID=1</link><pubDate>Tue, 03 Oct 2023 11:14:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6776a961-cf27-4721-86e6-542f0807473a</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="Jayasurya K"]Thanks and sorry for the delayed reply.[/quote]
&lt;p&gt;No worries at all, we&amp;#39;ll continue this whenever you have the chance.&lt;/p&gt;
[quote user="Jayasurya K"]After few corrections, we were able to make radar module to give live values in form of characters.[/quote]
&lt;p&gt;Does this means that you have changed the parsing to instead convert the received integers to chars, instead of the other way around? Could you elaborate on how you have done this, so that I may get a better understanding of how your system now functions?&lt;/p&gt;
[quote user="Jayasurya K"]we are able to receive each character, store and then print them. Now, the module sends live updated data &amp;quot;4, 0, 0, 0, 0&amp;quot; in character format. When we tried to receive this using the nRF52 with same code, it was not possible. What are we missing here? What should be done in order to receive the live data from radar module?[/quote]
&lt;p&gt;This is likely because you have changed the output for the radar has changed. Please elaborate on what the sensor is actually outputting, and how you are processing this on the receiving nRF.&lt;br /&gt;Could you perhaps create a small diagram to illustrate your system as well?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 UART data reception from another MCU and printing it over serial terminal</title><link>https://devzone.nordicsemi.com/thread/448590?ContentTypeID=1</link><pubDate>Tue, 03 Oct 2023 04:33:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92ae98ff-65cb-4eb4-9f93-443255eeabbc</guid><dc:creator>Jayasurya K</dc:creator><description>&lt;p&gt;Hi Karl,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and sorry for the delayed reply. After few corrections, we were able to make radar module to give live values in form of characters. Now the issue is,&amp;nbsp;&lt;span&gt;&amp;nbsp;when I try to receive a data &amp;quot;Hello World&amp;quot; from the module, we are able to receive each character, store and then print them. Now, the module sends live updated data &amp;quot;4, 0, 0, 0, 0&amp;quot; in character format. When we tried to receive this using the nRF52 with same code, it was not possible. What are we missing here? What should be done in order to receive the live data from radar module? Please clarify for us on this. Here are the UART configurations.&lt;/span&gt;&lt;/p&gt;
&lt;div class="x_elementToProof" data-ogsc="rgb(0, 0, 0)"&gt;Baud rate: 115200&amp;nbsp;&lt;/div&gt;
&lt;div class="x_elementToProof" data-ogsc="rgb(0, 0, 0)"&gt;Parity bit: none&lt;/div&gt;
&lt;div class="x_elementToProof" data-ogsc="rgb(0, 0, 0)"&gt;Hardware flow control: disabled&lt;/div&gt;
&lt;div class="x_elementToProof" data-ogsc="rgb(0, 0, 0)"&gt;Stop bits: 1&lt;/div&gt;
&lt;div class="x_elementToProof" data-ogsc="rgb(0, 0, 0)"&gt;UART instance: UART0&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 UART data reception from another MCU and printing it over serial terminal</title><link>https://devzone.nordicsemi.com/thread/448309?ContentTypeID=1</link><pubDate>Fri, 29 Sep 2023 10:15:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9b1608c-2e57-463a-99e8-fc72a1b0b267</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="Jayasurya K"]Thanks for the reply.[/quote]
&lt;p&gt;No problem at all, I am happy to help! :)&amp;nbsp;&lt;/p&gt;
[quote user="Jayasurya K"] Yes. Except this everything is working fine. For example, i tried to receive the data &amp;quot;hello world&amp;quot; from the radar module. I received each character, stored it in an array and printed it. It worked perfectly. But when I try to receive the values 4 and 10 from the module, I am not able to print the same value. I am attaching the code for your reference.[/quote]
&lt;p&gt;I am glad to read that everything else is working fine - this strengthens my suspicion that this issue is with the parsing of the data, and not with the application/data itself.&lt;br /&gt;Could you clarify what you mean when you say &amp;#39;print&amp;#39; here, do you mean print in the log, or in your serial monitor?&lt;br /&gt;In case of the former, please try to use&amp;nbsp;&lt;em&gt;printf(&lt;span&gt;&amp;quot;%#08x\n&amp;quot;&lt;/span&gt;&lt;/em&gt;&lt;span&gt;&lt;em&gt;, i);&lt;/em&gt; for your printing of the data to verify that it is the correct value.&lt;br /&gt;&lt;/span&gt;In case of the latter, please check if your serial monitor has an option to show the received data directly without parsing it as&amp;nbsp;&lt;em&gt;char&lt;/em&gt;.&lt;br /&gt;&lt;br /&gt;For future reference, please use the&amp;nbsp;&lt;em&gt;Insert -&amp;gt; Code&amp;nbsp;&lt;/em&gt;option when sharing code here on DevZone.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 UART data reception from another MCU and printing it over serial terminal</title><link>https://devzone.nordicsemi.com/thread/448201?ContentTypeID=1</link><pubDate>Thu, 28 Sep 2023 15:47:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f3d55e2-360e-4c44-ae23-585bd16818ab</guid><dc:creator>Jayasurya K</dc:creator><description>&lt;p&gt;Can you please help me in this? I am actually receiving a binary data over UART. I need to print the corresponding integer value but I am stuck.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 UART data reception from another MCU and printing it over serial terminal</title><link>https://devzone.nordicsemi.com/thread/448145?ContentTypeID=1</link><pubDate>Thu, 28 Sep 2023 11:59:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8f59d6b-b630-4215-8120-b1d0d6122a8c</guid><dc:creator>Jayasurya K</dc:creator><description>&lt;p&gt;Thanks for the reply. Yes. Except this everything is working fine. For example, i tried to receive the data &amp;quot;hello world&amp;quot; from the radar module. I received each character, stored it in an array and printed it. It worked perfectly. But when I try to receive the values 4 and 10 from the module, I am not able to print the same value. I am attaching the code for your reference.&lt;/p&gt;
&lt;p&gt;int main(void)&lt;br /&gt;{&lt;br /&gt; uint32_t err_code;&lt;br /&gt; bsp_board_init(BSP_INIT_LEDS);&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; const app_uart_comm_params_t com_params =&lt;br /&gt; {&lt;br /&gt; RX_PIN_NUMBER,&lt;br /&gt; TX_PIN_NUMBER,&lt;br /&gt; RTS_PIN_NUMBER,&lt;br /&gt; CTS_PIN_NUMBER,&lt;br /&gt; UART_HWFC,&lt;br /&gt; false,&lt;br /&gt; NRF_UART_BAUDRATE_115200&lt;/p&gt;
&lt;p&gt;};&lt;br /&gt; &lt;br /&gt; APP_UART_FIFO_INIT(&amp;amp;com_params, UART_RX_BUF_SIZE, UART_TX_BUF_SIZE, uart_err_handle, APP_IRQ_PRIORITY_LOWEST, err_code);&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;printf(&amp;quot;UART Receiver\n&amp;quot;);&lt;/p&gt;
&lt;p&gt;while(true)&lt;br /&gt; {&lt;/p&gt;
&lt;p&gt;uint32_t cr;&lt;/p&gt;
&lt;p&gt;uint32_t data[20];&lt;br /&gt; int i=0;&lt;/p&gt;
&lt;p&gt;app_uart_get(&amp;amp;cr);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; if(cr!=0)&lt;br /&gt; {&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;data[i] = cr;&lt;br /&gt; i++;&lt;br /&gt; // for (int j = 0; data[j] != &amp;#39;\0&amp;#39;; j++) {&lt;br /&gt; printf(&amp;quot;%d&amp;quot;,data[i]);&lt;br /&gt; // }&lt;br /&gt; nrf_delay_us(1000000);&lt;/p&gt;
&lt;p&gt;// }&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;br /&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 UART data reception from another MCU and printing it over serial terminal</title><link>https://devzone.nordicsemi.com/thread/448137?ContentTypeID=1</link><pubDate>Thu, 28 Sep 2023 11:44:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c927d191-4c74-4e89-850b-ae0a72f37e23</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user=""]When I try to fetch this data via UART TX and RX pins, they are not received and printed properly. Instead, an unknown value is printed over serial terminal. Is there any way to overcome this? [/quote]
&lt;p&gt;This sounds to me like it might be an issue with the parsing of the received data.&lt;br /&gt;Is everything else working as expected, apart from the received values not being as expected? I.e there is no errors or failures otherwise?&lt;br /&gt;&lt;br /&gt;Could you provide some examples of these unknown values, and the range that you would have expected them to be in?&lt;br /&gt;My suspicion is that your sent &lt;a href="https://www.asciitable.com/"&gt;integers are interpreted as &lt;em&gt;char&amp;nbsp;&lt;/em&gt;on the receiving end&lt;/a&gt;, for instance.&lt;br /&gt;To isolate where in the communication this happens you can print the data received from your sensor in the device log, as well as pushing it to the UART. This way you can verify if the issue is that your serial terminal is parsing it incorrectly, or if the value is incorrect in the nRF.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>