This is an automated email from Gerrit.

Nemui Trinomius ([email protected]) just uploaded a new patch set 
to Gerrit, which you can find at http://openocd.zylin.com/1784

-- gerrit

commit a848fd8c2a750d23f7bb8cdf65ffa259b72ee8be
Author: Nemui Trinomius <[email protected]>
Date:   Sat Oct 26 12:17:04 2013 +0900

    lpc2000: Fix flash programming fail on LPC4300 internal flash
    
    LPC43xx with internal flash parts model needs "IAP Init(49)"Command
    before erase & write internal flash.Tested on a LPC4337 and LPC4357.
    
    Change-Id: I48620ce12e578c61a3ca1adcd48815c1f71c35bb
    Signed-off-by: Nemui Trinomius <[email protected]>

diff --git a/src/flash/nor/lpc2000.c b/src/flash/nor/lpc2000.c
index 12814aa..aadb999 100644
--- a/src/flash/nor/lpc2000.c
+++ b/src/flash/nor/lpc2000.c
@@ -653,6 +653,10 @@ static int lpc2000_erase(struct flash_bank *bank, int 
first, int last)
        if (retval != ERROR_OK)
                return retval;
 
+       if (lpc2000_info->variant == lpc4300)
+               /* Init IAP Anyway */
+               lpc2000_iap_call(bank, iap_working_area, 49, param_table, 
result_table);
+
        /* Prepare sectors */
        int status_code = lpc2000_iap_call(bank, iap_working_area, 50, 
param_table, result_table);
        switch (status_code) {
@@ -781,6 +785,10 @@ static int lpc2000_write(struct flash_bank *bank, uint8_t 
*buffer, uint32_t offs
        uint32_t param_table[5] = {0};
        uint32_t result_table[4];
 
+       if (lpc2000_info->variant == lpc4300)
+               /* Init IAP Anyway */
+               lpc2000_iap_call(bank, iap_working_area, 49, param_table, 
result_table);
+
        while (bytes_remaining > 0) {
                uint32_t thisrun_bytes;
                if (bytes_remaining >= lpc2000_info->cmd51_max_buffer)

-- 

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to