<?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>UARTE isn&amp;#39;t working</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/63587/uarte-isn-t-working</link><description>Hi. I&amp;#39;m writing my own libraries for nRF52832 and I can&amp;#39;t get UARTE to work. 
 Here is my code. 
 I&amp;#39;m using pins 6 and 8 as the UART example. 
 I wrote same code for UART (without DMA) and it works fine! 
 
 uart.c file 
 
 
 main.c 
 
 
 I don&amp;#39;t get</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 10 Jul 2020 15:47:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/63587/uarte-isn-t-working" /><item><title>RE: UARTE isn't working</title><link>https://devzone.nordicsemi.com/thread/259508?ContentTypeID=1</link><pubDate>Fri, 10 Jul 2020 15:47:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a573fdea-629d-4b01-a4a7-b21c0690e111</guid><dc:creator>George555</dc:creator><description>&lt;p&gt;I changed all the flags from UART_ to UARTE_ and it works!&lt;/p&gt;
&lt;p&gt;Thanks for noticing the &lt;em&gt;UART_ENABLE_ENABLE_Enabled&lt;/em&gt;. It is different. It didn&amp;#39;t solve the problem but after changing all the flags to UARTE it worked!&lt;/p&gt;
&lt;p&gt;Thank you very much !!&lt;/p&gt;
&lt;p&gt;PS: I couldn&amp;#39;t try the code you posted cause I don&amp;#39;t use SDK at all.&lt;/p&gt;
&lt;p&gt;I only use the necessary files (bitfields, peripheral pointers etc) to get it work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE isn't working</title><link>https://devzone.nordicsemi.com/thread/259505?ContentTypeID=1</link><pubDate>Fri, 10 Jul 2020 15:42:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e161c48-7a4d-415a-851a-686f179bc05c</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Did you try the code I posted? It works with UARTE0. Note my comments about enabling the UART; what is the value of&amp;nbsp;&lt;em&gt;UART_ENABLE_ENABLE_Enabled&lt;/em&gt;? The value to enable the&amp;nbsp;uart is different for UARTE compared with UART as I state in the code I posted.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE isn't working</title><link>https://devzone.nordicsemi.com/thread/259502?ContentTypeID=1</link><pubDate>Fri, 10 Jul 2020 15:31:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b90a4919-93fc-4c4f-9f1d-008097cc4a70</guid><dc:creator>George555</dc:creator><description>&lt;p&gt;So far, I&amp;#39;m trying to see the &amp;quot;Hello world\r\n&amp;quot; on the terminal. It should transmit the string once the chip restarts.&lt;/p&gt;
&lt;p&gt;I still don&amp;#39;t understand why the UART peripheral worked fine but UARTE does not.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;According to the datasheet the transmission initialized by setting up the TXD pointer and the size and triggering the STARTTX task&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div style="background-color:#1e1e1e;color:#d4d4d4;font-family:&amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace, &amp;#39;Droid Sans Fallback&amp;#39;;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div style="background-color:#1e1e1e;color:#d4d4d4;font-family:&amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace, &amp;#39;Droid Sans Fallback&amp;#39;;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#dcdcaa;"&gt;strcpy&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;(&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;tx_buffer&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;, &lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;Hello world&lt;/span&gt;&lt;span style="color:#d7ba7d;"&gt;\r\n&lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#9cdcfe;"&gt;NRF_UARTE0&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;TXD&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;.&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;PTR&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt; = (&lt;/span&gt;&lt;span style="color:#4ec9b0;"&gt;uint32_t&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;)((&lt;/span&gt;&lt;span style="color:#4ec9b0;"&gt;uint8_t&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt; *)&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;tx_buffer&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#9cdcfe;"&gt;NRF_UARTE0&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;TXD&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;.&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;MAXCNT&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt; = &lt;/span&gt;&lt;span style="color:#b5cea8;"&gt;14&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#9cdcfe;"&gt;NRF_UARTE0&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;TASKS_STARTTX&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt; = &lt;/span&gt;&lt;span style="color:#b5cea8;"&gt;1&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE isn't working</title><link>https://devzone.nordicsemi.com/thread/259494?ContentTypeID=1</link><pubDate>Fri, 10 Jul 2020 15:11:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99071bfb-9e92-4bf0-9c60-933166b91fef</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Try this code then compare with yours, for example start without flow control - like this code - and incrementally add features. Some of the steps here are not strictly necessary, but this works.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static NRF_UARTE_Type *pUART = NRF_UARTE0;
#define UART_TX 6
#define UART_RX 8

