gdb and STM32F7 dcache

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: RoccoMarco, barthess

tridge
Posts: 141
Joined: Mon Sep 25, 2017 8:27 am
Location: Canberra, Australia
Has thanked: 10 times
Been thanked: 20 times
Contact:

gdb and STM32F7 dcache

Postby tridge » Sat Jun 02, 2018 1:13 pm

I'm discovering the joys of the STM32F7 dcache at the moment. For best performance I've setup all normal memory (including data, bss and primary heap) in SRAM so it benefits from the cache, and use a malloc_dma() method to allocate from a heap in DTCM.
One thing I've found very annoying is that gdb on openocd doesn't see into the dcache. It took me ages to work out why ch.dbg.panic_reason was always zero after a chSysHalt() - it was because it was cached. I've fixed that by doing:
dmaBufferFlush(0x20020000, 0x60000);
in chSysHalt(), but I'm wondering if anyone has a more elegant solution? Can openocd be taught to snoop the dcache?
I'm using a STM32F765 if it matters.
Cheers, Tridge

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: gdb and STM32F7 dcache

Postby Giovanni » Sat Jun 02, 2018 2:25 pm

Hi,

You could put that in the halt hook, see chconf.h.

Giovanni


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 54 guests