Hello everybody,
I'm working with TWR-VF65GS10 and trying to run an M4 MQX application while my main application runs on A5 core.
If I run them separately, they go fine.
When I try to run them together, the A5 application stops when the M4 is started.
I went setp to step and found out that A5 crashes when M4 DMA is started:
module: C:\Freescale\Freescale_MQX_4_1\mqx\source\io\dma\edma.c
routine: static int edma_reset_module(int edma_module)
line of the M4 initialization that crashes the other core (A5):
/* Halt, cancel transfer and wait until transfer is canceled */ | |
DMA_CR_REG(edma_base) = DMA_CR_CX_MASK | DMA_CR_HALT_MASK; |
I'm using MQX in both cores; IAR with I-Jet or J-Link.
thank you,
已解决! 转到解答。
Hi Sandro,
It is MQX bug - it will be fixed in 4.1.1.
The fast and dirty fix is disable DMA for one core and remove DMA initialization (function dma_init) from BSP initialization code (from _bsp_init function).
Regards,
Jozef
I’ve disabled the DMA for SPI0 in ‘twrvf65gs10_a5.h’ and it’s now working.
Do you think it’s a MQX bug?
I don’t know if it’s a good solution, but at least I can go further with the project.
/*
** Use DMA transfers on SPI0
** MGCT: <option type="bool"/>
*/
#ifndef BSPCFG_DSPI0_USE_DMA
#define BSPCFG_DSPI0_USE_DMA 0 //??
#endif
Best regards,
Hi Sandro,
It is MQX bug - it will be fixed in 4.1.1.
The fast and dirty fix is disable DMA for one core and remove DMA initialization (function dma_init) from BSP initialization code (from _bsp_init function).
Regards,
Jozef
Hi Jozef / Alejandro,
Bug fixed at MQX 4.1.1. both cores are working with full DMA.
Thank you,
Hi Jozef,
Thank you for your help. I had already disabled the DMA for SPI on A5. Now I turned it on again and disabled the entire DMA for M4.
/** Initialization - called from init task, usually for io initialization.
*/
int _bsp_init(void) {
uint32_t result;
/* Initialize DMA */
/*??
result = dma_init(_bsp_dma_devif_list);
if (result != MQX_OK) {
return result;
}
*/
I'll wait for MQX 4.1.1.
best regards,
Sandro,
Dear Alejandro,
As a matter of fact, the A5 doesn't crash. What really happens is that my task that updates the LCD though SPI is blocked.
It happens at the exact moment that the first byte is sent to LCD, after M4 has been started:
/* Write instruction, address and data to buffer */ | |
result = fputc((int)data, spifd); |
If you need anyother part of my code, or some dump, please tell me.
thank you,
Hi Alejandro,
Thanks for your attention.
I created two very simple MQX applications, one for A5 and another for the M4 and they work well together.
If I put my original full A5 project the problem comes back so I'll debug it a little bit more to find out what module or task is blame for this issue.
As soon I have more information I post here.
Thank you and best regards...