Skip to main content
Justin K.
Associate II
July 6, 2018
Question

Does anyone have an example project using IAP with VCP?

  • July 6, 2018
  • 5 replies
  • 1528 views
Posted on July 06, 2018 at 21:51

Hi everyone,

I'm trying to get IAP driver working on my STM32F072C8T6 with USB VCP. I saw an example code for STM32LX IAP projects with ymodem but I thought I would ask around first in case someone already has working code. In the meantime, I'll be trying to get the example code working with my MCU using USB VCP and update in the post if I do manage to get it to work in case someone needs the same functionality.

Thank you.

    This topic has been closed for replies.

    5 replies

    Tesla DeLorean
    Guru
    July 6, 2018
    Posted on July 06, 2018 at 22:21

    Presumably a VCP implemented on the F072, not the one on the ST-LINK? In which case you'd want to buffer the Rx and TX traffic and manage the Y-Modem/IAP within the while() loop.

    I think the more common course is to use the USB DFU implementation on the STM32 and have that as a boot-loader. ie Where the Application isn't viable the loader drops into DFU mode.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Justin K.
    Justin K.Author
    Associate II
    July 6, 2018
    Posted on July 06, 2018 at 22:27

    Ah, I see! So, for my case, I would go into USB DFU mode if the user pushes down on the button for firmware update and if not go into USB VCP mode.

    I'll try that and thank you for the info.

    Tesla DeLorean
    Guru
    July 6, 2018
    Posted on July 06, 2018 at 23:31

    \STM32Cube_FW_F0_V1.9.0\Projects\STM32F072B-Discovery\Applications\USB_Device\DFU_Standalone

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Pavel A.
    July 9, 2018
    Posted on July 09, 2018 at 21:35

    Just today I&39ve made a simple update code on F072 based on CubeMX-generated CDC class.

    After long time contemplating between DFU and virtual com port, preferred the latter, because ST&39s VCP works with in-box driver on Win10 and Linux (yes, used

    https://community.st.com/0D50X00009XkYSESA3

     - thanks!) and for DFU extra steps are needed to install a driver.

    Once you have a COM port you can use any free terminal program that supports Xmodem and so on. Preparation of binary file is simple. For DFU you need a special app and preparation of .dfu file is more complicated. I use the simplest brain dead variant of Xmodem, the firmware file is < 50K, works good enough.

    Sorry, cannot share the project, the code is too dirty to show yet.

    But basically - as Clive wrote - it takes to buffer one Xmodem packet ( ~ 132 bytes ). Then the sender will stop and wait for ACK, then you have a lot of time for flashing the data and other chores. Repeat until all done.

    - pa