2017-11-28 11:16 PM
Hello all,
I try to make my own example based on AN4760 and QSPI_perfs example from STM32Cube_FW_F7_V1.8.0.
The MPU init code is:
static void MPU_Config(void)
{ MPU_Region_InitTypeDef MPU_InitStruct; /* Disable the MPU */ HAL_MPU_Disable(); /* Configure the MPU attributes for SDRAM */ MPU_InitStruct.Enable = MPU_REGION_ENABLE; MPU_InitStruct.BaseAddress = 0xC0200000; MPU_InitStruct.Size = MPU_REGION_SIZE_2MB; MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS; MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE; MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE; MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE; MPU_InitStruct.Number = MPU_REGION_NUMBER0; MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL1; MPU_InitStruct.SubRegionDisable = 0x00; MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_DISABLE; HAL_MPU_ConfigRegion(&MPU_InitStruct); /* Enable the MPU */ HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);}in GUIConf i have the LCD memory set as
&sharpdefine GUI_NUMBYTES 0x200000
static U32 aMemory[GUI_NUMBYTES / 4] __attribute__((at(0xC0200000)));
In LCD LCDConf.c i have
// Video RAM Address
&sharpdefine VRAM_ADDR 0xC0000000// DMA2D Buffer Address
&sharpdefine DMA2D_BUFFER_ADDR 0x20000000my scatter file
LR_IROM1 0x08000000 0x00100000 { ; load region size_region
ER_IROM1 0x08000000 0x00100000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) } RW_IRAM1 0x20010000 0x00040000 { ; RW data .ANY (+RW +ZI) } RW_IRAM2 0x20000000 0x00010000 { .ANY (+RW +ZI) }}LR_QSPI 0x90000000 0x00800000 {ER_QSPI 0x90000000 0x00800000 {*.o (.textqspi)}}in the image files i have added the attribute for static data location as below
__attribute__((section('.textqspi')))
static GUI_CONST_STORAGE unsigned long _acBackGround[] = {
0x1AD5CAC2, 0x0DD5CAC2......My understanding from '4.1.2 Programming QSPI Flash memory using IDE' is that i dont have to use STM32 ST-LINK utility if i respect the steps from this chapter.
However when i upload to the F746 dicovery no data is placed in
0x9...... area.
So may questions are:
Is there some extra step the i need to do in order to use the QSPI from the IDE?
Does the LCD configuration has any influence of the QSPI? (i do not think so, see attached image)
Should i insert in the scatter file also the external SDRAM?
Where
can i find a tutorial with examples for the scatter files?
For the MPU config, should i switch to the configuration presented here?
http://www.keil.com/support/docs/3777.htm
Thank you.
#memory-configuration #stm32f746-discovery #memory-map #scatter-file