STM32F103C8 software simulation error- error 65: access violation at 0x40011800: no'read' permission

created at 08-27-2021 views: 8

I use the chip STM32F103C8, you can refer to the process to select different parameters to modify.

Problem Description

CPU: STM32F103C8
MDK5 software simulation prompts that there is no read and write permission, and it can only be run step by step. The prompt code is as follows:

 *** error 65: access violation at 0x40011800 : no 'read' permission

The root cause is: there is a problem with the permission mapping of the map address space. Part of the address space does not have read and write permissions, causing the program to not run automatically.

Solution

Increase the map address space permission mapping.
According to the introduction of network resources, there are roughly three methods:

  1. Modify the debug tab in the project configuration options, STM32F103ZE (punctual atom) series chip verification can be used normally. The F103C8 series chips cannot be used normally.
  2. Modify the map address permission mapping directly on the debugging page, and the program can run normally after normal modification. It needs to be reset when exiting debugging, which is inconvenient to operate.
  3. In the debug tab in the project configuration options, directly add the correct Initialization file. (Recommended)

method 1

Mainly configure the relevant parameters according to the engineering chip model

 configure the relevant parameters

The file corresponding to the specific chip click keil -filedevice database

file→device database

device database

The parameter in this row is the sim parameter corresponding to the chip

Method 2

Under the debugging page, select the Memory Map option under the DEBUG tab as shown in the figure below

 Memory Map

The map address mapping can be added according to the error prompt.

Method 3:

(indicating that it has not been used)

Create a new debug.ini file in the project file, and add the map address permission mapping code to the file

like

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

debug.ini

The specific map address permission mapping can also be viewed in the memory Map option in the debugging interface.

created at:08-27-2021
edited at: 08-27-2021: