This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: TI-RTOS
Hi,
We have a non-bios project based on the F280049 example code. I am trying to move this into a sysbios project. I have made memory adjustments and am able to get sysbios to run with a task that toggles an LED. The next step is to get the SCI-A RX interrupt to trigger. Note, the non-bios code for this works with the F280049C eval board, but now I don't get a Rx interrupt to trigger. I can put a break point on the ISR handler for the SCI-A RX and it doesn't occur (when adjusting for HWI usage).
I have made the following adjustments to utilize the HWI module within SYSBIOS:
1) Enabled HWIs in the .cfg and added the HWI for SCI-A RX.
var Hwi = xdc.useModule('ti.sysbios.family.c28.Hwi'); var ti_sysbios_hal_Hwi = xdc.useModule('ti.sysbios.hal.Hwi'); var hwi0Params = new Hwi.Params(); hwi0Params.instance.name = "SCI_A_RX_ISR"; hwi0Params.enableInt = true; hwi0Params.enableAck = true; Program.global.SCI_A_RX_ISR = Hwi.create(96, "&sciARxISR", hwi0Params);
2) Adjusted the SCI initialization code. Note, this is an 'unrolled' version of our abstracted code:
// Disable global interrupts. DINT; // Plug the interrupt vector 96 with the ISR function Hwi_plug(96, (Hwi_PlugFuncPtr)rxHandler); // Disable Group 9 , interrupt 1 in PIE Hwi_disablePIEIER(9, 0x0001); SCI_disableFIFO(SCIA_BASE); SCI_performSoftwareReset(SCIA_BASE); // Set initial configuration of the SCI SCI_setConfig(SCIA_BASE, LSPCLK_FREQUENCY, 38400,(SCI_CONFIG_WLEN_8 | SCI_CONFIG_STOP_ONE | SCI_CONFIG_PAR_NONE)); SCI_resetChannels(SCIA_BASE); SCI_clearInterruptStatus(SCIA_BASE, SCI_INT_TXFF | SCI_INT_RXFF); SCI_enableFIFO(SCIA_BASE); SCI_enableModule(SCIA_BASE); SCI_performSoftwareReset(SCIA_BASE); // Set the transmit FIFO level to 0 such that characters will be sent immediately // Set the receive FIFO level to 1 such that a single character in the FIFO will flag the interrupt SCI_setFIFOInterruptLevel(SCIA_BASE, SCI_FIFO_TX0, SCI_FIFO_RX1); // Enable the TXRDY and RXRDY interrupts. SCI_enableInterrupt(SCIA_BASE, SCI_INT_TXFF | SCI_INT_RXFF); // Clear the SCI interrupts before enabling them in the PIE. SCI_clearInterruptStatus(SCIA_BASE, SCI_INT_TXFF | SCI_INT_RXFF); // Enable Group 9 , interrupt 1 in PIE Hwi_enablePIEIER(9, 0x0001); Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP9); // Enable global interrupts. EINT;
3) The main.c looks very minimal at the moment.
uint32_t main() { InitPeripheralClocks(); // Initialize GPIO initializeAllGPIO(); // Initialize SCI A initializeSci(); // Start the BIOS BIOS_start(); /* does not return */ return(0); }
Thank you, Manoj,
I'll provide some more information for when the SYSBIOS expert is able to look into this.
For reference, I am using Code Composer Studio Version: 8.1.0.00011
The project is set to use the TI compiler v18.1.2.LTS and includes SYS/BIOS v6.73.0.12 using XDCtools version 3.59.7.20_core
Regards,
-Wes
Hi Whitney,
The rxHandler is a pointer to the sciARxISR. I just forgot to update the 'unrolled' code here, but I was able to get an interrupt today due to this same code when I removed the Hwi_plug line. Apparently, in my test code I had a logical issue. Unfortunately, I am only able to get the single interrupt which occurs without triggering it via my external connection. After that, I can't trigger it again. Once I am able to analyze the information from the system and SCI registers on the current interrupt, I'll update this post.
Thanks!
-Wes
Hi Whitney,
Within the ISR, I added/modified the error check since my logic was a little off, but I'm still seeing continuous interrupts with the SCIRXBUF = 0x8000 indicating the framing error.
I changed the ISR to utilize the following code which checks for the framing error (via the bufferError which is set when the SCIRXBUF is greater than 0xFF which includes the framing and parity error flags)
if ((settings->registers->SCIRXST.bit.RXERROR != 0) || (currentRxBytes >= MAXIMUM_INTERRUPT_INCOMING_BYTE) || (bufferError == true)) { SCI_resetRxFIFO(settings->hardwareAddress); SCI_performSoftwareReset(settings->hardwareAddress); }
I haven't been able to find one, but do you know if there is an example project that uses SYSBIOS with the F280049 processor and the SCI module?
-Wes
Hi Whitney,
Thanks! That was it. I apparently misconfigured the clock settings. The timing appeared to be okay on my board (i.e. correct SYS clock setting) but I didn't have the LSPCLK set correctly.
-Wes