No COM Port, but just Maple DFU

STM32duino bootloader aka Maple bootloader
Post Reply
lijw
Posts: 5
Joined: Sat Feb 04, 2017 9:43 am

No COM Port, but just Maple DFU

Post by lijw » Sat Feb 04, 2017 10:01 am

Hi Everyone:
I have just flashed my board( it's F103C8T6, like bluepip ) with the generic bootloader(pc13) by using STLink. Everything seems OK. When I plug the board into the PC's USB, it just show up as a Maple DFU. My PC is a Windows 7. I install the driver by running the install_drivers.bat, it goes Ok and tell me both drivers installed successily. But I just can't get my COM port, so that I can't upload the sketch via the STM32duino bootloader.

Is there anything I have missed?
Hoping a little help!

stevestrong
Posts: 1510
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: No COM Port, but just Maple DFU

Post by stevestrong » Sat Feb 04, 2017 11:08 am

lijw wrote:Is there anything I have missed?
Have you read the FAQs?
After flashing the bootloader and installing the drivers, set BOOT1 jumper back to its original position.
The uploading with "STM32duino bootloader" does not need any COM port, but the DFU (USB) serial port. This will be detected after the board is reset.
So just build any sketch with Arduino IDE and try to upload it. It may happen that you have to reset yourself the board when maple_upload appears in the build window (in red). Search the forum for "R10"...
After uploading the first sketch, the COM port should also appear.

lijw
Posts: 5
Joined: Sat Feb 04, 2017 9:43 am

Re: No COM Port, but just Maple DFU

Post by lijw » Sat Feb 04, 2017 2:43 pm

stevestrong wrote:
lijw wrote:Is there anything I have missed?
Have you read the FAQs?
After flashing the bootloader and installing the drivers, set BOOT1 jumper back to its original position.
The uploading with "STM32duino bootloader" does not need any COM port, but the DFU (USB) serial port. This will be detected after the board is reset.
So just build any sketch with Arduino IDE and try to upload it. It may happen that you have to reset yourself the board when maple_upload appears in the build window (in red). Search the forum for "R10"...
After uploading the first sketch, the COM port should also appear.

Hi stevestrong, thanks for help! So it is the reason why it is just DFU but no COMs ----- the bootloader only enable the DFU function.
I was using STLink to install the bootloader, so I don't touch the BOOT1, so it remains 0.
I do search the forum, but the info are peices, it's difficult to confirm what happen to my board. I did have the same problem on another Maple board, but before I figure out , board got killed by my trying...sigh...
I search "R10" in the forum and check my board, mine is 4.7K, and I am not sure it is important. I upload a blinky sketch( with Serial opened ) from Arduino IDE via the STLink. It works, Windows' COM appears.
One more question, is it possible upload the sketch from the Arduino IDE when the USB is "Maple DFU" state? Which section of the forum may contain the instruction?
Again, thank you stevestrong! :D

stevestrong
Posts: 1510
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: No COM Port, but just Maple DFU

Post by stevestrong » Sat Feb 04, 2017 3:52 pm

I dont really understand your question, the sketch upload (when selected in Arduino menu the "STM32duino bootloader" as upload method and active USB connection) is ONLY possible in DFU state, which is active ~1 second after board reset.
Is it working now? Any more problems?

lijw
Posts: 5
Joined: Sat Feb 04, 2017 9:43 am

Re: No COM Port, but just Maple DFU

Post by lijw » Sun Feb 05, 2017 2:28 am

stevestrong wrote:I dont really understand your question, the sketch upload (when selected in Arduino menu the "STM32duino bootloader" as upload method and active USB connection) is ONLY possible in DFU state, which is active ~1 second after board reset.
Is it working now? Any more problems?
Hi stevestrong, thanks a lot. It works. I have misunderstood the procedure. I was thinking when uploading via "STM32duino bootloader" to generic F1 boards, I had to select a COM, like the "Maple xxx" boards. Now I see: when using STM32duino bootloader, I don't use COM port, but need to make the board into DFU state, so I have to press the Reset button, even I've already got a COM port; when using "Maple xxx" ones, I don't press the reset button, the board will be reset into the "DFU" by software.

I have tried to upload the sketch to my bluepip(F103C8T6 with STM32duino bootloader) as a "Maple Rev3" board and select the correct COM port. It success. So, when the bin file is not bigger than the flash, I can use this method to upload, saving the manual reset action.

Beside, I also try upload a sketch with the Serial opened via STLink to bluepip, COM shows up, and then upload another sketch using above method, it fails to find DFU device.

Thanks! stevestrong :)

