When I use the Y-modem protocol on stm32 board, I’m faced with data count bytes. There are two bytes on the frame, one byte is data count another is 0xFF-dataCount.

SOH 01 FE data[] 1A...1A CRCH CRCL

But I have a question on the this process; When I send 128 byte every process, than 8 byte data get max "255" = 0xFF value, So If I try to transmit 256+ data, I will face with problem because the data count value have one byte.

Why the data count 1 byte on the Y modem frames? If we use the 255+ data count frame what can I do?

  • \$\begingroup\$ You can either send 128 byte packets starting with SOH, or 1024 byte packets starting with STX. \$\endgroup\$
    – Codo
    Aug 23, 2021 at 6:55
  • \$\begingroup\$ @gogogo There is no block size sent in Ymodem packet. Or açtually the first byte defines the packet size. What you are asking about is a block count number, a running counter which increases for each block. \$\endgroup\$
    – Justme
    Aug 23, 2021 at 7:11
  • \$\begingroup\$ block count sorry \$\endgroup\$
    – gogogo
    Aug 23, 2021 at 7:13
  • \$\begingroup\$ So, If the block count byte equals = 00 and data include 1024 byte, Could we say the data count more than 255+ ? \$\endgroup\$
    – gogogo
    Aug 23, 2021 at 7:43

1 Answer 1


The block count increases by one each packet and it simply overflows and wraps around from 255 to 0. It reads in the YMODEM documentation.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.