cancel
Showing results for 
Search instead for 
Did you mean: 

How to use DDR on STM32MP135F-DK without using DDR_init example?

stephenk
Associate

Good Morning, 

I don't know if anyone can help me or if this is right place to ask this question but I am having an issue when initializing the DDR on the STM32MP135F-DK board. I know the official advice is to run the DDR_init example prior to each run of my application. However for my final deployment of the code and for my ease of use id rather only have to build and run one program that initializes the DDR and then moves onto my program. I have tried dissecting the DDR_init example to no real luck. Especially around systemclock_config as in the DDR_init example the systemclock_config() only executes this if USE_DDR is not declared, yet the advice on the getting started with the stm32mpu lines states that for DDR use this must be added to the .cproject file. Has any one had any experience getting this working or know of any resources that might help?

 

Many thanks, 

Stephen Kelleher 

1 REPLY 1
shivam203
ST Employee

 

Hi @stephenk,

According to the official documentation, you need to first initialize the DDR using the DDR_Init example before running the desired application example.

However, if you want to execute both steps in one go, you can utilize the SD-BOOT mode.

For this, you will primarily need two applications:

  1. Primary Application: FSBLA (available in the applications folder of the STM32MP135C-DK).
  2. Secondary Application: The application you intend to run on DDR.

The detailed process is explained in this guide: How to load and start STM32CubeMP13 applications via microSD card - stm32mpu.

"Regarding the systemclock_config() function, it only executes if USE_DDR is not declared. However, the "Getting Started with STM32MPU" guide recommends adding USE_DDR to the .cproject file for DDR usage".

It is important to note that you do not need to include USE_DDR in the DDR_Init example, as this example is executed on SYSRAM, not DDR. Instead, USE_DDR should be added to the .cproject file of the application you want to run on DDR because the clock is already initialized by DDR_Init example and if you do not use USE_DDR , it will reset the clock and the project will throw error.

For verification, you can check the linker files (.ld). The linker file for the DDR_Init example is configured for SYSRAM.

(You can also consider using an OPENOCD script. This script can be created to initialize the DDR and executed when debugging the application. However, please note that I have not personally tested this approach.)


Let me know if you need further clarification!