Please try the attached patch.

It may fix your problem with not being able to write to flash
without setting up working area.


-- 
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
Index: C:/workspace/openocd/src/flash/cfi.c
===================================================================
--- C:/workspace/openocd/src/flash/cfi.c        (revision 708)
+++ C:/workspace/openocd/src/flash/cfi.c        (working copy)
@@ -1738,6 +1738,7 @@
                        /* fall back to memory writes */
                        while (count >= bank->bus_width)
                        {
+                               int fallback;
                                if ((write_p & 0xff) == 0)
                                {
                                        LOG_INFO("Programming at %08x, count 
%08x bytes remaining", write_p, count);
@@ -1742,17 +1743,20 @@
                                {
                                        LOG_INFO("Programming at %08x, count 
%08x bytes remaining", write_p, count);
                                }
+                               fallback = 1;
                                if ((bufferwsize > 0) && (count >= buffersize) 
&& !(write_p & buffermask))
                                {
                                        retval = cfi_write_words(bank, buffer, 
bufferwsize, write_p);
-                                       if (retval != ERROR_OK)
-                                               return retval;
-
-                                       buffer += buffersize;
-                                       write_p += buffersize;
-                                       count -= buffersize;
+                                       if (retval == ERROR_OK)
+                                       {
+                                               buffer += buffersize;
+                                               write_p += buffersize;
+                                               count -= buffersize;
+                                               fallback=0;
+                                       }
                                }
-                               else
+                               /* try the slow way? */
+                               if (fallback)
                                {
                                        for (i = 0; i < bank->bus_width; i++)
                                                current_word[i] = 0;
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to