MPC5646C RAM read using BAM

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

MPC5646C RAM read using BAM

Jump to solution
166 Views
BorisB
Contributor I

Hi,

I am trying to read the internal RAM using the BAM module, via the UART

The problem is that there is a repeating pattern in the received file, that doesn't look correct.

This is the code i am using.

 

#define RAM_BASE    0x40000000
#define RAM_SIZE    256*1024
#define RAM_END     RAM_BASE + RAM_SIZE    

int main(void) {

  int32_t  i = 0, r = 0;
  uint32_t word = 0x00;

			      				      			      
  InitHW();    
  InitializeUART(kBaud500000);	

        
  /* Start the other core */   
  SSCM.DPMBOOT.R = (unsigned long)__start_p1;
  SSCM.DPMKEY.R  = (unsigned long)0x00005AF0;
  SSCM.DPMKEY.R  = (unsigned long)0x0000A50F;

  for (;;)
  {   
  	for (i = RAM_BASE; i <  RAM_END; i+= 4)
  	{
  		word = *(uint32_t*) i;
  		uart_print_int(word);
  	}

  	delay_100ms(1);
  }
}

 

the pattern i am getting is:

00 00 20 7E 04 00 00 00 20 4E 04 00 00 00 10 0E 
00 00 00 00 00 00 04 00 00 03 30 00 04 00 00 09 
F0 DC 0F F0 F5 00 00 00 04 00 00 00 50 F0 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 04 00 00 02 60 00 00 00 00 00 70 CA 04 00 
00 09 F0 D0 04 00 00 00 10 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 
00 00 20 7E 04 00 00 00 20 4E 04 00 00 00 10 0E 
00 00 00 00 00 00 04 00 00 03 30 00 04 00 00 09 
F0 DC 0F F0 F5 00 00 00 04 00 00 00 50 F0 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 04 00 00 02 60 80 00 00 00 00 70 CA 04 00 
00 09 F0 D0 04 00 00 00 10 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 
00 00 20 7E 04 00 00 00 20 4E 04 00 00 00 10 0E 
00 00 00 00 00 00 04 00 00 03 30 00 04 00 00 09 
F0 DC 0F F0 F5 00 00 00 04 00 00 00 50 F0 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 04 00 00 02 70 00 00 00 00 00 70 CA 04 00 
00 09 F0 D0 04 00 00 00 10 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 
00 00 20 7E 04 00 00 00 20 4E 04 00 00 00 10 0E 
00 00 00 00 00 00 04 00 00 03 30 00 04 00 00 09 
F0 DC 0F F0 F5 00 00 00 04 00 00 00 50 F0 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 04 00 00 02 70 80 00 00 00 00 70 CA 04 00 
00 09 F0 D0 04 00 00 00 10 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 
00 00 20 7E 04 00 00 00 20 4E 04 00 00 00 10 0E 
00 00 00 00 00 00 04 00 00 03 30 00 04 00 00 09 
F0 DC 0F F0 F5 00 00 00 04 00 00 00 50 F0 00 00 

 

Is this supposed to be normal, or i am getting something wrong. Its a new processor, an empty one, isn't it supposed to be empty.

0 Kudos
Reply
1 Solution
134 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @BorisB 

RAM memory contains random data after power on. It must be initialized:

lukaszadrapa_0-1718861515281.png

 

lukaszadrapa_1-1718861520748.png

 It's done in startup code like this:

lukaszadrapa_2-1718861539171.png

 

stmw instruction is used - it writes all GPR core registers to RAM in a loop. That's the reason why you can see such pattern in the RAM.

Regards,

Lukas

 

View solution in original post

0 Kudos
Reply
1 Reply
135 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @BorisB 

RAM memory contains random data after power on. It must be initialized:

lukaszadrapa_0-1718861515281.png

 

lukaszadrapa_1-1718861520748.png

 It's done in startup code like this:

lukaszadrapa_2-1718861539171.png

 

stmw instruction is used - it writes all GPR core registers to RAM in a loop. That's the reason why you can see such pattern in the RAM.

Regards,

Lukas

 

0 Kudos
Reply