cancel
Showing results for 
Search instead for 
Did you mean: 

What happens when I read/write byte at arbitrary address shown as reserved in memory map (or write to flash memory address)?

wb0gaz
Senior

I am exploring the memory space of my STM32F051 using a very simple hex monitor that communicates through a serial port. I can (attempt to) read/write a byte at any arbitrary address in the 32-bit address space. Within the SRAM area (starting at 0x2000000) I can write a byte and read it back.

There are two circumstances I'm encountering (which I think are normal) where a memory access attempt does not succeed.

I would like to know what the condition is called so I can read about it in documentation and understand the rules around memory space in ARM (at least for this - F0 series - processor.)

  1. If I attempt to write to an address where the program is stored (beginning at 0x08000000), my very simple hex monitor locks up (uncaught interrupt probably), however, I can read bytes from those addresses.
  2. If I attempt to read from an address that is "reserved" per the memory map (example, 0xA0000000), my very simple hex monitor locks up (uncaught interrupt probably).

In both cases, the lock-up conditions is readily resolved by pushing the reset button (on my STM32F0Discovery module).

I am not concerned that there is an unsolved problem; my only wish is to know what these sorts of unexpected memory accesses are called, or what is happening.

I am new to ARM; my last experience with a microcomputer that was selective in granting memory-space access was my DEC LSI-11 from 1979 (such accesses would cause a "bus fault" interrupt.)

2 REPLIES 2

Both these attempts are considered to be "bus error" and result in HardFault. That's the only fault in Cortex-M0 (M3/M4/M7 have a more refined set of faults).

Read PM0215, start perhaps at the Fault handling chapter

JW

wb0gaz
Senior

Thank you, JW - that helps very much and explains exactly what I encountered.

PM0215 explains the conditions that may happen.

I will learn now how to create a service routine so my application can recover from such an interrupt.

Dave