Skip to content

Conversation

@yangsong8-a1
Copy link
Contributor

Summary

This PR includes two improvements to the ymodem sbrb.py tool:

  1. Fix serial reliability issues: Add flush and reset input buffer operations when sending commands to ensure reliable ymodem transfer initiation over serial connections.
  2. Add bootloader burn support: When a device automatically enters ymodem rb mode at startup, the PC tool no longer needs to send the rb command. Instead, it waits for a specified number of consecutive 'C' characters before continuing with the ymodem protocol.

Impact

  • Stability: Improves reliability of ymodem transfers by properly clearing serial buffers
  • Compatibility: Adds new -c and -w options for bootloader burn scenarios without breaking existing functionality
  • Code Quality: Clean implementation following existing code patterns

Testing

Build Host: Ubuntu 22.04 x86_64
Target: tc4dx evb

Test Steps:

Functional test on real hardware (bootloader burn scenario):

  • Device enters ymodem rb mode automatically at boot
  • PC waits for 3 consecutive 'C' characters with 30s timeout
$ python3 sbrb.py -s /dev -t /dev/ttyUSB0 -b 230400 -k 16 -c 3 -w 30 vela_core0.bin
sending
name:vela_core0.bin filesize:1818624
100.0% 1818624:1818624 left:00h00m00s
time used:85.8s speed 20.7kB/s

 all time:85.82s average speed:20.7kB/s

These changes fix reliability issues when initiating ymodem transfers
over serial connections.

Signed-off-by: anjiahao <[email protected]>
If device automatically enters the ymodem rb mode when it starts up,
the PC tool does not need to send rb command anymore. Here, when a
specified number of consecutive 'C' are received, the subsequent
ymodem protocol content will continue.

Signed-off-by: wangxingxing <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants