Rick Altherr wrote: > > On Nov 23, 2008, at 10:10 AM, Carlos Antunes wrote: > >> Rick Altherr wrote: >>> >>>> Debug: 298 216881 target.c:1787 target_wait_state(): waiting for >>>> target debug-running... >>> >>> This _appears_ to be coming from arm7_9_dcc_completion(). That >>> method is specified to be called at the end of an arm7_9 write >>> memory block. It is the only place in the arm7_9 code base where we >>> wait for that particular state. >>> >>>> Error: 300 217221 target.c:1794 target_wait_state(): timed out >>>> while waiting for target debug-running >>> >>> But we didn't hit that state in time. This probably has to do with >>> the fact that the device is already halted. This failure bubbles up >>> and causes the overall flash to fail. I don't have a arm7_9 based >>> device to test against, but I suggest someone step through the flash >>> routine and specifically the arm7_9 run algorithm code. >> >> I think I found the culprit. Not sure whether it's a bug or a >> feature, though... >> >> Function "arm7_9_dcc_completion" calls "target_wait_state" to expect >> TARGET_DEBUG_RUNNING. The function "target_wait_state" will >> eventually call "arm7_9_poll". If one jumps to "arm7_9_common.c:780", >> one can see that when "target->state" gets set to TARGET_HALTED if >> the polled state was TARGET_DEBUG_RUNNING. >> >> I changed the parameter of "target_wait_state" on >> "arm7_9_dcc_completion" to TARGET_HALTED and the error I was >> encountering is now gone. However, I am now getting a "DCC write >> failed, expected end address 0x4080804c got 0x4080004c" after a >> message of "Using target buffer at 0x4080004c and of size 0x8000" so >> I have a little bit more digging to do. >> > > That seems to imply that the target never resumed. That would explain > why it is in the halted state when dcc complete is called. Take a > careful look at the run_alogrithm_inner code and make sure that the > target is actually restarted after the PC has been written. >
Another bit of info: even with both "*arm7_9 fast_memory_access*" and "*arm7_9 dcc_downloads*" disable, nothing gets written to the flash. In this case, however, there is no error. The contents of the flash simply do not change. Carlos Antunes _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development