cancel
Showing results for 
Search instead for 
Did you mean: 

F042K6 USB CDC VCP device in debug session becomes into ''STM Device in DFU Mode'' while not in debug session.

Why Hans
Associate
Posted on June 18, 2018 at 07:16

I generate a TrueSTUDIO project for STM32F042K6 to make a USB CDC VCP device using STM32CubeMX-4.23, firmware 1.9.0. Change RX/TX buffer size to 256bytes, and SYSCLK source to HSI48.

Build Project OK.

Debug and then click the 'Resume(F8)' button. Win7 device manager shows a 'STMicroelectronics Virtual COM Port' device. That's great!

But after I click the red 'Terminate (Ctrl+F2)' button, that COM Port device disappears. After 1 second, a 'STM Device in DFU Mode' device shows up.

If I power up my board directory, I get a 'STM Device in DFU Mode' too.

Why?

I want to get a stable Virtual COM Port. How should I do?

1 REPLY 1
Why Hans
Associate
Posted on June 20, 2018 at 03:55

Problem solved. I connected Boot0 to high level. Now I connect it to GND and the app works.