2024-08-09 02:33 PM
I am trying to wire a graphics application on an STM32H745i-DISCO board, and place the framebuffer in external SDRAM.
So I configured the FMC as follows:
Then, under Cortex-M7 I set up the MPU:
But when running the program and attempting to write to 0xD000 0000 I get a hard fault.
What am I missing?
Solved! Go to Solution.
2024-08-10 07:11 AM
Still, the initialization code for the SDRAM is chip-dependent, so I had to add the proper initialization code. This can be found in the BSP (board support package) drivers for the STM32H745i-DISCO.
Here's an article on how to import the BSP into an existing project:
https://community.st.com/t5/stm32-mcus/how-to-add-a-bsp-to-an-stm32cubeide-project/ta-p/49812
Essentially, create a new project for the board that you are using, and import the files from the BSP folder. In this case, the files for the sd_ram and its specific component (MT48LC4M32B2). Once you add your files to your sources and include path, you can add the call to the initialization.
At the end of the MX_FMC_Init function, call the initialization function for the specific SDRAM:
/* USER CODE BEGIN FMC_Init 2 */
if (BSP_SDRAM_Init(0) != BSP_ERROR_NONE)
{
Error_Handler();
}
/* USER CODE END FMC_Init 2 */
2024-08-09 05:05 PM
OK, I added some initialization code for the SDRAM copied from here:
and now I'm no longer getting a hardafult
2024-08-10 07:11 AM
Still, the initialization code for the SDRAM is chip-dependent, so I had to add the proper initialization code. This can be found in the BSP (board support package) drivers for the STM32H745i-DISCO.
Here's an article on how to import the BSP into an existing project:
https://community.st.com/t5/stm32-mcus/how-to-add-a-bsp-to-an-stm32cubeide-project/ta-p/49812
Essentially, create a new project for the board that you are using, and import the files from the BSP folder. In this case, the files for the sd_ram and its specific component (MT48LC4M32B2). Once you add your files to your sources and include path, you can add the call to the initialization.
At the end of the MX_FMC_Init function, call the initialization function for the specific SDRAM:
/* USER CODE BEGIN FMC_Init 2 */
if (BSP_SDRAM_Init(0) != BSP_ERROR_NONE)
{
Error_Handler();
}
/* USER CODE END FMC_Init 2 */