victor_pv
Posts: 1605
Joined: Mon Apr 27, 2015 12:12 pm

Re: No COM Port, but just Maple DFU

Post by victor_pv » Sun Feb 05, 2017 6:03 am

lijw wrote:
stevestrong wrote:I dont really understand your question, the sketch upload (when selected in Arduino menu the "STM32duino bootloader" as upload method and active USB connection) is ONLY possible in DFU state, which is active ~1 second after board reset.
Is it working now? Any more problems?
Hi stevestrong, thanks a lot. It works. I have misunderstood the procedure. I was thinking when uploading via "STM32duino bootloader" to generic F1 boards, I had to select a COM, like the "Maple xxx" boards. Now I see: when using STM32duino bootloader, I don't use COM port, but need to make the board into DFU state, so I have to press the Reset button, even I've already got a COM port; when using "Maple xxx" ones, I don't press the reset button, the board will be reset into the "DFU" by software.

I have tried to upload the sketch to my bluepip(F103C8T6 with STM32duino bootloader) as a "Maple Rev3" board and select the correct COM port. It success. So, when the bin file is not bigger than the flash, I can use this method to upload, saving the manual reset action.

Beside, I also try upload a sketch with the Serial opened via STLink to bluepip, COM shows up, and then upload another sketch using above method, it fails to find DFU device.

Thanks! stevestrong :)
The bootloader only manages DFU, not USB serial, there is not code for that in the bootloader. If you upload a sketch and select Maple bootloader as upload mode, then the USB serial code is part of it and can be user as Serial, such as Serial.print, etc.

So if you have a board without bootloader or sketch, there will be a devide detected as unknown. If you have a bootloader but no sketch, then it the computer will find the DFU device.
If you have a bootloader and a sketch, then the DFU device will show up for a few seconds, and disappear and next a serial USB device will be deteced.

I hope this explains it.

lijw
Posts: 5
Joined: Sat Feb 04, 2017 9:43 am

Re: No COM Port, but just Maple DFU

Post by lijw » Sun Feb 05, 2017 8:35 am

Thank you victor_pv!
I am a little more clear, now.
I have browsed the code. Both bootloader and Arduino_STM32 are using ST USB Lib, but they should use that for different purpose. I think they both init the USB hardware but enable different function. That why flashing a sketch via STLink, the COM comes out but can't upload, while only bootloader can show up DFU but can't be used for serial communication.

stevestrong
Posts: 1510
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: No COM Port, but just Maple DFU

Post by stevestrong » Sun Feb 05, 2017 10:14 am

If you upload with STlink, it does not make sense to use the DFU (as it has only update function), that is why in this case any previously flashed bootloader (DFU function) will be erased and thus unusable.

When using "STM32duino bootloader" as upload method, you need the bootloader to be resident in your flash. If you used STlink previously, the bootloader will be overwritten, so you need to flash the bootloader again. In this case the DFU, being part of the bootloader, will not be overwritten and you should be able to use it for further uploads.

The COM port (USB serial) should be in both cases be usable.
Using the STM32duino bootloader, the COM port will appear ~5 seconds (on Win10) after the new sketch has been uploaded and the board reset.
Open the serial monitor only after this time has elapsed.

Always use the appropriate board definitions (don't use "Maple revx.y" for "Generic F103"), otherwise you can have strange behavior.

lijw
Posts: 5
Joined: Sat Feb 04, 2017 9:43 am

Re: No COM Port, but just Maple DFU

Post by lijw » Sun Feb 05, 2017 3:08 pm

stevestrong wrote:Always use the appropriate board definitions (don't use "Maple revx.y" for "Generic F103"), otherwise you can have strange behavior.
Copy that!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest