Other Parts Discussed in Thread: SYSBIOS
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); }