Data access violation error when debugging in IAR

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Data access violation error when debugging in IAR

4,948 次查看
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

标记 (1)
0 项奖励
回复
5 回复数

4,931 次查看
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 项奖励
回复

4,855 次查看
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 项奖励
回复

4,849 次查看
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 项奖励
回复

4,893 次查看
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 项奖励
回复

4,878 次查看
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 项奖励
回复