I am working on a K22FN512 MCU and implemented a program that reads from on uSD Card using FATFS(SPI) and send data to the I2S Channel of the microcontroller through one DMA Chanel. Firmware also use malloc functions 2xADC and I2C.
During the development of the code and the initial tests I got no problem at all, but after some hours of continues working that vary from 8 to 48 I get some problems I try to identify.
In order to catch my problem in my firmware I have set 16 levers of errors so if something goes wrong I ll be there to catch it. For Example I refer to some of them, f_mount, f_read , SAI-DMA Transfer, SAI-DMA Transfer Timout, Malloc Error etc.
Except this method I have also use a system that will pause my execution of code and record the problem according the ARM registers I found around the community.
Also I set the program under Debug session on the mcu in order to catch the problem.
Unfortunately the next day I found out that the debug session had been paused?? and the IDE (KDS 3.0.0) it was stacked in the state showing in th attach file (v1.png).
I am afraid that even the problem with the debug solve the undifiented problem will reamain so I would like to here a second opinion on what could probably create the problem of stop execution after several time in a firmware tha handle so much peripherals.
Let me add some extra information about the current debug made result I found.
After the Debug had paused at 0xffffffff imidietly I captures several suspicious point of my code in order to get a more clear vie of it. So in the Images attached we can found all this state when the problem came out.
The most impresive in that phase is that most of the ARM's register are loaded with 0xffff value.
Furthermore, surprisingly I was able to to continue my execution and I found out that the next lines of code that the system execute were inside the my Error Function demostrating the error 16 that meens SAI-DMA Transfer Timout. you can see all the error list from the attached excel.