2023-11-05 01:18 PM - edited 2023-11-06 02:58 AM
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!
2023-11-05 01:42 PM - edited 2023-11-05 01:43 PM
Some interesting findings:
Here is DEBUG setup from STM32CubeMX(version 6.9.2). Seems the TRACESWO could only be connected to ARM Cortex-M7(There is no Cortex-M4 options. And DEBUG module has been enabled from both M7 and M4 core in CubeMX)...
Could be a bug in CubeMX?
2023-11-16 09:38 AM
Hello @Leon_MS ,
Thank you for your feedback.
An internal ticket 166529 has been reported about CubeMX.
Further explanation is detailed in your thread Solved: Best practices for instrumentation logging with du... - STMicroelectronics Community
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-11-16 10:42 PM
Thanks @FBL !