houlinfeng

问题描述

CPU:STM32F407
MDK5软件模拟提示没有读写权限,只能一步一步运行。提示代码如下:

*** error 65: access violation at 0x40023800 : no \'read\' permission
*** error 65: access violation at 0x40023800 : no \'write\' permission
*** error 65: access violation at 0x40023808 : no \'write\' permission
*** error 65: access violation at 0x40023800 : no \'read\' permission
*** error 65: access violation at 0x40023800 : no \'write\' permission

根本原因是:map地址空间权限映射有问题。部分地址空间没有读写的权限,造成程序不能自动运行。

解决方法

增加map地址空间权限映射。
根据网络资源介绍方法大致有三种:
1.修改工程配置选项中的debug选项卡,STM32F1系列芯片验证可以正常使用。F4系列芯片不能正常使用。
2.直接在调试页面修改map地址权限映射,正常修改后程序可正常运行。退出调试时需要重新设置,操作不方便。
3.在工程配置选项中的debug选项卡,直接添加正确的Initialization file。(推荐使用)

方法3:

工程文件中新建“debug,ini”文件,在文件中添加map地址权限映射代码

map 0x40000000, 0x40007FFF read write // APB1
map 0x40010000, 0x400157FF read write // APB2
map 0x40020000, 0x4007FFFF read write // AHB1
map 0x50000000, 0x50060BFF read write // AHB2
map 0x60000000, 0x60000FFF read write // AHB3
map 0xE0000000, 0xE00FFFFF read write // CORTEX-M4 internal peripherals


具体的map地址权限映射也可在调试界面中的memory Map选项中查看。

方法2:

调试页面下,在DEBUG选项卡下选择Memory Map 选项如下图

可根据错误提示进行map地址映射添加。

方法1:

主要根据工程芯片型号配置相关参数

分类:

技术点:

相关文章:

  • 2021-09-25
  • 2021-10-30
  • 2021-12-05
  • 2021-09-25
  • 2022-01-02
  • 2021-10-30
  • 2021-11-10
猜你喜欢
  • 2021-08-12
  • 2021-10-10
  • 2021-09-04
  • 2021-05-05
  • 2021-10-24
  • 2021-11-18
  • 2021-03-29
相关资源
相似解决方案