USB reset issue in the Bootloader and libmaple core

Information on the latest releases
User avatar
RogerClark
Posts: 5303
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

USB reset issue in the Bootloader and libmaple core

Postby RogerClark » Sat May 14, 2016 9:37 pm

Guys

I noticed on my most modern machine that the GD32 was not resetting the USB and forcing re-enumeration.
I initially thought this was a GD32 issue, but one of my Red Pills, also seems to have the same issue ( or perhaps using a longer USB cable with the Red Pill causes it)

Anyway, the fix for both the GD32 and the Blue Pill, (and the same will apply to all boards), is to increase the length of time that PA12 is driven Low.

I doubled the delay from 256 loops to 512 loops and this fixed things for both the GD32 and the Red Pill.

I will test this change on some older slower machines, but i am pretty sure i will be Ok, as I looked at the BlackMagicProbe reset delay and its much much bigger ( thousands of loops) and no one has had an issue with it.

rolo644u
Posts: 32
Joined: Fri May 06, 2016 10:02 am
Location: Netherlands

Re: USB reset issue in the Bootloader and libmaple core

Postby rolo644u » Mon May 16, 2016 5:47 am

Just loaded the new maple_mini_boot20.bin into my Maple Clone using the ST-LINK V2 programmer. Works fine, but the board acts different now. After plugging in the DFU gets detected, I can flash a file into the board using the bootloader but no blinking led. Also no serial port is detected on my windows machine. The previous version of the bootloader did do that. I do not have the previous version anymore (overwrite = yes :x ) so can't test again with the old version. Would like to have the old file to test this. Am I missing something about how the new bootloader works ?

User avatar
WereCatf
Posts: 167
Joined: Sat Apr 16, 2016 5:30 pm

Re: USB reset issue in the Bootloader and libmaple core

Postby WereCatf » Mon May 16, 2016 7:20 am

rolo644u wrote:Just loaded the new maple_mini_boot20.bin into my Maple Clone using the ST-LINK V2 programmer. Works fine, but the board acts different now. After plugging in the DFU gets detected, I can flash a file into the board using the bootloader but no blinking led. Also no serial port is detected on my windows machine. The previous version of the bootloader did do that. I do not have the previous version anymore (overwrite = yes :x ) so can't test again with the old version. Would like to have the old file to test this. Am I missing something about how the new bootloader works ?


You can test the previous version by downloading it from https://github.com/rogerclarkmelbourne/ ... 1/binaries

rolo644u
Posts: 32
Joined: Fri May 06, 2016 10:02 am
Location: Netherlands

Re: USB reset issue in the Bootloader and libmaple core

Postby rolo644u » Mon May 16, 2016 11:51 am

Flashed the previous version in the board and it work fine now. The quick blinking led, board enters DFU mode, after downloading a piece of code the DFU resets the USB and a new serial port called "Maple Serial" is detected on my pc.
I think there is a bug in the new bootloader, looks like it's not reseting the board after downloading and not starting the code. I only can test the Maple Mini, so not sure if the other bin files have the same issue.
I have a Blue Pill on the way, so if needed I can test this one once it's arrived.

User avatar
Vassilis
Posts: 286
Joined: Thu May 21, 2015 6:42 am
Location: Thessaloniki, Greece
Contact:

Re: USB reset issue in the Bootloader and libmaple core

Postby Vassilis » Mon May 16, 2016 3:24 pm

I verify that the new bootloader doesn't start the usb serial on maple mini :(

User avatar
RogerClark
Posts: 5303
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: USB reset issue in the Bootloader and libmaple core

Postby RogerClark » Mon May 16, 2016 10:52 pm

The change I made should not have affected the Maple mini version of the Bootloader as it doesnt use the method of pulling PA12 low, it uses a separate GPIO pin and the code that toggles it, is completely different

I did do a make clean on all build targets and rebuild all of then, even though the maple mini bootloader was not changed, so any difference is likely to be caused by different versions of the compiler between the last time I compiled and this time.

But I'd need to double check this

User avatar
RogerClark
Posts: 5303
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: USB reset issue in the Bootloader and libmaple core

Postby RogerClark » Wed Jun 01, 2016 7:56 am

I've just tested the latest bootloader for the Maple mini and it works fine with my Baite Maple mini board

I can put it into perpetual bootloader, or just reset it etc, and also upload a sketch which reset the board fine via serial and also upload fine when I put it into perpetual bootloader mode.

Serial also worked fine.

rolo644u
Posts: 32
Joined: Fri May 06, 2016 10:02 am
Location: Netherlands

Re: USB reset issue in the Bootloader and libmaple core

Postby rolo644u » Wed Jun 01, 2016 12:22 pm

Thanks, did a quick test again but it does not work in my setup. Uploads work but after that is does not present the USB Serial port and the sketch does not run. When loading the previous version of the bootloader all works fine. I must be missing something here as there are not a lot of complaints.

User avatar
Pito
Posts: 560
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: USB reset issue in the Bootloader and libmaple core

Postby Pito » Wed Jun 01, 2016 12:41 pm

Which binary you actually flash? What is the "new" bootloader?

PS: be aware there are 2 trees with the same bootloader_name: maple_mini_boot20.bin - one is 17days old, the other one is 11months old. Maybe the version number shall increase, somehow..

rolo644u
Posts: 32
Joined: Fri May 06, 2016 10:02 am
Location: Netherlands

Re: USB reset issue in the Bootloader and libmaple core

Postby rolo644u » Wed Jun 01, 2016 1:14 pm

I'm flashing \STM32duino-bootloader-master.zip\STM32duino-bootloader-master\STM32F1\binaries\maple_mini_boot20.bin
From the master that's now 17 days old. That was new at the time I posted my question. So I called that one new.

This one I call previous version : https://github.com/rogerclarkmelbourne/ ... 1/binaries
That does work on the same board.

I'm using the development branche, maybe that make a difference ?)


Return to “Builds and Announcements”

Who is online

Users browsing this forum: No registered users and 1 guest