On Oct 31, 2008, at 8:55 PM, Rick Altherr wrote:


On Oct 31, 2008, at 2:35 AM, Øyvind Harboe wrote:

The attached patch will address *some* of the problems you have
found.

If you can help with testing and get this committed, perhaps we can
see more clearly  what's going on once the first couple of bugs
are fixed.

The attached patch improves error handling.

Testing is needed for each point below:

1. if writing memory arguments fails, run_algorithm will now fail
early. An error
should be reported and displayed properly.

I haven't encountered this failure condition so I can't try it.


2. if running the algorithm failed, e.g. w/unexpected exit point, then there
shouldn't be a dangling breakpoint anymore. An error
should be reported and displayed properly.

This error condition was encountered, but since the target failed to halt, the breakpoint removal fails as well. I've attached an updated patch that fixes the error checking in armv7m_run_and_wait() and ensures that the target is halted even if the breakpoint fails. I also fixed the logic in the flash_write_block_command so the status message about the number of bytes transferred and transfer rate happens on success rather than failure of flashing.


3. Do you have a case where running the algorithm *does* work that you
can run as a regression test?

The known working cases seem to still be functional.



Thanks!

--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
<cortexfixrunalgorithm.txt>

<openocd-armv7m-run_alogrithm-error-checking.patch>
--
Rick Altherr
[EMAIL PROTECTED]

"He said he hadn't had a byte in three days. I had a short, so I split it with him."
-- Slashdot signature


_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Found the source of the problems with Cortex-M3 parts. In cortex_m3_resume if debug_execution is non-zero, the PRIMASK and xSPR are modified. The problem is that while the register value is changed, it isn't marked valid or dirty. So, when armv7m_restore_context() is called later, PRIMASK and xSPR aren't written to the device. By marking them valid and dirty, flashing an LM36965 works every time.

Attachment: openocd-cortex-resume-interrupt-fix.patch
Description: Binary data



--
Rick Altherr
[EMAIL PROTECTED]

"He said he hadn't had a byte in three days. I had a short, so I split it with him."
 -- Slashdot signature


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to