USB reset issue in the Bootloader and libmaple core

Information on the latest releases
User avatar
SukkoPera
Posts: 23
Joined: Tue Jun 07, 2016 11:02 pm
Location: Turin, Italy
Contact:

Re: USB reset issue in the Bootloader and libmaple core

Post by SukkoPera » Tue Jun 07, 2016 11:09 pm

Hello,

I have just joined the STM32duino world, after buying a few boards. One of these is a Maple Mini clone by Baite, BTE14-07, bought on AliExpress. It came with its bootloader, which was working fine until I decided to upgrade it. To make a long story short, I am experiencing the very same behaviour that rolo has been talking about here. As soon as I flash the new bootloader (maple_mini_boot20.bin from 24 days ago), the onboard led no longer flashes. I can then perform the upload of a single sketch, but then the board is no longer detected until I reflash the bootloader.

The sketch I uploaded was a simple Blink, but the led never starts blinking. So maybe the new bootloader doesn't allow the sketch to start?

Going back to the 11-months old maple_mini_boot20.bin solves the issue: the led blinks at boot, then my sketch starts up and the led starts blinking as per the sketch itself.

So I can confirm there is undoubtedly an issue with the newish maple_mini_boot20.bin.

On the contrary, I also flashed the newish generic_boot20_pa1.bin on this board and it seems to be working fine.

For the record, I am on Linux and flashed all of my bootloaders through stm32flash.

User avatar
mrburnette
Posts: 1877
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: USB reset issue in the Bootloader and libmaple core

Post by mrburnette » Wed Jun 08, 2016 12:01 am

victor_pv had a sketch last year
http://www.stm32duino.com/viewtopic.php?t=55#p358
That would "burn" the bootloaders.

Link (to sketch in ths above) is dead, but maybe victor will drop by and give us a new link. You are not the first to report issues, but I do not know if a resolution has been created... Roger will likely chime in on the topic.

Ray

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

Re: USB reset issue in the Bootloader and libmaple core

Post by RogerClark » Wed Jun 08, 2016 12:04 am

I've tried to replicate this issue, but I've not been able to

Can you go back through the commit history and try flashing an older version of the bootloader, and let me know at what commit the problem seems to have occurred

https://github.com/rogerclarkmelbourne/ ... its/master

(i.e you can download the binary for any specific commit)

Its possible that this issue is not that new, and that its just that the bootloader 2.0 does not work with some linux systems.

Also. If you can load a sketch at all, you could try loading the Bootloader updater sketch

https://github.com/rogerclarkmelbourne/ ... er_updater

It contain an old binary, (as I've not updated it), and I think a lot of people tested this method and didnt have any problems

(actually, the bootloader updater was created in this commit https://github.com/rogerclarkmelbourne/ ... 89dcdf9e55 so you could try the binary from the same commit as a starting point)

User avatar
mrburnette
Posts: 1877
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: USB reset issue in the Bootloader and libmaple core

Post by mrburnette » Wed Jun 08, 2016 12:16 am

... FYI...

I'm running Linux Mint 17.3 64-bit, no boot issues, STM32 or ESP8266

Ray

User avatar
SukkoPera
Posts: 23
Joined: Tue Jun 07, 2016 11:02 pm
Location: Turin, Italy
Contact:

Re: USB reset issue in the Bootloader and libmaple core

Post by SukkoPera » Wed Jun 08, 2016 8:04 am

Actually my agony started right with the Bootloader updater sketch. Though I'm not really sure what happened, as after I flashed it, nothing appeared on the serial monitor and I started to have problems uploading new sketches. I can't remember if the onboard led was still working, though.

Anyway tonight I will do some more experimentation and hopefully I will be able to provide more specific information.

Could it be that mine and rolo's is a new revision of the board that triggers this weird behaviour? Also, as I'm new to the STM32 world but I have a decent background on the AVR-based Arduino's: does the STM32 have anything similar to the AVR fuses? Could the problem lie there?

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

Re: USB reset issue in the Bootloader and libmaple core

Post by RogerClark » Wed Jun 08, 2016 9:46 am

@SukkoPera

Thats an interesting thought about the fuses. There are some settings, like memory page protection, and the new bootloader uses pages from 0x8002000 instead of from 0x8005000

You could try erasing the whole processor before flashing the binary, as that may clear any protection.

You can do that via USB to Serial adaptor, but you need to use a STLink adaptor to get more detailed control of locking (protecting) individual 1k pages.

There are a few other settings, but it seems unlikely that they could be the problem.

User avatar
SukkoPera
Posts: 23
Joined: Tue Jun 07, 2016 11:02 pm
Location: Turin, Italy
Contact:

Re: USB reset issue in the Bootloader and libmaple core

Post by SukkoPera » Wed Jun 08, 2016 10:20 am

I only have an USB-Serial adapter at the moment. How do I erase the whole processor?

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

Re: USB reset issue in the Bootloader and libmaple core

Post by RogerClark » Wed Jun 08, 2016 11:08 am

The easiest way is to download ST's own Flash uploder

http://www.st.com/content/st_com/en/pro ... stm32.html

On connect the USB Serial to TX and RX (cross over) on the Maple mini

You need to also pull pin 2 (boot 1) low

The press and hold the "Button" down, while pressing and releasing the Reset button.

(The "button" is on the Boot0 pin, so resetting the MCU when Boot0 is pulled high by the Button, puts the MCU into Flash upload mode.

Then run the Flash loader and pick your COM port and it should connect.

Press Next and then Next again to get to the page which has the "Erase" option on it

You can also Enable / disable Flash protection on the chip, so you could try disabling that as well



BTW. Can you post a link to where you got the Maple mini from. It may be from a new supplier who has made a different version, or may have done something else with the flash page protection etc.

User avatar
SukkoPera
Posts: 23
Joined: Tue Jun 07, 2016 11:02 pm
Location: Turin, Italy
Contact:

Re: USB reset issue in the Bootloader and libmaple core

Post by SukkoPera » Wed Jun 08, 2016 11:29 am

Unfortunately it seems that ST's Flash utility is Windows-only, and I don't have any Windows PC available. :(

You can find the link to my board in my first post. 8-)

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

Re: USB reset issue in the Bootloader and libmaple core

Post by RogerClark » Wed Jun 08, 2016 11:54 am

There is a python tool that does a similar job

its in tools/win

but the master is on github

https://github.com/jsnyder/stm32loader

It has an erase option, though I dont know is its a full chip erase.

Someone else e.g. Ray may be able to advise about other tools available for Linux
or you could try running the windows exe under Wine

Post Reply