cancel
Showing results for 
Search instead for 
Did you mean: 

How to call ITM_SendChar with STM32H755 dual-core MCU, but on CM4 side.

Leon_MS
Associate III

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!

3 REPLIES 3
Leon_MS
Associate III

Some interesting findings:

Leon_MS_0-1699220377480.png

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?

 

FBL
ST Employee

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.

Leon_MS
Associate III

Thanks @FBL !