Skip to main content
Visitor II
February 3, 2017
Question

STM32L4 XMODEM using USB CDC Interface

  • February 3, 2017
  • 1 reply
  • 843 views
Posted on February 03, 2017 at 17:57

I'm trying to implement an XMODEM file transfer through the USB CDC Interface on an STM32L4 processor in Full-Speed and seem to be having issues with XMODEM 132 byte packets getting split up and one of the middle packets getting resubmitted. I need to be able to NAK/ACK the XMODEM packets to keep the transfer going but this seems to sometimes mess up the submitting of the sub-packets causing me to get invalid data. Is there anyway to only trigger the CDC_Receive_FS function once all 132 bytes are received at the end point? Handling the separate packets from within the CDC_Receive_FS is causing problems because sometimes the broken up packets are being sent multiple times and there is no easy way of detecting a repeat.

I generated my code using the latest STM32 firmware for STM32CubeMX and am working in Keil.

#stm32-usb #usb-fs #usb-cdc #usb-vcp-stm32_usb-fs-device_lib #stm32l4
    This topic has been closed for replies.

    1 reply

    Explorer
    April 23, 2025

    Did you ever manage to get this working? I am currently starting the process of trying to set up xmodem with usb CDC and was hoping to find an existing project as a jumping off point to start with. I already have xmodem working with uart but the usb timing is throwing everything off.