gdb and STM32F7 dcache

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

Moderator: RoccoMarco

Post Reply
tridge
Posts: 141
Joined: Mon Sep 25, 2017 8:27 am
Has thanked: 10 times
Been thanked: 20 times

gdb and STM32F7 dcache

Post 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
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: gdb and STM32F7 dcache

Post by Giovanni »

Hi,

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

Giovanni
Post Reply