Transmit SPI data from timer interrupt, the mcu become freeze
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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.
- Labels:
-
SPC5 Automotive MCUs
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-23 1: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-13 12:24 AM
I have the same problem! #SPC563
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-13 2: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-13 9: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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-23 1: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-27 6: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
