2023-08-12 10:09 PM
I tried to periodically send SPI data using PIT timer on SPC572.
but whenever the timer interrupt call the SPI to transmit the data, the MCU freezing. while, when call the SPI transmit from main function, it working fine.
any suggestion to solve this issue? thanks
Solved! Go to Solution.
2023-08-23 01:24 AM
Hello Jmary ,
i recommend to use a debugger (PLS (Windows) or TRACE32 (Windows,Linux))
1) Check where the issue with the Program Counter, R13, R14 with a debugger
2) Check your stack size maybe your stack is too small. (overflow)
Best Regards
Erwan
2023-08-13 12:24 AM
I have the same problem! #SPC563
2023-08-13 02:58 AM
However, if you use DMA for sending and receiving messages, this issue is eliminated. Nevertheless, I still do not know the cause of this happening.
2023-08-13 09:03 AM
the problem, from spc5 RLA LLD library, i can't enable the dma on DSPI module for SPC572 mcu.
would you share the working code for spc56?
2023-08-23 01:24 AM
Hello Jmary ,
i recommend to use a debugger (PLS (Windows) or TRACE32 (Windows,Linux))
1) Check where the issue with the Program Counter, R13, R14 with a debugger
2) Check your stack size maybe your stack is too small. (overflow)
Best Regards
Erwan
2023-08-27 06:42 PM
Yes, seems I found the culprit. I think it because the spi global config if used inside the timer interupt, its like calling another profile, different from the main profile. so when called "spi_lld_exchange(&SPID1, 3, txbuf, rxbuf)", then it wait the transmit forever.
any idea pass the "&SPID1" to the timer interupt event? thanks