I.MX RT1061 Writing flexspi flash through edma wrongly

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I.MX RT1061 Writing flexspi flash through edma wrongly

1,008 Views
coolxin
Contributor I
  1. Is there a example code of I.MX RT1061 FlexSPI using edma? The manual is simple. I'cant figure out the methods.
  2. I try to set watermark to 0, debug a few times and finally program the flash by edma. But there are 64 bits correct data with 64 bits 0 in the flash.The total length is correct.  How come the 64 bits 0?

Thanks!

Labels (1)
0 Kudos
5 Replies

836 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello, 

a. Unfortunately, we don't have any example projects that demonstrate how to write to the FlexSPI flash using edma. I apologize for the inconvenience that this might cause you. 

b. Just to be sure I understood correctly this question, you write 64 bits to the memory, this is done correctly but the next 64 bits are written to 0, is my understanding correct? What were the values of these 64 bits before this happened? 

Regards,

Victor 

0 Kudos

836 Views
grimmjjow
Contributor I

Hi, Victor

     Thank you for your answer!I‘m on a project with 莫 郑 . My source data locates in DTCM. It looks like :0x1111,0x2222,...,0x8888,0x9999,0x1111,0x2222...   The destination address in flexspi nor flash has been erased done. The watermark level of IPTXFCR is 0, so I set EDMA Minor Loop count to 8 bytes. The transfer data size is 100 bytes. Then set the IPCMD TRG and IPTXFCR TXDMAEN. The edma interrupt handler can be executed correctly. After IP Write command, I read the data from destination address in flexspi flash. The data which is actually written to flash is shown in the following figure(Please ignore the first 6 bytes). As I change the watermark level in IPTXFCR(so the EDMA Minor Loop count), the correct data length and the zero length are always same with it (I tried 8 bytes, 16 bytes, 24 bytes). But we can see that the total length which be written to flash is correct. And the 9th byte to the 16th byte in source address can also be written to flash. They are not skiped.

      So why there is a watermark level lenth 0 bytes which be written to flexspi flash? If you need any other information, Please let me know~

EDMA IP wrtie.jpg

Kind regards,

Liu

0 Kudos

836 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hi Liu, 

I want to confirm that I understood correctly the behavior that you are facing. Based on the image that you shared my understanding is that it doesn't matter if you change the EDMA Minor Loop count you always have the same length of zeros and data, is this correct? 

Regards, 

Victor 

0 Kudos

836 Views
grimmjjow
Contributor I

Hi Victor,

Yes, if I set IPTXFCR(TXWMRK) to 0, it will always have 8 bytes zero and data. No matter what the EDMA Minor Loop count is. If I set  IPTXFCR(TXWMRK) to 1, and the EDMA Minor Loop count is at least 16 bytes. It will have 16 bytes zero and data.

Kind regards,

Liu

0 Kudos

836 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hi Liu, 

Thanks for confirming that my understanding was correct. As specified in the RM in section 27.5.9.2, when the TX FIFO is filled by the DMA you need to set the DMA transfer Minor loop size to the same watermark level that you set in the IPTXFCR[TXWMRK]. 

pastedImage_1.png

Regards, 

Victor 

0 Kudos