Repository navigation
[utilities][ymodem] Resolve the compatibility issues with receiving files via the YMODEM protocol - #12051
[utilities][ymodem] Resolve the compatibility issues with receiving files via the YMODEM protocol#12051lvtaolong wants to merge 1 commit into
Conversation
add 40ms delay between in sending ACK and sending C character
|
|
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
📌 Code Review Assignment🏷️ Tag: componentsReviewers: @Maihuanyi Changed Files (Click to expand)
🏷️ Tag: components_utilities_ymodemReviewers: @wdfk-prog Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2026-11-12 18:26 CST)
📝 Review Instructions
|
There was a problem hiding this comment.
已核对改动仅在第二个 EOT 后的 ACK 与 C 之间增加线程延时。作者已提供 STM32 板端验证记录;已批准此前待运行的仓库 CI,CLA 仍未签署。当前单一提交无需压缩,请把 Update ymodem.c 改为有模块前缀且说明行为的标题,例如 [utilities][ymodem] Delay the final C for sender compatibility。补充 CI 诊断:静态分析运行 https://github.com/RT-Thread/rt-thread/actions/runs/43193723997 的错误位于未修改的 K230 PWM、var_export 和本分支不存在的路径,ymodem.c 自身没有报告错误。精确 head 的 format_ignore.py 使用 get_changed_files(HEAD, origin/master),git_utils.py 直接对两个端点做 git diff,因主线推进把主线新增/修改也加入了本分支待扫描列表。建议先同步主线后重新检查,或由 CI 维护者修正 PR 文件选择范围;本次不把这些错误归因于新增的 YMODEM 延时。
| * or interrupt handling, one of the two bytes may get swallowed (e.g. only 0x06 is read and 0x43 is missed). | ||
| * So add 40ms delay here. | ||
| */ | ||
| rt_thread_mdelay(40); |
There was a problem hiding this comment.
[建议] 请补充复现所用发送工具及版本、波特率,以及 40 ms 的选择依据,并确认连续文件和标准发送端在加入间隔后均能完成最后一个空包握手。这里对所有调用者固定增加一次延时,保留明确的兼容性测试条件有助于后续维护,避免仅用“字节粘连”解释发送端读取问题。
|
赞同 |
|
add 40ms delay between in sending ACK and sending C character
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
通过ymodem协议发送文件给单板的功能,当接收方在收到第二个EOT后,要发送ACK和C字符,但是发送两个字符之前没有延迟,如果两者间隔时间极短,而发送方的串口驱动的超时时间或中断处理不当,可能导致吞掉了其中某一个字节(比如只读到了 0x06,漏掉了 0x43),最终导致发送方认为用ymodem发送文件失败了。
你的解决方案是什么 (what is your solution)
在_rym_putchar(ctx, RYM_CODE_ACK)--发送ACK字符和_rym_putchar(ctx, RYM_CODE_C)--发送C字符之间插入40ms的延时
请提供验证的bsp和config (provide the config and bsp)
修改前后的固件版本在stm32f427 MCU的单板上测试通过,确认该修改能解决问题。
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up