2023-05-16 10:56 AM
Having difficulty gaining access a peripheral region in the bootloader and could use some suggestions.
In the bootloader we need to MAP the address space described below, this address space works correctly in the application but not in the bootloader.
/* Setup Memory Mapped LCD in Write-through (framebuffer) */
MPU_InitStruct.Enable = MPU_REGION_ENABLE;
MPU_InitStruct.BaseAddress = 0x64000000;
MPU_InitStruct.Size = MPU_REGION_SIZE_32MB;
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_NUMBER2;
MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;
MPU_InitStruct.SubRegionDisable = 0x00;
MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_DISABLE;
HAL_MPU_ConfigRegion(&MPU_InitStruct);
When the MPU maps this space we get the same error as in the thread also linked below. Can anyone provide a link or description on how to accomplish this?
If the address space is NOT mapped the bootloader runs but no writes the the area occur (i.e. this is a framebuffer and the screen does not update), when the address is mapped the writes occur (i.e. screen changes color) but causes a failure in
SFU_MPU_EnterUnprivilegedMode();
during the call to SFU_BOOT_SM_CheckStatusOnReset.
https://community.st.com/s/question/0D53W00001t2vcgSAA/enabling-sfumpuprotectenable-causes-a-problem
Are there any resources for tweaking the bootloader to map a peripheral area?
2023-06-06 01:56 PM
Memory mapping had to be enabled and the unprivileged memory mapping needed to be updated.
This document filled in a number of missing pieces