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. Ideas and especially patches are very much appreciated! :) Thanks! Carlos Antunes _______________________________________________ Openocd-development mailing list [email protected] https://lists.berlios.de/mailman/listinfo/openocd-development
