Standby RAM

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User16898
Level 4
Level 4
Hi,
During standby configuration it is said to copy redundancy data
(5.4 Preparation before to enter Stand-by mode page 211 user manual).

My code is :
	
#define RESERVED_DATA_START_POINTER 0xD0002000

uint32* reserved_data = (uint32*)RESERVED_DATA_START_POINTER;

for(uint8 i = 0 ; i < WORD_SIZE; i++){
if(reserved_data != 0xFFFFFFFF
&& reserved_data != 0x0 ){
uint32* reserved_data_pointer = (uint32*)reserved_data;
reserved_data = *reserved_data_pointer; //here trap happens


The problem is that , I'm always getting trap. I turned off cpu and safety ENDINIT functions.
I saw in debugger that this reserved_data pointers are not null.
They are valid datas.
I use Tc222L
How to solve this problem ?
0 Likes
8 Replies
MsMdt
Employee
Employee
10 replies posted 5 replies posted First reply posted
It would help if you would provide the name of the device you are using. Most probably the RAM where you are trying to copy something in is:
- protected by MPU or SPROT
- is unitialized
-you are accessign nonexistant memory
0 Likes
User16898
Level 4
Level 4
I use TC222L
0 Likes
MsMdt
Employee
Employee
10 replies posted 5 replies posted First reply posted
I can see that this address should be valid since it addresses locally the DSPR of CPU0. Did you check which trap handler is called (=trap class) and the Trap Identification Number (in D15)?
0 Likes
User16898
Level 4
Level 4
how can i check it ?
0 Likes
MsMdt
Employee
Employee
10 replies posted 5 replies posted First reply posted
When the trap occurs the SW should go to the trap handler and break there (__debug instruction).
From the trap handler that is called you know the trap class. Corresponding Trap ID can be read from CPU register D15.
Details can be found in the TriCore architecture Manual.
0 Likes
User16898
Level 4
Level 4
ok I've go it:
trap class 4
TIN number 2
in tc1.6 architecture manual I found it's DSE - data Access synchronus Error.
But i still cannot figure out why this error occur if this address is proper.
0 Likes
MoD
Employee
Employee
50 likes received 500 replies posted 100 solutions authored
I think the problem is this line:
uint32* reserved_data_pointer = (uint32*)reserved_data;
here you set the pointer reserved_data_pointer to the content of reserved_data and then the reserved_data_pointer is set to an invalid address and the next line traps.
I am not sure what you will do but change the line to:
uint32* reserved_data_pointer = (uint32*)&reserved_data;
Maybe this solve the problem.
0 Likes
User16898
Level 4
Level 4
[HTML]During stand-by mode preparation, the user software must do the following:
• read sequentially 16 words from the “reserved area” in CPU0_DSPR starting at
address D000’2000H

• for any word check either it equals FFFF FFFFH or zero
– if yes - skip it and go to the next reserved location
– if no
- use this word as 32-bit address, read the data from that address and store this
data back into the same reserved location
- go to the next reserved location[/HTML]

here is said to use readed data as address so, I assume, reserved_data is an address itself.

uint32* reserved_data_pointer = (uint32*)&reserved_data;
and then reserved_data = *reserved_data_pointer.

Will has no effect, it's writing the same value again.
0 Likes