This is an automated email from Gerrit.

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

-- gerrit

commit 3b347b825ea151eafdbc1d67b47c14a3d6858f7e
Author: Marc Schink <[email protected]>
Date:   Fri Jun 14 08:16:19 2019 +0200

    target/cortex_m: Add support for AHB5-AP
    
    The AHB5-AP is implemented in Cortex-M23/33 based devices.
    
    Change-Id: I505954a2e2c6462ce0aa96eba1d55b016c5028b9
    Signed-off-by: Marc Schink <[email protected]>

diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c
index 1fe14d7..d9399bb 100644
--- a/src/target/cortex_m.c
+++ b/src/target/cortex_m.c
@@ -2070,6 +2070,14 @@ static void cortex_m_dwt_free(struct target *target)
 #define MVFR1_DEFAULT_M7_SP 0x11000011
 #define MVFR1_DEFAULT_M7_DP 0x12000011
 
+static int find_mem_ap(struct adiv5_dap *swjdp, struct adiv5_ap **debug_ap)
+{
+       if (dap_find_ap(swjdp, AP_TYPE_AHB3_AP, debug_ap) == ERROR_OK)
+               return ERROR_OK;
+
+       return dap_find_ap(swjdp, AP_TYPE_AHB5_AP, debug_ap);
+}
+
 int cortex_m_examine(struct target *target)
 {
        int retval;
@@ -2084,7 +2092,7 @@ int cortex_m_examine(struct target *target)
        if (!armv7m->stlink) {
                if (cortex_m->apsel == DP_APSEL_INVALID) {
                        /* Search for the MEM-AP */
-                       retval = dap_find_ap(swjdp, AP_TYPE_AHB3_AP, 
&armv7m->debug_ap);
+                       retval = find_mem_ap(swjdp, &armv7m->debug_ap);
                        if (retval != ERROR_OK) {
                                LOG_ERROR("Could not find MEM-AP to control the 
core");
                                return retval;

-- 


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

Reply via email to