Other Parts Discussed in Thread: HALCOGEN
Hi all,
I am working with the development board Launchxk2-570lc43. Configure HalCoGen for use with freertos. Then, in the main code, I create two tasks, one to read the adc and the other to read the sci. In the configuration enable the SCI3 read interrupt, and its corresponding enablement in the VIM. The problem is that the interrupt is not working. That is, in the call to sci3HighLevelInterrupt I put a breakpoint while debugging it but it never enters.
Therefore, it never enters the sciNotification function that I implement in my code:
int main(void) { /* USER CODE BEGIN (3) */ hardwareInit(); /* create a queue and semaphore to collect a line and flag the end of it */ g_uartQ = xQueueCreate(32, sizeof(char)); vSemaphoreCreateBinary(flagEOL); /* Create Task 1 */ if (xTaskCreate(prvTaskADCRead,"TaskADCRead", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY+1, &xTask1Handle) != pdTRUE) { /* Task could not be created */ while(1); } if (xTaskCreate(prvTaskCMD,"TaskCMD", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY+2, &xTask2Handle) != pdTRUE) { while(1); } vTaskStartScheduler(); /* USER CODE END */ return 0; }
Function hardwareInit:
static void hardwareInit(void) { /* Se inicializan las 4 uart: SCI1, SCI2, SCI3 y SCI4. SCI SCI data Format Baudarate: 115200 Stop bit: 2 Length: 8 */ _enable_interrupt_(); sciInit(); }
And sciNotification:
void sciNotification(sciBASE_t *sci, uint32 flags) { static uint8 c; /* get the byte out of the interrupt register */ sciReceive(sci, 1, &c); /* put the byte in a queue */ if (xQueueSendFromISR(g_uartQ, &c, 0)) { /* success */ } else { /* queue send fail: probably full */ } /* flag the End of the Line */ if (c == '\r') { xSemaphoreGiveFromISR(flagEOL, NULL); } else { sciSend(sci, 1, &c); } return; }
Below are the screenshots of the HalCoGen :
Please if you can tell me what I'm doing wrong?
Thanks in advance.
Regards,
Pablo Llull