Header_CreateEX() causes HardFault due to unaligned access

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Header_CreateEX() causes HardFault due to unaligned access

      New

      Dear Sirs,
      we use emWin 6.32.3 from KEIL.

      For memory management purposes we need to configure our external memory on our STM32F767 cpu to be of strongly ordered type. Doing this, 32bit accesses have to be on 32bit boundaries, 16bit accesses on 16bit boundaries and so on.
      However when emWin produces the first GUI item (a ListBox in our case), there is a HardFault.
      We traced into emWin Library in Disassembler Window and found out the following:
      With ListBox_Create there is also a call:

      Header_CreateEX()
      within this function there comes:

      GUI_GetYDistOfFont()

      WM_CreateWindowAsChild()

      GUI_ARRAY_Create()

      Widget__Init()
      and then comes:


      0x0802E636 F8A50071 STRH r0,[r5,#0x71]
      (R5 = 0x6C0001BC)

      This instruction stores a 16bit value in R0 (=1) to the uneven adress 0x6C0001BC+0x71 = 0x6C00022D !

      After this the cpu goes to HardFault, which is correct, because this access is not allowed.

      Please how can we avaoid that emWin uses nonaligned accesses?

      Thanks a lot

      Andy