Page 1 of 1

gdb and STM32F7 dcache

Posted: Sat Jun 02, 2018 1:13 pm
by tridge
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

Re: gdb and STM32F7 dcache

Posted: Sat Jun 02, 2018 2:25 pm
by Giovanni
Hi,

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

Giovanni