cancel
Showing results for 
Search instead for 
Did you mean: 

Read FMC NAND with MCE

RicSch
Associate

On our STM32H7S7I8 we have the MCE interface working on XSPI1 and XSPI2

MCE3 should be connected to the FMC interface, we run a NAND flash on this peripheral. We also want to encrypt the data on this device. There is communication with this device using the provided hal library.

 

In the documentation, it is stated that either Memory Mapped / DMA needs to be used for reading / writing when using MCE. In the HAL device there is no DMA interface for NAND flash (stm32h7rsxx_hal_nand.h). When implementing my DMA functions I can successfully read / write data.

When I enable the MCE I can still perform read / write requests however:

When I write the data this doesn't seems to get encrypted.

When I read the data this seems to be decrypted, and when I disable MCE the original data is retrieved

 

WriteBuffToNAND( a ) // using DMA
ReadNANDToBuff ( b ) // using DMA
// a == b
EnableMCE()
WriteBuffToNAND( a ) // using DMA
ReadNANDToBuff ( b ) // using DMA

DisableMCE();

ReadNANDToBuff ( c ) // using DMA
// a != b
// a == c

 

There's no example code for using MCE on FMC NAND. Are there settings that needs to be enabled to get it working on NAND? Is the MCE3 device only for the FMC SRAM (stm32h7rsxx_hal_sram.h) interface?

0 REPLIES 0