Skip to main content
JJose.4
Visitor II
January 7, 2022
Solved

DMEM Processor local RAM Memory configuration Issue

  • January 7, 2022
  • 1 reply
  • 1359 views

Micro controller : SPC584B

We tried configuring the DMEM Processor local RAM for SPC584B Microcontroller.(Attaching the DMEM Memory layout) (We have configured it outside BAF region)

We tried pushing initialized global variables to this section. We have changed the linker so that the initial values are stored in ROM. 

During initialisation, the initial values in ROM are not getting copied to the RAM section. 

StartUp code change:

/* Copy data sections

** Note: the "-1" on the start and end addresses is there because

** stbu updates before storing.

*/

lis r3, OS_hi((_DATADMEM_START_-1))

addi r3, r3, OS_lo((_DATADMEM_START_-1)) /* Start of data section */

lis r4, OS_hi((_DATADMEM_END_-1))

addi r4, r4, OS_lo((_DATADMEM_END_-1)) /* Limit of data section */

lis r5, OS_hi((_DMEM_-1))

addi r5, r5, OS_lo((_DMEM_-1)) /* Start of initial values in ROM */

b __copy_data

__copy_loop:

lbzu r0,1(r5)

stbu r0,1(r3)

__copy_data:

cmpw r3, r4

bne __copy_loop

We are also seeing that after a power ON-OFF, the Micro is reseting when this new RAM section is accessed.

    This topic has been closed for replies.
    Best answer by Erwan YVIN

    Hello ,

    What is the value of _DATADMEM_START_ (well greater than 0x52800603)?

    I advice you to check the debugger to detect which instruction is in cause.

    Best Regards

    Erwan

    1 reply

    Erwan YVIN
    Erwan YVINBest answer
    ST Employee
    January 18, 2022

    Hello ,

    What is the value of _DATADMEM_START_ (well greater than 0x52800603)?

    I advice you to check the debugger to detect which instruction is in cause.

    Best Regards

    Erwan