SerialUSB test port problem

未关闭
#52 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
arduino, cpp

调研方向

先从提供的 unity_config.h 和 unity_config.cpp 入手,然后检查 SerialUSB 的初始化方式,并将其与正常工作的 Serial1 路径进行比较。当 Unity 测试日志和结果能够通过 RP2040 USB 串行连接显示时,该 Issue 即得到解决。

由索引模型根据 Issue 内容生成。

描述

Hi,
I am developing a project with the rp2040 with arduino framework, and I have a problem with unity config and the USB serial logs for Unity tests. I cannot see the logs/results from my tests with USB, but I can monitor the SerialUSB logs in my main function.
Any advice?

I had the same problem in another project, but is working with a pio serial tx that I created, and here, it's working if I use Serial1 (gpio 0-1).

unity_config.h

#ifndef NATIVE

#ifndef UNITY_CONFIG_H
#define UNITY_CONFIG_H

#ifndef NULL

#ifndef __cplusplus
#define NULL (void *)0
#else
#define NULL 0
#endif

#endif

#ifdef __cplusplus
extern "C" {
#endif

void unityOutputStart();
void unityOutputChar(char);
void unityOutputFlush();
void unityOutputComplete();

#define UNITY_OUTPUT_START() unityOutputStart()
#define UNITY_OUTPUT_CHAR(a) unityOutputChar(a)
#define UNITY_OUTPUT_FLUSH() unityOutputFlush()
#define UNITY_OUTPUT_COMPLETE() unityOutputComplete()

#ifdef __cplusplus
}
#endif /* extern "C" */

#endif /* UNITY_CONFIG_H */

#endif

unity_config.cpp

#ifndef NATIVE

#include "unity_config.h"

#include <Arduino.h>

void unityOutputStart() { SerialUSB.begin(115200); }
void unityOutputChar(char c) { SerialUSB.write(c); }
void unityOutputFlush() { SerialUSB.flush(); }
void unityOutputComplete() {}

#endif


主要语言
Python
星标
96
派生
142
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

platformio/platform-raspberrypi 的其他 Issue

查看 platformio/platform-raspberrypi 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。