Exchange data between microcontroller / C# programm and flash with same connection
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-10 2:58 AM
Hi,
I have a question about STM32G4. I want to exchange data between microcontroller and a C# programm (by usb) on windows. But, sometimes I want to upgrade the program in the microcontroller with this same connection (usb)
How I can do this ? I need to integrate STLINK to the board and exchange data with it ?
Thanks !
- Labels:
-
STM32G4 Series
-
USB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-10 3:23 AM
For flash updates in-the-field, you can use USB DFU protocol and don't need ST-LINK. This can be done in addition to "normal" USB function like CDC (serial port), MSC and so on. If you also want to be able to debug or update your devices in the lab, you may attach pins/header for ST-LINK interface as well, like for the ST-LINK V3 SET or MINI.
hth
KnarfB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-10 4:16 AM
Ok so, If I understand I add to my board the st link interface, I can send data (hex) via USB with normal USB function (CDC) and if i want to update via windows terminak I can also ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-10 4:21 AM
DFU, CDC or MSC methods just require a USB connection to the STM32 and USB Device implementation on the Target.
​
An ST-LINK is only needed for debug connectivity and perhaps initial production programming ​
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-10 4:25 AM
Oh great ! So, i flash my program with an stlink for the first time and after I use an USB connection for exchange data (CDC) and update firmware (DFU) ?
What I need to do this ? I'm searching for CDC function for exchange data, but for the DFU update ? I can do this with terminal command and just the firmware file ?
thanks !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-17 3:47 AM
Hello KMiko.1 (Community Member),
The device contains embedded bootloader which can be used on each device to write firmware to the Flash. Embedded bootloader can use various interfaces to connect to device: USB, USART, SPI, I2C. To activate the bootloader - there depends from BOOT0, BOOT1 option bytes (see reference manual RM0440) and then restart the device. And please read application note about STM32 bootloaders: AN2606.
Regards
Igor
