cancel
Showing results for 
Search instead for 
Did you mean: 

Support with fmc nand flash

HDesa.1
Senior

Hello,

I am running a NAND flash with STM32H7 microcontroller using FMC interface. I have referred to Using the high-density STM32F30xxD/E FMC peripheral to drive external memories datasheet for the programming purpose.

While communicating with the device, I observed that whenever I read the device for the first time I get the desired data. But when I try to access it once again using different command the data section doesn't update. I read the old read data. For example,

If I send the command to read the id for the first time then the ID is properly read. But then when I send the command to read the status register then the old data doesn't get updated.

I even tried to reset the device before each command but the device read register doesn't update. Can you help me with this? What could be the problem?

-Regards

-Regards
Hrishikesh
15 REPLIES 15

You'll have to read the documentation more thoroughly and use a logic analyzer on the signals to ensure your understanding matches the signaling presented in reality. 

Perhaps look at EVAL board doing the same or similar.

For storage consider eMMC. 

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

Hello,

Most probably it's due to the cache. What if you disable it? or just configure the MPU on that region: Strongly Ordered/Or Device?

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.

Sorry, I didn't get you exactly. Which parameter are you referring to? Can you please specify with reference to CubeIDE?

-Regards
Hrishikesh

In CubeMx. All is in Cortex_M7 menu:

SofLit_0-1719832002835.png

 

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.

Caching at an address level look at ConfigMPU() code examples. Not really expecting the NAND region to be cached/cacheable,

Not much in the way of part# and code to see what might be going astray..

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

As MPU example 

void MPU_Config(void)
{
  MPU_Region_InitTypeDef MPU_InitStruct;
  
  /* Disable the MPU */
  HAL_MPU_Disable();

  /* Configure the MPU as Strongly ordered for not defined regions */
  MPU_InitStruct.Enable = MPU_REGION_ENABLE;
  MPU_InitStruct.BaseAddress = <Put your start address of the memory>;
  MPU_InitStruct.Size = <Put your region size>;
  MPU_InitStruct.AccessPermission = MPU_REGION_NO_ACCESS;
  MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;
  MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE;
  MPU_InitStruct.IsShareable = MPU_ACCESS_SHAREABLE;
  MPU_InitStruct.Number = MPU_REGION_NUMBER0;
  MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;
  MPU_InitStruct.SubRegionDisable = 0x0;
  MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_DISABLE;

  HAL_MPU_ConfigRegion(&MPU_InitStruct);

  /* Enable the MPU */
  HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);
}

You need to fill in:

MPU_InitStruct.BaseAddress = <Put your start address of the memory>;
MPU_InitStruct.Size = <Put your region size>;

 

 

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.

OK Thank you for the suggestion. I will implement this.

-Regards
Hrishikesh

Yes, I too am not sure how NAND region is going to be affected by caching but can check if this can fix my problem.

-Regards
Hrishikesh

Hi,

The method suggested by you didn't work. Is there any other which I should look for?

-Regards

-Regards
Hrishikesh