Hi!

The current stm32h7x.cfg target script supports only tpiu with non-hla adapters due to hla single ap limitation. There is a workaround for that, as the swo and tpiu are available at another address space via the main ap0.


I propose adding for non-hla adapters the following configuation:

  swo  create $_CHIPNAME.swo  -dap $_CHIPNAME.dap -ap-num 0 -baseaddr 0x5C003000   tpiu create $_CHIPNAME.tpiu -dap $_CHIPNAME.dap -ap-num 0 -baseaddr 0x5C015000

In addition to those lines, the examine-end script needs one change and 2 additions:

  # DBGMCU_CR |= TRACECLKEN | D1DBGCKEN | D3DBGCKEN
  stm32h7x_dbgmcu_mmw 0x004 0x00700000 0

  # Unlock SWO_LAR and SWTF_LAR
  mww 0x2FB0 0xC5ACCE55
  mww 0x3FB0 0xC5ACCE55


Using that, I can send debug data to SWO using ITM_SendChar(), set up swo output with "tpiu config internal - uart off 96000000" ; "itm ports on" and listen with SWO-Parser, using STLink v2 as debugger.


PS. The SWO stuff runs from PLL1R when the system runs on PLL. If PLL1R clock output is not enabled, the debug interface inside mcu will lock up on swo register access and stay so until next power cycle.


--

Anti Sullin

Principal Software Engineer

Starship Technologies LLC


Reply via email to