MP1 SWD access probably tristates all GPIO sometimes
I'm testing STM32MP157A for our new projects. The MPU VCC is 1V8, USB is 3V3. Debugger is connected to two SWD pins. One of first test is:
- boot into DFU loader, upload simple code to 0x2ffc2500:
S_GPIO_ALT(GPIOA,13,2);
S_GPIO_ALT(GPIOA,14,2);
RCC->MCO1CFGR = 0x10f0;
RCC->MCO2CFGR = 0x10f0;
for (;;);- S_* are obvious macros setting MODER and ALT registers
- the code is uploaded by dfu-util -d 0483:df11 -a 1 -D boot_test.stm32
So far so good, code is started, I can see 4 and 25MHz at PA13/14.
in openocd I did:
> bp 0x2ffc25e0 4 hw
breakpoint set at 0x2ffc25e0
stm32mp15x.cpu0 rev 5, partnum c07, arch f, variant 0, implementor 41
stm32mp15x.cpu0: MPIDR level2 0, cluster 0, core 0, multi core, no SMT
target halted in ARM state due to breakpoint, current mode: Supervisor
cpsr: 0x400001d3 pc: 0x2ffc25e0
MMU: disabled, D-Cache: disabled, I-Cache: disabledIt seems ok. I tested AXI access, confirmed that I'm in TZ secure state, can read even ROM firmware.
Openocd polls MP1 every 100ms by 2 SWD register reads (blue), MCOs are stable (yellow):

Ok, I reset, reupluad code, all the same way, but now, no breakpoint, let's use halt:
> halt
stm32mp15x.cpu0 rev 5, partnum c07, arch f, variant 0, implementor 41
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x400001d3 pc: 0x2ffc25e0
MMU: disabled, D-Cache: disabled, I-Cache: disabledIt seems the same as before (it should). But wait, what is this:

MCO outputs are no longer there, when MPU is in halt ! Even more interesting is,
outputs are on every 100ms - each SWD register read turns GPIOs back on for a while but then they are off again.
What I tested:
- other GPIO (PA8) because PA13/14 are a bit special (DBG outputs possible as AF0)
- plain GPIO output, when I send "1" it sometimes goes to 0 or Z
- resume of MPU makes it ok
- reading of GPIO regs reveals that its programing have not changed
- using JTAG instead of SWD solves it too
It seems as if there is another asynchronous signal in the SoC which can manipulate GPIOs
and SWD somehow affects it.
The behavior is strange and we'd like to find what causes it, before we decide on this SoC.
Thanks, Martin
