2024-06-13 07:15 PM
The 'HAL_SDRAM_Write_8b' and 'HAL_SDRAM_Read_8b' functions were confirmed using STM32H723ZGT6 and IS42S16320D-6TLI.
(Check variable value changes with STM32CubeIDE's Memory Viewer and LiveWatch, no hardware problems)
All internal RAM has been used to implement the current application.
Additional feature implementation requests require variable allocation and access to external RAM.
I reviewed the STM32CubeH7 example and applied it to my project, but encountered a HardFault Handler.
(Modify STM32H747XIHX_FLASH.ld file in my Project)
Please let me know if there is anything else I need to check.
- Example path: \STM32Cube\Repository\STM32Cube_FW_H7_V1.11.1\Projects\STM32H747I-EVAL\Examples\FMC\FMC_SDRAM_DataMemory\STM32CubeIDE\CM7
Build Analyzer - Memory Regions
HardFault_Handler
Debug Message
Starting server with the following options: Waiting for debugger connection... Log output file: C:\Users\thyu\AppData\Local\Temp\STM32CubeProgrammer_a05560.log Memory Programming ... Erasing memory corresponding to segment 0: File download complete
Download verified successfully
|
Solved! Go to Solution.
2024-06-14 03:24 AM - edited 2024-07-15 06:18 AM
Hello,
You need to initialize the memory first (GPIO and FMC) in SystemInit() / system_stm32h7xx.c.
If you look at system_stm32h7xx.c provided in one of the STM32H747I-EVAL examples you can find the following:
So look at SystemInit_ExtMemCtl() implementation. You need to activate de definition DATA_IN_ExtSDRAM.
Also there is an example how to locate the global variables in the external SDRAM in x-cube-perf-h7 related to the AN4891 STM32H72x, STM32H73x, and single-core STM32H74x/75x
system architecture and performance
Look at the project config 6 where the code is executed in ITCM and all variables are located in SDRAM:
Advice: before starting to relocate your variables in SDRAM, you need to do some read/write tests to validate that the SDRAM access is correct and you don't get any read/write issues.
Hope it helps.
2024-06-13 07:29 PM
Your SystemInit() code needs to bring up the clocks, PLLs and SDRAM so code in startup.s can initialize the statics. Doing it in main() is too late.
The HardFault_Handler indicates that the memory you are touching is not functional.
2024-06-14 03:24 AM - edited 2024-07-15 06:18 AM
Hello,
You need to initialize the memory first (GPIO and FMC) in SystemInit() / system_stm32h7xx.c.
If you look at system_stm32h7xx.c provided in one of the STM32H747I-EVAL examples you can find the following:
So look at SystemInit_ExtMemCtl() implementation. You need to activate de definition DATA_IN_ExtSDRAM.
Also there is an example how to locate the global variables in the external SDRAM in x-cube-perf-h7 related to the AN4891 STM32H72x, STM32H73x, and single-core STM32H74x/75x
system architecture and performance
Look at the project config 6 where the code is executed in ITCM and all variables are located in SDRAM:
Advice: before starting to relocate your variables in SDRAM, you need to do some read/write tests to validate that the SDRAM access is correct and you don't get any read/write issues.
Hope it helps.
2024-06-16 05:18 PM
Let's try it that way.
2024-07-01 01:50 AM
Hello @thyu ,
Did you already solve your issue? if yes, please close this thread by clicking on Accept as solution the comment that answered your question.
Thank you.