Hi @kerryzhou,
Thank you for your response. I have tried disabling the debug memory cache, but the issues remain. Below is the debug log I got. I put a breakpoint in the PWM interrupt handler and continued the code until it crashed.
Program stopped.
PWM3_0_IRQHandler () at ../source/mcmgr_core0.c:485
485 GPIO_PinWrite(GPIO7, 8U, 1);
Temporary breakpoint 2, main () at ../source/mcmgr_core0.c:189
189 {
Breakpoint 1, PWM3_0_IRQHandler () at ../source/mcmgr_core0.c:485
485 GPIO_PinWrite(GPIO7, 8U, 1);
Breakpoint 1, PWM3_0_IRQHandler () at ../source/mcmgr_core0.c:485
485 GPIO_PinWrite(GPIO7, 8U, 1);
Breakpoint 1, PWM3_0_IRQHandler () at ../source/mcmgr_core0.c:485
485 GPIO_PinWrite(GPIO7, 8U, 1);
Breakpoint 1, PWM3_0_IRQHandler () at ../source/mcmgr_core0.c:485
485 GPIO_PinWrite(GPIO7, 8U, 1);
Breakpoint 1, PWM3_0_IRQHandler () at ../source/mcmgr_core0.c:485
485 GPIO_PinWrite(GPIO7, 8U, 1);
Breakpoint 1, PWM3_0_IRQHandler () at ../source/mcmgr_core0.c:485
485 GPIO_PinWrite(GPIO7, 8U, 1);
/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/src/gdb/gdb/utils.c:671: internal-error: virtual memory exhausted: can't allocate 4064 bytes.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]
This is a bug, please report it. For instructions, see:
<https://www.gnu.org/software/gdb/bugs/>.
/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/src/gdb/gdb/utils.c:671: internal-error: virtual memory exhausted: can't allocate 4064 bytes.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) [answered Y; input not from terminal]
As you can see, the PWM interrupt handler ran a couple of times before it crashed. The number of times the interrupt handler runs before crashing is different each time. I find the "virtual memory exhausted" error interesting. Could that be the cause of the problem?
To further investigate the issue, I created a new multicore project and implemented the half-duplex communication on its own, to see if I would run into the same problem. The same problem indeed occurred. I found that the debugging issue was fixed when I lowered the baud rate of the LPSPI module from 16MHz to 10MHz, but doing the same thing in my original project did not help. Could the issue be caused by too much data being read and the debugger not being able to keep up?
I have attached the test project. Perhaps you see the issue? I have had to make some small modifications to the fsl_lpspi.c file to get the half-duplex communication to work. Perhaps I made a mistake somewhere? The project was too large to send as a single zip file, so I split it up into three.
Thank you for your help,
Kind regards,
@CWRB