STM32F302中的SWV - printf()具有不同的字符
我发现一些答案并没有解决我的 STM32F302 问题。 我将调试运行配置为 SWV ITM 数据控制台中的 printf()
:
我实现了 _write
函数,如下所示:
int _write(int file, char *ptr, int len)
{
int DataIdx;
for (DataIdx = 0; DataIdx < len; DataIdx++)
{
ITM_SendChar((*ptr++));
}
return len;
}
并尝试为“异步跟踪”和“串行线”设置系统时钟,但没有成功,而且我一直得到相同的结果输出(SWV Graph 也不起作用):
关于此问题有什么建议吗?我只想调试变量以确保获得正确的测量结果。
PS。我的项目简介:用于光传感器的 ADC。我需要根据激光样品测量生成图表。使用 STM32 和光电二极管进行测量,完成测量并将 .csv 或 .txt 从 USB 发送到计算机以分析数据。
I found some answers that didn't solve my issue for STM32F302.
I configured the debug run as follows, to printf()
in the SWV ITM Data Console:
I implemented the _write
function as follows:
int _write(int file, char *ptr, int len)
{
int DataIdx;
for (DataIdx = 0; DataIdx < len; DataIdx++)
{
ITM_SendChar((*ptr++));
}
return len;
}
And tried to setup the sys clock for "Asynchronous Trace" and "Serial Wire", none worked and I keep getting the same output (SWV Graph does not work either):
Any suggestion about this issue? I just want to debug the variable to make sure I'm getting the correct measurement.
PS. Just a brief of my project: An ADC for a light sensor. I need to generate a graph from a laser sample measurement. Make this measurement with the STM32 and a photodiode, finish the measurement and send the .csv or .txt from USB to a computer to analyse the data.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我发现我的问题是:
调试设置中的“核心时钟(MHz)”是错误的,这就是我的 SWV 无法正常工作的原因
I found what my problem was:
My "Core Clock (MHz)", in the debug settings, was wrong and that's why my SWV was not working properly
如果没有 SWV 数据 - 您需要将 SWO 引脚连接到 ST-LINKV2。 SWV 数据传输位于 SWO 引脚上。在我的 STM32F3DISCOVERY 上,SB10 没有焊接,SB10 将 PB3 SWO 引脚连接到 T_SWO 调试器网络。焊接后SB10 SWV 工作完美。
If no SWV data - you need to connect the SWO pin to ST-LINKV2. The SWV data transmission is on the SWO pin. On my STM32F3DISCOVERY, the SB10 was not soldered, SB10 connecting the PB3 SWO pin to the T_SWO debugger net. After soldering SB10 SWV work perfectly.