<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: UART TX misteriously stops working in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/UART-TX-misteriously-stops-working/m-p/1199928#M43271</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/84714"&gt;@adamhimer&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;The configuration for the UART pins is the same in the application and the bootloader?&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Alexis Andalon&lt;/P&gt;</description>
    <pubDate>Tue, 15 Dec 2020 22:55:16 GMT</pubDate>
    <dc:creator>Alexis_A</dc:creator>
    <dc:date>2020-12-15T22:55:16Z</dc:date>
    <item>
      <title>UART TX misteriously stops working</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/UART-TX-misteriously-stops-working/m-p/1198154#M43236</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I have a very strange problem on the with LPC1549.&lt;BR /&gt;&lt;BR /&gt;Setup:&lt;BR /&gt;- USART_1 is used as a debugger output that prints to a serial terminal&lt;BR /&gt;- First section of flash is used for a bootloader, the rest is used for application firmware&lt;BR /&gt;- Both bootloader and application use the same functions in "board.c" and "board.h" from "lpc_board_nxp_lpcxpresso_1549" project&lt;BR /&gt;&lt;BR /&gt;This has worked perfectly fine on my previous board revision, which used TX-p0.13 and RX-p0.18 (ISP pins but reversed due to PCB mistake)&lt;BR /&gt;&lt;BR /&gt;The PCB was revised and TX-RX reversed, so that it matches the default ISP pinout for sake of compatibility.&lt;BR /&gt;&lt;BR /&gt;After the changes, everything works fine, except the TX functionality in the bootloader code. The bootloader receives command characters perfectly fine on the RX line when I type it into the terminal, but won't echo it back(as a quick test) or print out anything.&lt;BR /&gt;&lt;BR /&gt;The application prints and receives character commands as normal.&lt;BR /&gt;&lt;BR /&gt;// Set up pins&lt;BR /&gt;Chip_IOCON_PinMuxSet(LPC_IOCON, UART1_TX_PORT, UART1_TX_PIN, (IOCON_MODE_INACT | IOCON_DIGMODE_EN));&lt;BR /&gt;Chip_IOCON_PinMuxSet(LPC_IOCON, UART1_RX_PORT, UART1_RX_PIN, (IOCON_MODE_INACT | IOCON_DIGMODE_EN));&lt;BR /&gt;Chip_SWM_MovablePortPinAssign(SWM_UART1_RXD_I, UART1_RX_PORT, UART1_RX_PIN);&lt;BR /&gt;Chip_SWM_MovablePortPinAssign(SWM_UART1_TXD_O, UART1_TX_PORT, UART1_TX_PIN);&lt;BR /&gt;// Diff Driver Mode Pins - Default to OFF on both lines&lt;BR /&gt;Chip_GPIO_SetPinDIROutput( LPC_GPIO, UART1_mTX_EN_PORT, UART1_mTX_EN_PIN);&lt;BR /&gt;Chip_GPIO_SetPinState( LPC_GPIO, UART1_mTX_EN_PORT, UART1_mTX_EN_PIN, FALSE);&lt;/P&gt;&lt;P&gt;Chip_GPIO_SetPinDIROutput( LPC_GPIO, UART1_sTX_EN_PORT, UART1_sTX_EN_PIN);&lt;BR /&gt;Chip_GPIO_SetPinState( LPC_GPIO, UART1_sTX_EN_PORT, UART1_sTX_EN_PIN, FALSE);&lt;/P&gt;&lt;P&gt;// Set RS485 Control to UART1 Full Duplex Master&lt;BR /&gt;// mTX_ENA=1, sTX_ENA=0&lt;BR /&gt;Chip_GPIO_SetPinState( LPC_GPIO, UART1_mTX_EN_PORT, UART1_mTX_EN_PIN, TRUE);&lt;BR /&gt;Chip_GPIO_SetPinState( LPC_GPIO, UART1_sTX_EN_PORT, UART1_sTX_EN_PIN, FALSE);&lt;/P&gt;&lt;P&gt;/* Use main clock rate as base for UART baud rate divider */&lt;BR /&gt;Chip_Clock_SetUARTBaseClockRate(Chip_Clock_GetMainClockRate(), false);&lt;/P&gt;&lt;P&gt;/* Setup UART */&lt;BR /&gt;Chip_UART_Init(DEBUG_UART);&lt;BR /&gt;Chip_UART_ConfigData(DEBUG_UART, UART_CFG_DATALEN_8 | UART_CFG_PARITY_NONE | UART_CFG_STOPLEN_1);&lt;/P&gt;&lt;P&gt;uint32_t actual_baud;&lt;BR /&gt;static volatile uint32_t baseClockRate;&lt;BR /&gt;baseClockRate = Chip_Clock_SetUARTBaseClockRate(921600*16, 1);&lt;BR /&gt;Chip_UART_SetBaud(LPC_USART1, DEBUG_BAUDRATE);&lt;BR /&gt;//baud rate = U_PCLK/16 x BRGVAL&lt;BR /&gt;actual_baud = baseClockRate/ ((LPC_USART1-&amp;gt;BRG+1) * 16);&lt;BR /&gt;//return actualRate;&lt;/P&gt;&lt;P&gt;Chip_UART_Enable(DEBUG_UART);&lt;BR /&gt;Chip_UART_TXEnable(DEBUG_UART);&lt;/P&gt;&lt;P&gt;float baud_error = (((float)actual_baud / (float)DEBUG_BAUDRATE)-1) *100;&lt;BR /&gt;DEBUGSTR("\r\n*********************************************\r\nDebug Start\r\nPress 'h' for help.\r\n");&lt;BR /&gt;DEBUGOUT("Debug BaudRate = Ideal: %04d, Actual: %04d, Error: %.2f%% \r\n*********************************************\r\n", DEBUG_BAUDRATE, actual_baud,baud_error );&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Any help or pointers to the right direction would be greatly appreciated&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2020 15:16:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/UART-TX-misteriously-stops-working/m-p/1198154#M43236</guid>
      <dc:creator>adamhimer</dc:creator>
      <dc:date>2020-12-11T15:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: UART TX misteriously stops working</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/UART-TX-misteriously-stops-working/m-p/1199928#M43271</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/84714"&gt;@adamhimer&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;The configuration for the UART pins is the same in the application and the bootloader?&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Alexis Andalon&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 22:55:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/UART-TX-misteriously-stops-working/m-p/1199928#M43271</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2020-12-15T22:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: UART TX misteriously stops working</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/UART-TX-misteriously-stops-working/m-p/1200424#M43284</link>
      <description>&lt;P&gt;Hi Alexis,&lt;BR /&gt;&lt;BR /&gt;Yes, exact same functions are called, from the third "board" related project that is referenced by both bootloader and application.&lt;BR /&gt;&lt;BR /&gt;I changed USART1 port to USART2 port on different pins and it is working fine.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 13:13:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/UART-TX-misteriously-stops-working/m-p/1200424#M43284</guid>
      <dc:creator>adamhimer</dc:creator>
      <dc:date>2020-12-16T13:13:39Z</dc:date>
    </item>
  </channel>
</rss>

