Hi all,
When debugging in IAR, a hardfault error occurs, prompting Data access violation (CFSR. DACCVIOL, MMFAR), At data address 0x20408594.
However, it can be seen from the linker_flash_st32k312.iCF file that the address 0x20408594 is in the accessible SRAM area, as shown in the attachment.
Could you give me some advice? Thank you
Hi @WenWenDar,
This is an MPU data access violation.
Check the MPU configuration, you should know the start address, size and all the other attributes of all the regions.
Regards,
Daniel
Hi @WenWenDar,
It depends on how you modify the linker file. Usually, the startup code that configures the MPU uses symbols from the linker file.
Anyway, you should know how the regions are configured - all their attributes, their size, if they overlap, etc.
Refer to ARM documentation.
https://developer.arm.com/documentation/ddi0489/f/memory-protection-unit?lang=en
Regards,
Daniel
Hello WENPING LIU,
The .icf is a format used by the IAR IDE.
Refer to IAR documentation:
IAR C/C++ Development Guide Compiling and Linking
https://wwwfiles.iar.com/arm/webic/doc/EWARM_DevelopmentGuide.ENU.pdf
Regards,
Daniel