Hello NXP Team, I installed the MPC5777C_MCAL4_0_RTM_1_0_1 package from the NXP Web site, but I have a problem using async SPI with DMA, I set my first channel with 1 byte, my data is coming out. I set my 2nd channel with 4 bytes, but only 1 byte is output and the output data is the last data of my 2nd channel, the data of the next channels are not output. In short, the communication does not work properly when I use it with asynchronous spi dma. I shared my relevant codes and EB tresos configuration files in the zip file.
Solved! Go to Solution.
Hello, I activated IGF for the relevant ICU pin and the interrupt started to appear, In the sample project you sent, IGF is configured for the relevant ICU pin. but I could not fully understand why. Thank you very much for your help.
Hi Macar,
This is information that I found in RM about this:
You can find more detail in chapter 39.
This is also note for me in this platform.
Anyway, I'm glad that you can manage this issue.
Best regards,
Nhi
Hi Macar,
I attached an example for async mode transmit.
To have more information about this mode, you can refer to the chapter 5.3 of AUTOSAR_MCAL_MCAL_IM.pdf in package.
I have some notes follow my example:
Install interrupt:
In the file Vector_vle_mcal.s:
To configure Mcl Dma Transfer Completion User Notification, you can refer to chapter 5.4 of IM:
So, to transmit multiple channels in a job and a sequence as your example, driver will follow above diagram. Trigger to transmit data in first channel, data transmitted from tx channel DMA, because TxDMA channel link to Rx DMA channel, so
Best regards,
Nhi
Hello,
I made all the details as in the photo you send and I see it as you see it, but I send 3 bytes of data in the 1st channel I set, only 1 byte of data is output. The data that comes out is the last data I sent in the channel. Since 3 bytes in the 1st channel are not output, no data of the 2nd channel is output either.Can you help ?
Thanks.
I can't reach your tresos settings, it gives xlm error, can you take screenshots?
Thanks Nhi.
Hi Macar,
As I said before, each time we can go into the interrupt function ISR(MCL_DMA_CH_13_ISR) => It means TX linked to RX and have data received at Rx already and in this function interrupt handler, we will continue to handle to the next channel in the remaining channels that were configured in job to transmit but not transmitted yet.
So you can go into this function Spi_Dspi_IsrDmaRx()
So, how much times did you go into this function?
In my example that attached in previous reply, I could go into 4 times for 4 channels configured in that job.
Best regards,
Nhi
hello thank you very much for your support i checked your answer and i will try to fix my code, actually i have problem similar to this interrupt problem. I configured the ICU driver and I call the necessary APIs, but I can't get interrupts, no interrupts. I connected my EMIOS_CH_0 PWM channel to my EMIOS_CH_6 ICU channel with a jumper, but the interrupt does not come
note: I can see the pwm signal in emios_ch_0.
Hi Macar,
I just run an example that was attached in the package MPC5777C_MCAL4_0_RTM_1_0_1 and I also leave it here. It is same your scenario. You can try to run it.
From my site, I can see interrupt flag of Icu_Emios raise and go into the function interrupt handler as below:
I think you can try to set priority for interrupts that you want to use, because default is 0 that has lowest priority as below:
And register interrupt address (the function) MCU will go into when interrupt flag raised. For example:
You can find all of them in this example that was attached in this post.
Best regards,
Nhi
I increased the interrupt priority but still no interrupt
Hi Macar,
Did you see this bit raised or not?
If it raised as above image, Icu catched input signal already. Then, you will need to check software handler that assigned to this interrupt. It is corresponding to case 2 in my previous reply:
Each IRQ has a register to save the function handler address as description below:
It means you need to create a vector table and assign interrupt handlers to them. This will be done in startup. For example:
vector table defined in the file: Vector_vle_mcal.s
Memory for this area that was defined in the file: autosar_flash
Load them to write to register in the file: Startup_vle
Anyway, I attached an example in the previous repply. You can refer to it.
Best regards,
Nhi
Hi, I already have vector table and startup codes, and I have successfully used a different emios channel and interrupt for the GPTdriver. but I can't use it for ic.
meanwhile no interrupt occurs
As far as I understand, the problem is the installation of interrupt is not vector table vs. emios cannot create interrupt, it does not see the pwm signal and the flag is not raised.,Could the problem be that the OVFL bit is always 1?
Hi Macar,
As you said that you had output signal from PWM. You ensure that interrupt configured correctly. But condition to raise interrupt is FLAG bit raised.
This bit raised when input signal is exist. So, you checked has data in this signal? You can check this through register that configure Port is input for mode EMIOS23_IN and the path from PWM to ICU is not broken.
Did you check pending interrupt? through this register
When I looked at your register, bit 20 of the register UC, it is 1.
but follow RM, this bit have to be 0.
So, you also check the board that you're using to test.
About the bit OVFL, this bit raised for every time internal counter is overflow.
It is one of parameters that used to calculate period of input signal and don't raise interrupt. So, it is not affect to your case.
Anyway, did you try to run example that attached in previous reply? and compare with your project. You can just use configuration in my project to replace in your project, to limit range of where the issue can come from.
Best regards,
Nhi
Hello, I activated IGF for the relevant ICU pin and the interrupt started to appear, In the sample project you sent, IGF is configured for the relevant ICU pin. but I could not fully understand why. Thank you very much for your help.