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.
Solved! Go to Solution.
Hi @BorisB
RAM memory contains random data after power on. It must be initialized:
It's done in startup code like this:
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
Hi @BorisB
RAM memory contains random data after power on. It must be initialized:
It's done in startup code like this:
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