Hi there,

I want to propose a patch file (see 0001-Add-virtual-flash-bank-to-
XMC4xxx-jtag-config.patch) and don't know how to upload it to your
Server. So I hope it is ok to send it here.

The patches fixes breakpoints on the XMC4800. Without this fix
breakpoints are ignored. I also attached the mail where the change was
suggested and explained (from a collegue who asked last year on this
mailing list).

I don't know whether this is needed for all xmc4xxx boards or only for
the XMC4800. In case of the latter, the line should probably go into
tcl/board/xmc4800-relax.cfg instead.

How to proceed now?

Regards
Jonatan
--- Begin Message ---
Perfect, thank you! Solution 3 worked for me, I added the separate
virtual Flash bank and hardware breakpoints were used automatically.

Matthias

On 06.11.19 14:01, Andreas Fritiofson wrote:
>
>
> On Wed, Nov 6, 2019 at 1:37 PM Matthias Stadler
> <matthias.stad...@medineering.de
> <mailto:matthias.stad...@medineering.de>> wrote:
>
>     I tried hbreak instead of break, and it worked. I'm using the
>     configuration file "xmc4800-relax.cfg" which refers to "xmc4xxx.cfg",
>     both from OpenOCD.
>     How can I define the flash range correctly?
>
>     I found in "xmc4xxx.cfg" line 54:
>     flash bank $_FLASHNAME xmc4xxx 0x0C000000 0 0 0 $_TARGETNAME
>
>     But I don't have a clue how to fix it.
>
>     Thanks a lot!
>     Matthias
>
>
> It seems the XMC4800 mirrors the flash bank into a cached region at
> 0x08000000 and an uncached region at 0x0c000000. OpenOCD apparently
> defines the uncached region only, for some reason. I'm not sure if
> that is a requirement for proper operationĀ of the flash driver but I
> don't think you're using OpenOCD to flash anyway, since it wouldn't
> work with an ELF file linked to execute from 0x08000000.
>
> So what you can do is to either
>
> 1. Link and execute your program starting from 0x0c000000, with the
> performance hit that may bring.
> 2. Change the start address of the flash bank to 0x08000000 and hope
> that the xmc4xxx flash driver can handle it correctly.
> 3. Add a separate virtual flash bank covering 0x08000000 and forward
> which will act as a proxy for the other flash bank:
>
> flash bank $_FLASHNAME.cacheable virtual 0x08000000 0 0 0 $_TARGETNAME
> $_FLASHNAME
>
> 3 is the best solution, if it works.
>
> /Andreas


_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


--- End Message ---
From 7bbe7076c15320212462766fbdfb49541b002453 Mon Sep 17 00:00:00 2001
From: Jonatan Hatakeyama Zeidler <jonatan.zeid...@medineering.de>
Date: Fri, 9 Oct 2020 13:57:34 +0200
Subject: [PATCH] Add virtual flash bank to XMC4xxx jtag config

---
 tcl/target/xmc4xxx.cfg | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tcl/target/xmc4xxx.cfg b/tcl/target/xmc4xxx.cfg
index 3020b28b0..2151808fc 100644
--- a/tcl/target/xmc4xxx.cfg
+++ b/tcl/target/xmc4xxx.cfg
@@ -52,6 +52,7 @@ $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE
 
 set _FLASHNAME $_CHIPNAME.flash
 flash bank $_FLASHNAME xmc4xxx 0x0C000000 0 0 0 $_TARGETNAME
+flash bank $_FLASHNAME.cacheable virtual 0x08000000 0 0 0 $_TARGETNAME $_FLASHNAME
 
 if { ![using_hla] } {
 	cortex_m reset_config sysresetreq
-- 
2.25.1

_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to