cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-F767ZIand Serial Wire Viewer

Radu Ghiga
Associate II
Posted on April 23, 2018 at 13:09

Hello all,

I am pretty new to the STM32 MCUs and I am trying to get around and learn new things. I have found a few tutorials presenting the SWV and it seems really good to be able to use it. However, even following the tutorials, I have no output in the SWV Console so I am asking for your help.

My setup:

NUCLEO-F767ZI

Matlab/Simulink 2017b with STM32 Adapter support package.

STM32CubeMX

TrueSTUDIO

My issue:

First: I have made a very simple project, generated with CubeMX only, where I enabled the 'Debug: Serial Wire' under SYS. I imported it in TrueSTUDIO and in main.c I wrote a line 'ITM_SendChar(65);' to send to ITM channel 0 the character 'A'. Everything build fine and I don't get any errors.

Next: I opened Debug Configurations in TrueSTUDIO and I enabled Serial Wire Viewer (SWV), and I set the Core CLock to 216.0 MHz. Default Port number: 61234. SWO Clock is automatically set to 2000 kHz.

Then: I start the debugger, and everything seems fine. I open the SWV configuration and select Port 0. I click 'Ok', I click on the 'Start Trace' button, and I run the program expecting to see 'A' in the SWV Port 0 console. But I have no output.

I ran the code line by line and it enters the ITM_SendChar function and it executes it fine. I also checkked the PB3 pin and the CN6 (Pin6 - SWO) pin with an oscilloscope and everytime the ITM_SendChar reaches the send line, I get the same signal on these 2 pins so my uinderstanding is that the code is executing the send, but it seems the SWV console does not receive it.

Any Ideas and/or suggestions on what to try next would be appreciated.

The SWO pin is connected via SB110 on the back of my nucleo board.

Thank you in advance for your time and help

#swd #debug #nucleo-f767zi #truestudio #swv
10 REPLIES 10
Posted on April 24, 2018 at 07:26

Hello,

radu.ghiga

Could you please give me more information?

If you provide a little test case if possible or at least an simulink file.

Thanks.

Radu Ghiga
Associate II
Posted on April 24, 2018 at 15:45

Hello Aimagin Co., Ltd.

Thank you for your reply.

For now I have excluded the Simulink code generation in order to try and reduce the issue to a minimum. So I only use CubeMX to generate the TrueSTUDIO project with the initialization code. So the only extra line I add to the project, in the main.c, is 'ITM_SendChar(65);'  Everything builds fine, and executes fine but I still don't see anything in the SWV Console.

I have also installed EWARM, and I generated a project for this IDE with CubeMX. I have added the same ITM_SendCHar(65); line in main.c and surprise! The Terminal I/O prints A every time the ITM_SendChar is executed. Therefore, now I know this can actually work. I just don't know why can't I use it with TrueSTUDIO. 

Is it possible to upload files here? I could upload a .zip file with the .ioc and the generated project.

Thanks in advance!

Posted on April 26, 2018 at 05:59

Yes, you can upload files here.

Posted on April 26, 2018 at 07:04

I have attached the TrueSTUDIO project,and the .ioc configuration file. In main.c I have the 3 lines that I added, the rest is generated by STM32CubeMX.

The lines are:

Line 75: char data2send = 'A';

Line 107: ITM_SendChar(data2send);

Line 108: HAL_Delay(1000);

________________

Attachments :

SWO.7z.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HxfN&d=%2Fa%2F0X0000000b0j%2FjL4JhN7c4srPuHviBCOm3R0vkKg2rc9uUxLc6VM0Vpk&asPdf=false
Jan Lundskov
Associate
Posted on May 06, 2018 at 22:20

Hello,

I have the exact same problem as Radu Ghiga has. I followed all instruction sin the video tutorials, but nothing shows in the console. Did you find a solution?

Thanks in advance.

BR. Jan

Posted on May 07, 2018 at 09:10

Hello Jan Lundskov,

Unfortunately, I did not find a solution yet, and I have tried everything I could find online. What I did to monitor variables in real time was to install STM Studio load the .elf file which also has the symbols definition, and find in the list the variable I wanted to see and send it to one of the plots. Although this is better than nothing, I would still like to be able to see what is going on while I am in the debug mode in TrueStudio for STM32. 

If I manage to get it working, I will post here.

Thanks,

Radu

Posted on May 07, 2018 at 09:36

Hello Radu,

Thank you for your reply and for introducing me to STM Studio. It looks like a nice tool. I will try that.

Have you tried the Dynamic printf feature to monitor a variable? I can get it to work, but the SWV would be a good feature to have while debugging.

Let me know if you find a solution:-)

Regards,

Jan

Den 7. maj 2018 kl. 09.12 skrev Radu Ghiga <st-microelectronics@jiveon.com<mailto:st-microelectronics@jiveon.com>>:

STMicroelectronics Community <https://community.st.com/?et=watches.email.thread>

Re: NUCLEO-F767ZIand Serial Wire Viewer

reply from Radu Ghiga<https://community.st.com/0D70X000006SwXXSA0

g. lewis
Associate II
Posted on May 10, 2018 at 11:33

Is the serial wire viewer now available in the TrueSTUDIO none pro version?

Posted on May 10, 2018 at 12:31

Hello g.lewis,

As far as I understood, TrueSTUDIO for STM32 comes with all the Pro version tools. Since I am using an STM32 this is the one I downloaded and I am currently using.

Cheers,

Radu