cancel
Showing results for 
Search instead for 
Did you mean: 

DMEM Processor local RAM Memory configuration Issue

JJose.4
Associate

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 discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 ACCEPTED SOLUTION

Accepted Solutions
Erwan YVIN
ST Employee

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

View solution in original post

1 REPLY 1
Erwan YVIN
ST Employee

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