Forum Discussion
Altera_Forum
Honored Contributor
19 years agoScott,
I tried a simple experiment to see if my hunch about interrupts was right. I have edited the code in command/cmd_mem.c to change the function do_mem_cp(). What I have done is disable the interrupts just before the cp command copies the data. I have left the interrupts disabled:int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv)
{
..
..
// MJS: try disabling interrupts
disable_interrupts();
while (count-- > 0) {
if (size == 4)
*((ulong *)dest) = *((ulong *)addr);
else if (size == 2)
*((ushort *)dest) = *((ushort *)addr);
else
*((u_char *)dest) = *((u_char *)addr);
addr += size;
dest += size;
}
return 0;
} I then typed these commands into u-boot: cp 0x00050000 0x02000020 0x40000 go 0x02000154 and was very surprised to find that it now works perfectly! If I remove the line which disables the interrupts then u-boot crashes and resets after I send the cp command. What does u-boot use interrupts for anyway? Timers for the timeouts perhaps? I am sure my quick and dirty fix here will have some serious side-effects somewhere else! Mike