2024-11-28 04:46 PM - edited 2024-11-28 04:49 PM
Symptom:
STM32H7S78-DK board includes a 32MB PSRAM (APS256XXN-OBR-BG() connected to HEXASPI. Somehow only the first 4MB is accessable.
How to reproduce the error:
Use the template project provided in "STM32Cube_FW_H7RS_V1.1.0\Projects\STM32H7S78-DK\Templates\Template_XIP" add the following code in the app's main.c:
/* USER CODE BEGIN 0 */
#include <stdbool.h>
bool TestExRam()
{
unsigned char* address = (unsigned char*)0x90000000;
int ramSize;
ramSize = 32*1024*1024; // failed at 0x90400000 which means only 4MB RAM is accessible.
//ramSize = 4*1024*1024; // passed test.
unsigned char* begin = address;
unsigned char* end = begin + ramSize;
unsigned char* p = begin;
char c = 0;
while(p < end) {
*p = c;
p++;
c++;
}
// Check whether the data is correct:
c = 0;
p = begin;
while(p < end) {
if (c != *p) {
// error!
return false;
}
c++;
p++;
}
return true;
}
/* USER CODE END 0 */
// Call the test function in user code section 2:
/* USER CODE BEGIN 2 */
/* Initialize LD1 */
BSP_LED_Init(LD1);
if (!TestExRam()) {
Error_Handler();
}
/* USER CODE END 2 */
A fault error will be generated when the RAM access loop goes beyond 0x90400000.
Any advice or insights to address this issue would be greatly appreciated.
Thank you!
David