Part Number: CC1312R
I am trying to get the UART0 interrupt to trigger on my device with nortos. I am trying to configure it to trigger on RX and RT and my code is as follows.
// Enable the UART peripheral
// Enable UART pins for Rx\Tx
IOCPinTypeUart(UART0_BASE, IOID_19, IOID_18, IOID_UNUSED, IOID_UNUSED);
In another function I do the following.
//Disable UART before changing configuration
// Set the configuration of the UART.
// Clock rate 48 MHz
// 8 Data bits per byte
// 1 Stop Bits
// 0 Parity
UARTConfigSetExpClk(UART0_BASE, GET_MCU_CLOCK, 115200, UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE);
// Enables the transmit and receive FIFOs.
// Disable hardware flow control for both CTS and RTS
// Set interrupt levels for TX FIFO and RX FIFO
UARTFIFOLevelSet(UART0_BASE, UART_FIFO_TX1_8, UART_FIFO_RX1_8);
// Enables the interrupt for UART0 for RX
UARTIntEnable(UART0_BASE, UART_INT_RT | UART_INT_RX);
// Registers the INTRX_DEBUG_IRQHandler function to be called after interrupt
// Enable the UART
So the RX and TX of the UART work correctly and I am able to communicate through it, but the interrupt handler INTRX_DEBUG_IRQHandler never triggers. I tried calling IntPendGet(INT_UART0_COMB) and it returns true.
Is there a reason you're using driverlib instead of TI Drivers?
With TI Drivers you could use UART_MODE_CALLBACK and it will trigger interrupt on UART TX and RX. You will find some example in SDK docs: file:///C:/ti/simplelink_cc2640r2_sdk_1_40_00_45/docs/tidrivers/doxygen/html/_u_a_r_t_c_c26_x_x_8h.html
We are glad that we were able to resolve this issue, and will now proceed to close this thread.
If you have further questions related to this thread, you may click "Ask a related question" below. The newly created question will be automatically linked to this question.
In reply to Alexis Crandall20:
We have a base application that we are using for different processors and want to make minimal changes to it across the different designs. We want to be able to control registers an such directly through the code as well and thus have chosen to go with driverlib rather than the TI drivers.
Is there some method or call that I am missing in order to set up the interrupt? This issue is not specific to UARTs. I can't seem to be able to set up any interrupts such as GPIO.
In reply to Edward Lee4:
I can see that when I send data over the UART, the UART0_COMB flag in NVIC_ISPR0.SETPEND5 is set. I am not sure why this is never addressed by the CPU.I have tried to see if something else is blocking the interrupt from being called, but I have not made much progress in that regard.
I have also noticed that interrupt 26 is raised. The FLASH controller error event. I'm assuming that this is the reason the interrupts are never triggered. But I am unsure as to how to fix this issue.
I believe this issue is already receiving support on another thread posted by the FAE: https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz/f/156/t/854840. I'll go ahead and close this one and continue support on the other thread as to avoid duplicates.
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. 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.