static void UartTransmit(uint8_t *pMsg, uint16_t MsgLength)
{
   // Disable the UARTE
   pUART-&amp;gt;ENABLE = 0;

   // Configure UARTE with no flow control, no parity bit and 230400 baud rate
   pUART-&amp;gt;CONFIG = 0;
   pUART-&amp;gt;BAUDRATE = NRF_UART_BAUDRATE_230400;

   // Select TX and RX pin default disconnected mode to avoid sending break indication on disabling uart
   nrf_gpio_cfg(UART_RX, NRF_GPIO_PIN_DIR_INPUT,  NRF_GPIO_PIN_INPUT_CONNECT,    NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_S0S1, NRF_GPIO_PIN_NOSENSE);
   nrf_gpio_cfg(UART_TX, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_DISCONNECT, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_H0H1, NRF_GPIO_PIN_NOSENSE);

   // Select TX and RX pins
   pUART-&amp;gt;PSEL.TXD = UART_TX;
   pUART-&amp;gt;PSEL.RXD = UART_RX;

   // Disable all interrupts and clear events
   pUART-&amp;gt;INTENCLR = 0xFFFFFFFFUL;
   pUART-&amp;gt;EVENTS_TXSTARTED = 0;
   pUART-&amp;gt;EVENTS_TXSTOPPED = 0;
   pUART-&amp;gt;EVENTS_RXSTARTED = 0;
   pUART-&amp;gt;EVENTS_ENDTX = 0;
   pUART-&amp;gt;EVENTS_ENDRX = 0;

   // Enable the UART, note 0x04 for UART and 0x08 for UARTE with DMA
   pUART-&amp;gt;ENABLE = 0x08;

   // Configure transmit buffer and start the transfer
   pUART-&amp;gt;TXD.MAXCNT = MsgLength;
   pUART-&amp;gt;TXD.PTR    = (uint32_t)pMsg;
   pUART-&amp;gt;TASKS_STARTTX = 1;
   __DSB();
   // Wait until the transfer start event is indicated
   while (pUART-&amp;gt;EVENTS_TXSTARTED == 0) ;

   // Wait until the transfer is complete
   while (pUART-&amp;gt;EVENTS_ENDTX == 0) ;

   // Stop the UART TX
   pUART-&amp;gt;TASKS_STOPTX = 1;
   __DSB();
   // Wait until we receive the stopped event
   while (pUART-&amp;gt;EVENTS_TXSTOPPED == 0) ;

   // Disable the UARTE
   pUART-&amp;gt;ENABLE = 0;

   // De-Select TX and RX pins
   pUART-&amp;gt;PSEL.TXD = 0x80000000;
   pUART-&amp;gt;PSEL.RXD = 0x80000000;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This code enables the UARTE0, transmits a string, then disables UARTE0 and releases the port pins so they can be used by other devices - such as (say) remote wakeup&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE isn't working</title><link>https://devzone.nordicsemi.com/thread/259493?ContentTypeID=1</link><pubDate>Fri, 10 Jul 2020 15:05:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8808ae94-5159-4048-9256-ba91843a1c26</guid><dc:creator>George555</dc:creator><description>&lt;p&gt;No, I&amp;#39;m writing my own drivers. I used the same code for uart without dma and it worked fine. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE isn't working</title><link>https://devzone.nordicsemi.com/thread/259491?ContentTypeID=1</link><pubDate>Fri, 10 Jul 2020 14:56:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bfec6323-74ae-4ad6-94be-3a01ac0d7128</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Have you tried using the drivers and libraries that are included in the SDK? I don&amp;#39;t know by heart how these registers are used, since the drivers are more commonly used. Have you tried analyzing the UART wires to see if there is any activity after you call uart_write_string()?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>