Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to reserve memory segment using SES

Hello,

I have modified flash_placement.xml to define a 64 byte RAM region to be used to preserve data across soft resets. It compiles and links but the memory seems to be set to zeros on reset initialization.

This is part of flash_placement.xml. (I have tried load="No" as well)

    <ProgramSection alignment="4" load="No" name=".tbss" />
    <ProgramSection alignment="4" load="No" name=".non_init" />
    <ProgramSection alignment="8" keep="Yes" size="$(EWAVE_DATA_SIZE)" load="Yes" name=".ewave"/>
    <ProgramSection alignment="4" size="__HEAPSIZE__" load="No" name=".heap" />
    <ProgramSection alignment="8" size="__STACKSIZE__" load="No" place_from_segment_end="Yes" name=".stack"  address_symbol="__StackLimit" end_symbol="__StackTop"/>
    <ProgramSection alignment="8" size="__STACKSIZE_PROCESS__" load="No" name=".stack_process" />

This is the map file output:

                0x0000000020007128                __ewave_load_start__ = ALIGN (__non_init_end__, 0x8)

.ewave          0x0000000020007128       0x40
                0x0000000020007128                __ewave_start__ = .
 *(.ewave .ewave.*)
                0x0000000020007168                . = ALIGN (MAX ((__ewave_start__ + 0x40), .), 0x8)
 *fill*         0x0000000020007128       0x40
                0x0000000020007168                __ewave_end__ = (__ewave_start__ + SIZEOF (.ewave))
                0x0000000000000040                __ewave_size__ = SIZEOF (.ewave)
                0x0000000020007168                __ewave_load_end__ = __ewave_end__
                0x0000000000000001                . = ASSERT (((__ewave_start__ == __ewave_end__) || ((__ewave_end__ - __RAM1_segment_start__) <= __RAM1_segment_size__)), error: .ewave is too large to fit

It appears it is defined to be *filled* and I don't know how to disable that.

TIA

Parents
  • I also tried making this a separate memory segment.

      <MemorySegment name="RAM2" start="$(RAM_PH_START)+$(RAM_PH_SIZE)-$(EWAVE_DATA_SIZE)" size="$(EWAVE_DATA_SIZE)">
        <ProgramSection load="no" size="$(EWAVE_DATA_SIZE)" name=".ewave" />
      </MemorySegment>

    The memory gets trashed with a J-Link reset or calling NVIC_SystemReset().

    The objective is to store a 32-bit value across resets. The general retention registers are only 8-bits. Is there any other registers that could be used?

Reply
  • I also tried making this a separate memory segment.

      <MemorySegment name="RAM2" start="$(RAM_PH_START)+$(RAM_PH_SIZE)-$(EWAVE_DATA_SIZE)" size="$(EWAVE_DATA_SIZE)">
        <ProgramSection load="no" size="$(EWAVE_DATA_SIZE)" name=".ewave" />
      </MemorySegment>

    The memory gets trashed with a J-Link reset or calling NVIC_SystemReset().

    The objective is to store a 32-bit value across resets. The general retention registers are only 8-bits. Is there any other registers that could be used?

Children
No Data
Related