cancel
Showing results for 
Search instead for 
Did you mean: 

Non-aligned LDR, STR on STM32H743

PMath.4
Senior III

The ARM-M7 supports non-aligned memory accesss using LDR and STR

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0646a/BABFAIGG.html

but it isn't working for me. I'm reading and write to/from DTCMRAM.

Is there anything I need to do to get this to work? Current MPU access set up as below

  /* Configure the MPU attributes as WB-nWA for SRAM */
  MPU_InitStruct.Enable = MPU_REGION_ENABLE;
  MPU_InitStruct.BaseAddress = 0x24000000;
  MPU_InitStruct.Size = MPU_REGION_SIZE_512KB;
  MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;
  MPU_InitStruct.IsBufferable = MPU_ACCESS_BUFFERABLE ;
  MPU_InitStruct.IsCacheable = MPU_ACCESS_CACHEABLE;
  MPU_InitStruct.IsShareable = MPU_ACCESS_SHAREABLE;
  MPU_InitStruct.Number = MPU_REGION_NUMBER1;
  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);

Thanks

1 REPLY 1

Is it faulting? Should work without any intervention.

LDRD, STRD will fault with unaligned addresses, these are often used by the optimizer or floating point doubles.

Stack alignment for load/store multiple and pointer reads might also be a consideration.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..