Associate
June 7, 2021
Question
Utilize SDRAM on STM32H743 EVAL2 Board
- June 7, 2021
- 3 replies
- 6351 views
I'm having trouble making use of SDRAM (external device memory) on the STM32H743 EVAL2 board. Specifically, I'm trying to make use of FMC SDRAM Bank 2 (Region: External Devices) to store a large array.
Here are code snippets that I have added/modified
< STM32H743XIHX_FLASH.ld >
...
/* Specify the memory areas */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 512K
RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K
RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
SDRAM (xrw) : ORIGIN = 0xD0000000, LENGTH = 64K
}
...
/* Define output sections */
SECTIONS
{
...
/* SDRAM Section, store some application variables */
.sdram :
{
. = ALIGN(4);
_ssdram = .;
*(.sdram)
*(.sdram*)
. = ALIGN(4);
_esdram = .;
} >SDRAM
...
}...
/**
* @brief The application entry point.
* @retval int
*/
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_ADC1_Init();
MX_DFSDM1_Init();
MX_FMC_Init();
MX_I2C1_Init();
MX_LTDC_Init();
MX_QUADSPI_Init();
MX_SAI1_Init();
MX_USART1_UART_Init();
MX_USB_OTG_FS_PCD_Init();
MX_USB_OTG_HS_PCD_Init();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
int value;
srand(time(NULL));
while (1)
{
value = rand() % BUF_LEN;
buf[value] = (uint8_t)rand();
if (buf[value] % 2 == 0) {
HAL_GPIO_TogglePin(GPIOF, GPIO_PIN_10);
}
else {
HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_4);
}
HAL_Delay(2000);
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}
....ioc file has all default configurations
When trying to RUN/DEBUG, I receive this error:
Error in final launch sequence:
Failed to execute MI command:
load /home/<user_name>/<user_project>/use_sdram_example/Debug/use_sdram_example.elf
Error message from debugger back end:
Load failed
Failed to execute MI command:
load /home/<user_name>/<user_project>/use_sdram_example/Debug/use_sdram_example.elf
Error message from debugger back end:
Load failed
Failed to execute MI command:
load /home/<user_name>/<user_project>/use_sdram_example/Debug/use_sdram_example.elf
Error message from debugger back end:
Load failed
Load failedThe paths are correct