Other Parts Discussed in Thread: SYSCONFIG
Tool/software:
The following code stops transmitting after some time, I have tried to solve the problem but have been unable to. Need help regarding this.
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:
The following code stops transmitting after some time, I have tried to solve the problem but have been unable to. Need help regarding this.
Hi Dheeraj,
I would start by updating the software you are using to the latest CCS, M0SDK, and SYSCONFIG. If that doesn't help, I recommend tracking down where specifically your code gets stuck.
Best Regards,
Diego Abad
What are
1) Your Timer_0 period?
2) Your UART bit-rate?
Your timer period should be fairly long (maybe 500ms) to accommodate all those printf() calls. You should not call printf() in an ISR (though sometimes it sort of works).
-------------------
> printf("UART IRQ: %d\n", DL_UART_Main_getPendingInterrupt(UART_0_INST)); // Debug log
> switch (DL_UART_Main_getPendingInterrupt(UART_0_INST)) {
Reading the IIDX register clears the interrupt, so if you call it twice you'll (in general) get different results. In this sequence you throw away the first interrupt -- in this case the DMA_DONE -- so your UART_Console_write function will never complete. Try instead something like:
> uint32_t IIDX = DL_UART_Main_getPendingInterrupt(UART_0_INST);
> printf("UART IRQ: %d\n", IIDX); // Debug log
> switch (IIDX) {
-------------------
When I set UART0 for 9600bps, the timer period to 500ms, and made the change above, it works fine for me (~10 minutes so far).
Hi Dheeraj,
Let me know if you need further help in this thread.
Best Regards,
Diego Abad