How to call ITM_SendChar with STM32H755 dual-core MCU, but on CM4 side.
Hello all,
I am new for STM32 dual-core MCUs(Nucleo-H755ZI-Q is used). By following the guides(reference manuals, application notes...) I have been successfully sent characters to SWO with following call graph on Cortex-M7: ITM_SendChar() <- _write() <- printf. On the PC/STM32CubeIDE side, those characters have been printed to "SWV ITM Data Console" without any issue.
But... now I am willing to use the same SWO pin for printing the characters from Cortex-M4 side. After reading some guides. Seems I have got the following information:
- There is a register called "SWTF_CTRL" should be used for controlling which core would be connected to SWO, by using ENS0 and ENS1 bit. (Source: Page 3353-3354, §63.5.7, RM0399 Rev 4. Published on June 2023).
- SWO should be only connected to one core at a time. And the connection bits ENSx should only be modified before trace is enabled. (Source: Page 3341, §63.5.7, RM0399 Rev 4. Published on June 2023).
By also referencing Figure. 870 from RM0399. So if I understood this correctly, the following items are all true:
- It's not able to dynamically connect TRACESWO pin to different cores to get printf characters, once the application is started in debug mode.
- ENSx bit should be only changed before some startup code.(Question: I have searched the whole project with e.g. ENS1 or ENS0 keywords, but no results.... Where is the location ENSx bits are set?)
So conclusion: What I would like to write a debug library, which could be used to print from both cores into SWO will never work... (Is that true?)
Thanks!