Config

Purpose

  • Define the complete SRAM and Flash memory map for both cores.
  • Extend Astrobe’s LinkOptions for memory parameters for core 1.

Notes

  • Oberon RTK programs should only use Config, not LinkOptions.
  • Module Memory uses the definitions provided by Config to implement the heap and stack allocators for both cores. Hence, normally programs do not need to directly use Config.

Memory Map

  Memory map SRAM:
  +---------------------------+
  |    core 1 stack           | CoreOneStackStart
  |                           |
 ~~~                         ~~~
  |                           |
  |    core 1 heap            | CoreOneHeapStart
  +---------------------------+
  |    core 1 vector table    | CoreZeroDataEnd = CoreOneDataStart = LinkOptions.DataEnd
  +---------------------------+
  |                           |
  |    module data (shared)   | shared as per MODULE
  |                           | separation/encapsulation
  +---------------------------+
  |    core 0 stack           | LinkOptions.StackStart
  |                           |
 ~~~                         ~~~
  |                           |
  |    core 0 heap            | CoreZeroHeapStart = LinkOptions.HeapStart
  +---------------------------+
  |    core 0 vector table    | CoreZeroDataStart = LinkOptions.DataStart
  +---------------------------+

  Memory map flash memory (XIP):
                                CodeEnd = LinkOptions.CodeEnd
  +---------------------------+
  |                           |
  |                           |
 ~~~   code (shared)         ~~~
  |                           |
  |                           | CodeStart = LinkOptions.CodeStart
  +---------------------------+
The basic concepts:

  • In Astrobe’s configuration dialog, allocate SRAM for core 0 (Data Range, Heap Start, Heap Limit). This is reflected in module LinkOptions.
  • Module Config allocates the remaining SRAM to core 1 (with the exception of the two 4k SRAM blocks at the top1), allocating the same amount of memory space for the vector table as defined for core 0.
  • The SRAM from core 0 also comprises the module variables.
  • Code memory space is as defined in Astrobe.

See Also

Repository

Note: both versions are now the same and will be moved “up” to rpi/any unless an issue arises.


  1. RP2040: MCU2.SRAM4_BASE, MCU2.SRAM5_BASE; RP2350: MCU.SRAM8_BASE, MCU.SRAM9_BASE ↩︎