cancel
Showing results for 
Search instead for 
Did you mean: 

HPDMA XSPI flash all zeros are written

Artur5
Associate II

Hi. I'm trying to get HPDMA to write to flash memory on the stm32n6570-dk board. I did the DMA configuration exactly like the XSPI_NOR_ReadWhileWrite_DTR example for the STM32H7. The problem is that all zeros are written and I've run out of ideas what's wrong.  The memory is erased before writing. When I replace HAL_XSPI_Transmit_DMA() with HAL_XSPI_Transmit() the data is written. Maybe someone has an idea why all zeros are written?

 

Artur

4 REPLIES 4
KDJEM.1
ST Employee

Hello @Artur5;

 

Could you please give more details about the issue:

Are you using PSRAM or NOR memory?

What is the frequency of XSPI?

Can you write in the memory when using GPDMA?

Could you please use HPDMA channel 12 to 15 with FIFO = 64Bytes.

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi. It's about access to flash memory. I used HPDMA channel 3 and 4. After changing to GPDMA, writing works correctly. I also noticed that for some reason in the code generated by CubeMx for HPDMA there is no interrupt initialization, i.e. HPDMA_init is empty, after adding interrupts, communication seems to work correctly except that only zeros are written.

Artur

All-Zeros?

That's typically an issue where you keep writing at the same address range, and if done enough, with a random stream, it will knock down all cells to Zero.

Watch for the NOR FLASH's  Write Page Buffer size, and issues related to spanning that. I haven't looked at you case, but a lot of Micron and Winbond NOR FLASH has only a 256-byte page buffer, so that's the write limit, even less if you don't start with an address on a 256-byte aligned boundary.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Page Program only 256-bytes, check what template you're using for Memory Mapped Write

https://www.macronix.com/Lists/Datasheet/Attachments/8742/MX66U1G45G,%201.8V,%201Gb,%20v1.4.pdf

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..