This is an automated email from Gerrit.

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

-- gerrit

commit 8f04f2432dc4cc19a670babc22e0c8504185cb52
Author: Keith Packard <[email protected]>
Date:   Thu Jun 27 21:41:22 2019 -0700

    flash/at91samd: Use 32-bit writes to NVMCTRL regs for STLink support
    
    STLinkv2 doesn't support 16-bit writes, so openocd emulates them with
    two 8-bit writes. Because the nvmctrl ctrla register must be written
    atomically, the two 8-bit writes always fail. Instead, use a 32-bit
    write; the 16 bits after this register are not implemented and so this
    is harmless.
    
    Change-Id: Id95cc781c583deba95b9d0e7dd960c33949d9f7d
    Signed-off-by: Keith Packard <[email protected]>

diff --git a/src/flash/nor/at91samd.c b/src/flash/nor/at91samd.c
index b6cff9a..a56be86 100644
--- a/src/flash/nor/at91samd.c
+++ b/src/flash/nor/at91samd.c
@@ -517,7 +517,7 @@ static int samd_check_error(struct target *target)
        }
 
        /* Clear the error conditions by writing a one to them */
-       ret2 = target_write_u16(target,
+       ret2 = target_write_u32(target,
                        SAMD_NVMCTRL + SAMD_NVMCTRL_STATUS, status);
        if (ret2 != ERROR_OK)
                LOG_ERROR("Can't clear NVM error conditions");
@@ -535,7 +535,7 @@ static int samd_issue_nvmctrl_command(struct target 
*target, uint16_t cmd)
        }
 
        /* Issue the NVM command */
-       res = target_write_u16(target,
+       res = target_write_u32(target,
                        SAMD_NVMCTRL + SAMD_NVMCTRL_CTRLA, SAMD_NVM_CMD(cmd));
        if (res != ERROR_OK)
                return res;

-- 


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

Reply via email to