Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch.embedded > #27484

Re: Copy to and execution from RAM

From Gunther Mannigel <newsgroups@mannigel.net>
Newsgroups comp.arch.embedded
Subject Re: Copy to and execution from RAM
Date 2018-01-02 11:49 +0100
Message-ID <fb16d1F6eujU1@mid.individual.net> (permalink)
References <08cd49ed-14ef-4c81-b609-3fdeaef04a7e@googlegroups.com>

Show all headers | View raw


Am 22.12.2017 um 21:13 schrieb Klaus Kragelund:
> Copy code that needs to run to RAM
> Move program counter to first RAM address to start RAM execution
> Write to flash, and keep running in RAM
> When finished writing to flash, return code execution to flash (that way only limited code needs to be copied to RAM). Move program counter to flash

Yes, it's that easy. If you write the RAM code in assembler, you can
make sure that no relocation of adress data is necessary. If you don't,
you should tell the linker of that code segment in RAM. Either an extra
segment or an overlay.
There may be some security / MMU that prevents code execution in RAM /
segments with write enabled.
Be sure not to trigger any interrupt, as the vector table usually
resides in FLASH. Imho ARM lets you relocate that into RAM.
I remember a TI app note about that for MSP430, but other vendors will
have that too, as this is a well known problem of boot loaders. Maybe
there is something like that hard coded into that uC?

cheers
Gunther

Back to comp.arch.embedded | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Copy to and execution from RAM Klaus Kragelund <klauskvik@hotmail.com> - 2017-12-22 12:13 -0800
  Copy to and execution from RAM Klaus Kragelund <klauskvik@hotmail.com> - 2017-12-22 12:21 -0800
    Copy to and execution from RAM Klaus Kragelund <klauskvik@hotmail.com> - 2017-12-22 12:27 -0800
    Re: Copy to and execution from RAM lasselangwadtchristensen@gmail.com - 2017-12-27 09:56 -0800
  Re: Copy to and execution from RAM Dave Nadler <drn@nadler.com> - 2017-12-23 08:29 -0800
  Re: Copy to and execution from RAM marcin.tomasz.bawolski@gmail.com - 2017-12-24 03:29 -0800
  Re: Copy to and execution from RAM pozz <pozzugno@gmail.com> - 2017-12-28 08:56 +0100
  Re: Copy to and execution from RAM Richard Damon <Richard@Damon-Family.org> - 2017-12-28 09:51 -0500
    Re: Copy to and execution from RAM pozz <pozzugno@gmail.com> - 2017-12-28 17:50 +0100
      Re: Copy to and execution from RAM Richard Damon <Richard@Damon-Family.org> - 2017-12-28 12:08 -0500
  Re: Copy to and execution from RAM Gunther Mannigel <newsgroups@mannigel.net> - 2018-01-02 11:49 +0100

csiph-web