This is an automated email from Gerrit.

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

-- gerrit

commit 1aae0f372466ef6fe8024fda7d0a94919e3f0b1e
Author: Tomas Vanek <[email protected]>
Date:   Fri Oct 16 21:00:29 2015 +0200

    at91samd: SAML, SAMC families need zero MANW bit before flash write
    
    Writing to flash did not work on SAMC (and according to reference
    manual on SAML as well). NVMCTRL.CTRLB sets MANW bit at device reset.
    Resetting this bit in samd_issue_nvmctrl_command() resolves the problem.
    
    Change-Id: I3916eed4ffca81ae20f5172e533c8f0ad2640f4a
    Signed-off-by: Tomas Vanek <[email protected]>

diff --git a/src/flash/nor/at91samd.c b/src/flash/nor/at91samd.c
index a4cc51d..2a29c71 100644
--- a/src/flash/nor/at91samd.c
+++ b/src/flash/nor/at91samd.c
@@ -417,6 +417,9 @@ static int samd_issue_nvmctrl_command(struct target 
*target, uint16_t cmd)
        if (res != ERROR_OK)
                return res;
 
+       /* Clear MANW bit */
+       tmp &= ~(1<<7);
+
        /* Set cache disable. */
        res = target_write_u16(target, SAMD_NVMCTRL + SAMD_NVMCTRL_CTRLB,
                        tmp | (1<<18));

-- 

------------------------------------------------------------------------------
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to