Reset with recall

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Reset with recall

Jump to solution
1,295 Views
mathias_edman
Contributor III

Hi,

I am using MPC5777C device.

In previous projects we have used mcu wd reset together with setting some flag in ram in order to recall this flash at the next startup. However for MPC5777C this is not possible since the ram needs to be initialized with ECC, meaning that all data in ram will be overwritten by this sequence.

I am not used to this MCU device, hence my question how to best do similar thing? are there some other memory or register that could be used for this?

Regards,

Mathias

Tags (2)
0 Kudos
Reply
1 Solution
1,199 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello Mathias,

You can use core registers for your purpose.

pastedImage_1.png

pastedImage_2.png

pastedImage_3.png

So the ones with "1" note are unaffected on reset assertion.

regards,

Peter

View solution in original post

4 Replies
1,200 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello Mathias,

You can use core registers for your purpose.

pastedImage_1.png

pastedImage_2.png

pastedImage_3.png

So the ones with "1" note are unaffected on reset assertion.

regards,

Peter

1,199 Views
mathias_edman
Contributor III

Hi Peter,

Thanks for your answer. I decided to try with usprg0 "register". But it seems to be a problem if using lockstep ?

I can read this in startup asm file:

;#**************************** Init Core Registers ****************************
;# The E200Z4 core needs its registers initialising before they are used
;# otherwise in Lock Step mode the two cores will contain different random data.
;# If this is stored to memory (e.g. stacked) it will cause a Lock Step error.

....

;# Init any other CPU register which might be stacked (before being used).

mtspr 1, r1 ;#XER
mtcrf 0xFF, r1
mtspr CTR, r1
mtspr 272, r1 ;#SPRG0
mtspr 273, r1 ;#SPRG1
mtspr 274, r1 ;#SPRG2
mtspr 275, r1 ;#SPRG3
mtspr 58, r1 ;#CSRR0
mtspr 59, r1 ;#CSRR1
mtspr 570, r1 ;#MCSRR0
mtspr 571, r1 ;#MCSRR1
mtspr 61, r1 ;#DEAR
mtspr 63, r1 ;#IVPR
mtspr 256, r1 ;#USPRG0
mtspr 62, r1 ;#ESR
mtspr 8,r31 ;#LR

Seems to me that using usprg0 is not really an option for me if lockstep is used?

It seems like the TBL and TBU does have a defined value at startup, perhaps I could use these registers instead?

What is your opinion ?

Regards,

Mathias

0 Kudos
Reply
1,199 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi,

I see no issue here as the note is from MPC56xx architecture where the core register in lock step has to be initialized by 64-bits.

In MPC57xx it is already done in HW during reset.

So you don't have to care about it.

You can check it by simple write to core resister and then read back. If it is not initialized by 64bits you will get lockstep fault.

I didn't personally tried it on this micro but it should work just fine.

If not, then simple initialize it in stratup right after reset by 64bits.

regards,

Peter

0 Kudos
Reply
1,199 Views
mathias_edman
Contributor III

Ok, thanks for the explanation!

I ended up using TBU (spr 285) as the register to use. It seems to work great.

Thanks!

Mathias

0 Kudos
Reply