Octospi1 Reading from volatile memory stm32H735
Hi
I have configured Octospi1 to Read / Write from my FPGA in memory mapped mode.
The interface works well, but i have a problem that the CPU is not reading from the memory and just use last cached value.
The Variables are set volatile. both the pointer to the struct and each variable.
typedef struct
{
volatile uint32_t nFpgaInfo;
volatile uint8_t nBldcEnable;
volatile uint8_t n12VOff;
volatile uint8_t nDurInterfaceTest;
volatile uint8_t nEncOutDiv;
volatile uint32_t nuS;
}TFTop;
volatile TFTop* m_pFTop;
i also tried __IO, but that gave the same.
I have set following for the MPU:
MPU_Region_InitTypeDef MPU_InitStruct;
/* Disable the MPU */
HAL_MPU_Disable();
/* Configure the MPU attributes as WT for OCTOSPI1 */
MPU_InitStruct.Enable = MPU_REGION_ENABLE;
MPU_InitStruct.BaseAddress = OCTOSPI1_BASE;
MPU_InitStruct.Size = MPU_REGION_SIZE_64MB;
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_SHAREABLE;
MPU_InitStruct.Number = MPU_REGION_NUMBER2;
MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL1;
MPU_InitStruct.SubRegionDisable = 0x00;
MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE;
HAL_MPU_ConfigRegion(&MPU_InitStruct);
/* Enable the MPU */
HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);
Can I somehow instruct the CPU / MPU to always read from the Octopspi1?
best Regards
Kristian Vang
