Data access violation error when debugging in IAR

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Data access violation error when debugging in IAR

985 Views
WenWenDar
Contributor II

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

Tags (1)
0 Kudos
Reply
5 Replies

968 Views
danielmartynek
NXP TechSupport
NXP TechSupport

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

0 Kudos
Reply

892 Views
WenWenDar
Contributor II
when i modify the linker file, i have to modify the MPU configuration at the same time, right?
Is there a document about MPU configration?
0 Kudos
Reply

886 Views
danielmartynek
NXP TechSupport
NXP TechSupport

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

0 Kudos
Reply

930 Views
WenWenDar
Contributor II
Thank you for your reply.

I modified the linker_flash_s32k312.icf . Increased the space of int_sram_no_cacheable and 

int_sram_shareable. Then this problem was solved. 

Could you give me some material about linker_flash_s32k312.icf?

Thank you!
0 Kudos
Reply

915 Views
danielmartynek
NXP TechSupport
NXP TechSupport

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

0 Kudos
Reply