2018-06-30 09:33 AM
Hi .
I have a custom board with ''stm32f767'' mcu on it and an external sram ''is62wv51216bll-55tli ''.
I have two problem first is when MPU is Disable and i have this config :↓
SCB_EnableICache();
SCB_EnableDCache();
.
.
.
/* FMC initialization function */
static void MX_FMC_Init(void){ FMC_NORSRAM_TimingTypeDef Timing;/** Perform the SRAM1 memory initialization sequence
*/ hsram1.Instance = FMC_NORSRAM_DEVICE; hsram1.Extended = FMC_NORSRAM_EXTENDED_DEVICE; /* hsram1.Init */ hsram1.Init.NSBank = FMC_NORSRAM_BANK1; hsram1.Init.DataAddressMux = FMC_DATA_ADDRESS_MUX_DISABLE; hsram1.Init.MemoryType = FMC_MEMORY_TYPE_SRAM; hsram1.Init.MemoryDataWidth = FMC_NORSRAM_MEM_BUS_WIDTH_16; hsram1.Init.BurstAccessMode = FMC_BURST_ACCESS_MODE_ENABLE; hsram1.Init.WaitSignalPolarity = FMC_WAIT_SIGNAL_POLARITY_LOW; hsram1.Init.WaitSignalActive = FMC_WAIT_TIMING_BEFORE_WS; hsram1.Init.WriteOperation = FMC_WRITE_OPERATION_DISABLE; hsram1.Init.WaitSignal = FMC_WAIT_SIGNAL_DISABLE; hsram1.Init.ExtendedMode = FMC_EXTENDED_MODE_DISABLE; hsram1.Init.AsynchronousWait = FMC_ASYNCHRONOUS_WAIT_ENABLE; hsram1.Init.WriteBurst = FMC_WRITE_BURST_ENABLE; hsram1.Init.ContinuousClock = FMC_CONTINUOUS_CLOCK_SYNC_ONLY; hsram1.Init.WriteFifo = FMC_WRITE_FIFO_ENABLE; hsram1.Init.PageSize = FMC_PAGE_SIZE_NONE; /* Timing */ Timing.AddressSetupTime = 15; Timing.AddressHoldTime = 15; Timing.DataSetupTime = 255; Timing.BusTurnAroundDuration = 15; Timing.CLKDivision = 10; Timing.DataLatency = 17; Timing.AccessMode = FMC_ACCESS_MODE_A; /* ExtTiming */if (HAL_SRAM_Init(&hsram1, &Timing, NULL) != HAL_OK)
{ _Error_Handler(__FILE__, __LINE__); }}
Then result will be this ↓ (MY_SRAM_BASE_ADDRESS =0x60000000 as datasheet said ) :
MCU will write to the external sram untill 0x60002577 (usually after reset write until here or a little less)... as you can see i putted a HAL_Delay(1) ms after writing to address if i remove it MCU will write to sram just a little something about 0x60000040 and in both case it generate hard fault error after some writing to sram ( i also am able to read this content).
so does any one has an idea ? what is wrong ? why it can't write in whole of my sram ? why when i delete delay it write less ?
and second problem is when i Enable MPU in first try to writing to sram it generate hardfault error . (MPU config :↓ :(
/* MPU Configuration */
void MPU_Config(void)
{ MPU_Region_InitTypeDef MPU_InitStruct;/* Disables the MPU */
HAL_MPU_Disable(); /**Initializes and configures the Region and the memory to be protected */ MPU_InitStruct.Enable = MPU_REGION_ENABLE; MPU_InitStruct.Number = MPU_REGION_NUMBER0; MPU_InitStruct.BaseAddress = 0x60000000; MPU_InitStruct.Size = MPU_REGION_SIZE_4MB; MPU_InitStruct.SubRegionDisable = 0x0; MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0; MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS; MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE; MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE; MPU_InitStruct.IsCacheable = MPU_ACCESS_CACHEABLE; MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;HAL_MPU_ConfigRegion(&MPU_InitStruct);
/* Enables the MPU */
HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);}
2018-07-02 11:07 AM
http://www.issi.com/WW/pdf/66WV51216EALL-EBLL.pdf
Yeah looks like they just support 512KB rather than the full 1MB (8Mbit), per the &sharpdefine in the BSP, probably ran out of pin escape options, and traded off.
STM32Cube_FW_F7_V1.11.0\Drivers\BSP\STM32F723E-Discovery\stm32f723e_discovery_psram.h
&sharpdefine PSRAM_DEVICE_ADDR ((uint32_t)0x60000000)
&sharpdefine PSRAM_DEVICE_SIZE ((uint32_t)0x80000) /* SRAM device size in Bytes */https://www.st.com/en/evaluation-tools/32f723ediscovery.html
benahmed.mohamed
product page says 8Mbit PSRAM, might want to fix that