Skip to main content
Super User
October 2, 2017
Solved

Copying code to RAM

  • October 2, 2017
  • 2 replies
  • 908 views
Posted on October 02, 2017 at 14:52

When code is copied to RAM (for example the code for rewriting internal flash)  how the RAM is allocated? Is it allocated statically or just uses any free space remaining below the stack? I cannot find this in the documentation.

    This topic has been closed for replies.
    Best answer by luca239955_stm1_st
    Posted on October 03, 2017 at 10:36

    Hello,

    what compiler?

    For the Cosmic compiler look for 'Moveable Code' in the user manual (page 286), there is an explanation and a short example.

    Regards,

    Luca

    2 replies

    Graduate II
    October 2, 2017
    Posted on October 02, 2017 at 16:03

    Unless there are specific execution requirements, RAM is allocated in normal fashion, off the stack, from the heap or statically.

    Understand how the core executes code, address dependency, control transfer, etc.

    Visitor II
    October 3, 2017
    Posted on October 03, 2017 at 10:36

    Hello,

    what compiler?

    For the Cosmic compiler look for 'Moveable Code' in the user manual (page 286), there is an explanation and a short example.

    Regards,

    Luca

    Pavel A.Author
    Super User
    October 5, 2017
    Posted on October 05, 2017 at 03:53

    Thank you Luca