EVK IMXRT1176 SDRAM(heap and data usage with DCD) and NAND Flash

cancel
Showing results for 
Search instead for 
Did you mean: 

EVK IMXRT1176 SDRAM(heap and data usage with DCD) and NAND Flash

187 Views
ahmedhrabi
Contributor III

Hello, 

Can someone tell me if it is possible to use the SDRAM and the NAND Flash simultaneously on the EVK IMXRT1176 as below: 

  • SDRAM initialized with DCD
  • Heap section resides in the SDRAM
  • NAND flash initialized in main with SEMC and used to store some data.

I tried to do that on the SDK project "evkmimxrt1170_nand_flash_management_cm7" by moving heap  to SDRAM but Nand Flash read operation crash when trying to malloc memory (SDK_Malloc).

Regards.

0 Kudos
8 Replies

129 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello
I Hope you are well.

It is possible to have multiple memories in your application but they need to accessed at different times. You cannot use SDRAM while NAND is being used.

Additionally, if SDRAM is used to execute code it is important to make sure that NAND is not used while the code is being executed.

If you have more questions do not hesitate to ask me.
Best regards,
Omar

0 Kudos

122 Views
ahmedhrabi
Contributor III

Hello @Omar_Anguiano , 

Thanks for your reply. Well i just inhibited the semc_init function and it works fine. 

My application is executed on Qspi Flash with XIP and SDRAM is used to place heap as mentioned in the main question.

Well i'm facing another problem that is easy to reproduce : 

Placing Stack and global data on SDRAM are making troubles. (However placing only heap on sdram works as charm). 

Here is the steps to reproduce the problem: 

  • In the SDK project "evkmimxrt1170_nand_flash_management_cm7" i added the flag XIP_BOOT_HEADER_DCD_ENABLE=1 for using DCD init for SDRAM.
  • I commented the line that reinitialize semc (SEMC_Init(SEMC, &config);) for not losing SDRAM ROM config.
  • I placed Stack heap and global data on SDRAM : ahmedhrabi_0-1668612182454.png
  • And then all the application goes wrong. 

As i mentioned below adding only heap to sdram works for me.

Regards.

 

0 Kudos

84 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Thank you for your additional information.
To place these sections on SDRAM it is needed to make sure that SDRAM is enabled at first, you can do this with DCD. Also, it is needed to disable the cache: heap and the stack on the SDRAM on MIMXRT1064 Eval... - NXP Community

Best regards,
Omar

0 Kudos

72 Views
ahmedhrabi
Contributor III
That do not seems to have any effect the problem is always here.

Regards.
0 Kudos

52 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Checking this it seems that when using the NAND in the SEMC SDRAM enters a conflict. When you try to add stack and heap to SDRAM to a project which do not uses SEMC is the issue still present?

Best regards,
Omar

0 Kudos

50 Views
ahmedhrabi
Contributor III

@Omar_Anguiano

No when i try to add stack and heap to SDRAM to a project which do not uses SEMC there is no issues.

Regards.

0 Kudos

41 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Thank you!
Please add a higher priority to the SDRAM access through the BMCRx registers.
This is used to balance external memory access efficiency, urgency, and latency based on your requirements.

Best regards,
Omar

35 Views
ahmedhrabi
Contributor III

Thank you for you reply,

Can you please give more informations about how to give the SDRAM higher priority.

Actually my BMCRx (0 and 1) registers are configured with 0x81 value.

I don't see how to set a Queue A or B priority in function of the support access (SDRAM, NAND Flash or other). 

There's just the Score of the Queue that gives more or less priority to the operations but that don't depend on the access area am i right?

ahmedhrabi_0-1670244136347.png

Regards,

HRABI.

0 Kudos