How does uVision start executing M3 flash OS from RAM?

It seems the flash programming algorithm is a piece of code that is downloaded into the SRAM and executes from there.

But how does it get started if there is nothing yet in the vector table at 0? If the flash is erased then everything in the vector table at zero will be 0xFFFFFFFF, so how does it start executing the algorithm in RAM? (which is at 0x20000000 for example)

I want to know because I want to be able to boot from RAM as well.

Parents
  • The JTAG interface allows the processor to be controlled. So the JTAG interface can manually put bytes of data into RAM. And the JTAG interface can give a suitable value to PC to make the processor run the code that was downloaded into RAM.

    So no need for any reset vector when you have a JTAG adapter connected.

    So no - you can't normally boot from RAM. Just that some processors have an internal boot loader that can (depending on configuration) retrieve a boot image from some non-volatile interface, like an SD card or an USB thumb drive, and copy into RAM and then have that program continue with any further startup actions.

    When debugging using the Keil tools, you normally have an init file for the debugger with a line that tells the debugger what PC value to use after your program have been downloaded into RAM. So same method as used when programming the chip, but instead used to let you debug applications directly from RAM without involvement of any boot loader.

Reply
  • The JTAG interface allows the processor to be controlled. So the JTAG interface can manually put bytes of data into RAM. And the JTAG interface can give a suitable value to PC to make the processor run the code that was downloaded into RAM.

    So no need for any reset vector when you have a JTAG adapter connected.

    So no - you can't normally boot from RAM. Just that some processors have an internal boot loader that can (depending on configuration) retrieve a boot image from some non-volatile interface, like an SD card or an USB thumb drive, and copy into RAM and then have that program continue with any further startup actions.

    When debugging using the Keil tools, you normally have an init file for the debugger with a line that tells the debugger what PC value to use after your program have been downloaded into RAM. So same method as used when programming the chip, but instead used to let you debug applications directly from RAM without involvement of any boot loader.

Children
More questions in this forum