Crash on register write

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

Crash on register write

547 Views
BrendanDoonan
Contributor III


I am using an i.MX6S, with 512MB RAM, which boots via u-boot off of an SD card.  I pause at the U-Boot prompt and attach to the processor through the JTAG port in order to run my code with the processor already set up.  I'm using GDB through Eclipse to view the code and debug it.  Everything seems to be in working order up to a certain point; I can view memory and registers correctly, step through code, etc.  However, as soon as I try to write certain registers, everything crashes.  The program counter walks off into ~0xffff0000.  What could be causing this type of behavior?  I am running in supervisor mode, which I have verified by looking at CPSR (0x600001d3).  The address in question is in a call to "mxc_init_l2x0", specifically this line:

writel(0x132, IO_ADDRESS_PTR(L2_BASE_ADDR + L2X0_TAG_LATENCY_CTRL));

This is trying to write the value 0x132 to address 0x00a02108.  If I look at that memory address, I can see that it is already set for that value, implying that U-Boot already set it up.  However, if I try to change the value at that address with the debugger, Eclipse tells me "Edit failed: Target request failed: Cannot access memory at address 0x00a02108"  If I let that line of code execute, the code crashes (presumably hitting a Data Abort exception).

Why can't I write registers?

Labels (4)
0 Kudos
2 Replies

440 Views
sinanakman
Senior Contributor III

Hi Brendan

You can use MEMACC in your BDI config file to bypasses MMU and cache.

Regards

Sinan Akman

0 Kudos

440 Views
Yuri
NXP Employee
NXP Employee

Hello,

   Are MMU and caches are enabled under U-boot ?

In such case some areas may be protected against changing.

Have a great day,
Yuri

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos