Skip to main content
AKuma.45
Associate II
November 7, 2022
Question

Can I change the Register address of Flash Memory of a Microcontroller?

  • November 7, 2022
  • 6 replies
  • 1743 views

Ex.: - Original start address of Flash Memory is 0x08000 0000

     But I want to Change it to some random address like 01h.

This topic has been closed for replies.

6 replies

Tesla DeLorean
Guru
November 7, 2022

No, and Why?

The MCU boots using a vector table starting at address Zero.

The BOOTx pins typically control what memory maps at Zero, and then execution proceeds to the Initial PC specified in the vector table.

Once code is executing you can set the base vector table to some other address, one that's typically aligned with the size of the table, ie at some 512-byte aligned address.

ARM has Technical Reference Manuals for their MCU cores if the functionality/behaviour is of interest.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
AKuma.45
AKuma.45Author
Associate II
November 7, 2022

Got it. Thank you!!

Actually, I want to make emulator of an accelerometer on a microcontroller.

That is why I want to change the address as of accelerometer address.

Any suggestions?

Tesla DeLorean
Guru
November 7, 2022

The address spaces are unrelated, suggest you don't try to relate them.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Javier1
Principal
November 7, 2022

If you want your code to start from other position other than 0x8000000 you should start messing with the linker script.

There are boundaries to what addresses are corresponding to fLASH, as long as you stay there it should be fine.

(and then as @Community member​ said you need to change the NVIC vector table to suit your new address offset (flash or ram))

hit me up in https://www.linkedin.com/in/javiermuñoz/
AKuma.45
AKuma.45Author
Associate II
November 7, 2022

Thank you.

Actually, I want to make emulator of an accelerometer on a microcontroller.

That is why I want to change the address as of accelerometer address.

Tesla DeLorean
Guru
November 7, 2022

No, the accelerometer register address, in the I2C or SPI sense, doesn't have to directly relate to that of the MCU's internal memory space.

You'd create an array in RAM of the "register file" and index into that based on the Slave level interaction you're having on the bus.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..