I'm working on a StarterWare application using several different UARTS. Currently I'm using the uartStdio library (on UART0) for printing out messages and debugging and I'm trying to use UART5 for another interface. My program seems to be running fine reading UART5 and sending data out on UART5, but once I call UARTModuleReset on UART5 during initialization, I no longer get any of the messages I'm sending to the console (UART0). Anyone have any suggestions for tracking that down?
The behavior you are mentioning of is indeed strange. Any operation on one UART instance should not affect the other UART instances.
• I understand from your statements that before you called UARTModuleReset() API for UART5, both UART5 and UART0 worked successfully side-by-side. What was the need to reset UART5 instance at this point of time?
• How are you using the UART5 instance on Beaglebone board? Can you describe you hardware setup in brief?
Please share any other information which you feel worth sharing and that which will be helpful for us to understand your setup and software better.
Thanks and Regards.
Turns out my diagnosis was way off base. The error is a problem accessing the SYSC registers for the UART. If I run the following program everything is fine.
unsigned int sysc = SOC_UART_0_REGS + UART_SYSC; HWREG(sysc) |= (UART_SYSC_SOFTRESET);
However, if I try to reset any of the other UARTs (e.g. change SOC_UART_0_REGS -> SOC_UART_5_REGS in the above code) I get some sort of fault and the CPU branches to the address 0x4030fc10.
Any ideas? Thanks.
Okay, so apparently you need to wakeup the UART modules before you can talk to them. Talking to UART0 worked because its clock had already been turned on in the boot code, but all the others were off so they needed initializing. Example code for any other novices out there:
/* Enable clock for UART5 */
regVal = (HWREG(SOC_CM_PER_REGS + CM_PER_UART5_CLKCTRL) & ~(CM_PER_UART5_CLKCTRL_MODULEMODE));
regVal |= CM_PER_UART5_CLKCTRL_MODULEMODE_ENABLE;
HWREG(SOC_CM_PER_REGS + CM_PER_UART5_CLKCTRL) = regVal;
It is glad that you resolved the issue on your own. I would like to add few more points to your discovery.
As you have said, the functional clocks for UART0 are enabled in the Boot code. Thereafter, UART0 would be used for printing some messages on the serial console. Adding to this, we also enable the functional clocks of UART0 in the application. When you used the UART Utility Library, you would essentially have invoked the function UARTStdioInit() before using any other utility functions. This would enable the functional clocks, perform Pin Multiplexing and initialize the UART0 instance. The reason behind enabling UART0 in the application becomes clear when the application is loaded using CCS. The GEL files which does system level configuration does not enable the functional clocks of UART0, unlike the bootloader.
Please revert for any queries.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.