My setup: OSX 10.9.5
This week I decided to move from Arduino IDE 1.6.5 to 1.6.9. Since I had multiple version of the IDE (since version 1.x), I decided to remove all of them, including any and all Arduino related directories.
I downloaded Arduino 1.6.9. and followed the installation instructions on the wiki.
I plugged in one of my Baite Maple Minis to test my setup. The MM was assigned a serial port, and already had Bootloader V2rc1 on. I tried to upload the blink example, but simply got:
maple_upload cu.usbmodemfd1241 2 1EAF:0003 /var/folders/s5/cfn1c1vj7xx3q3x2gpd81m540000gn/T/build6deb9daa84ca6d09c9b0a8d0a8cab731.tmp/FirstProgAfterSTM32duinoBL.ino.bin
dfu-util 0.8
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
dfu-util: No DFU capable USB device available
I can then deduct that something OSX specific is wrong on my MacBook and that at least my MMs and BPs are fine ![]()
you can adjust the delay time in the upload script
but if you flashes the very latest bootloader there is now a new option which is that the IDE can tell the bootloader to start in perpetual mode.
But I have not had chance to put that code into the core yet, as it could screw things up for some people.
If you are willing to change some files in the core you could give this new feature a try
https://github.com/devanlai/Arduino_STM … c081d18271
you could try adding the code to the usb in the core, to lock the bootloader into perpetual mode
Dont bother with the stuff in boards.txt if you dont want to, just remove the #ifdef from the new code so it runs all time time.
I will try this myself, later…
I just tried the old bootloader on my ElCapitan machine and I seem to have the same issues that you did
With the new bootloader it uploads OK, but does not reset back into the sketch. This may be due to the changes to speed up the time between DFU completion and the sketch running, but I don’t know for sure, as DFU Util sends a Reset command to the bootloader when uploading of data is finished and this triggers a reboot. Only in the new version it remembers its just done an upload, so skips waiting for another upload and jumps to the sketch (if present)
So it could be a problem with the new fast-run code, but it doesnt seem that likely
I still have some problems with ElCapitan, but I need to do some more testing to find out why the sketch does not run after upload
But I will add that code change to the Master core, as I think it won’t cause any issues
Cheers
Roger
I had a number of challenges. Some I suspect would be helpful to apply my Linux scripting skills to. I read many posts and FAQs here and some elsewhere to refresh my memory on what I have read and did not recall the specifics in the reading and research I have done the last few months about STM32.
I also think I ran into a few odd bugs. I need to return to the “clean room” tests to not only duplicate again (hopefully as solid at time all time), but there are variations needed to be tested to scope the issue as well. The variables to scope variations is more than a few and in math combinations takes time.
I am using 1.6.13 of the Arduino IDE and a x64 Debian based Linux. I know the OP is using OSx which means the OS is based on NetBSD. Same in some ways, very different in many ways to Linux.
I have had many parallels similar to one of the OP challenges and with same version of dfu-utils as OP and one in the Arduino_STM32 via Installation
dfu-util 0.8
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
dfu-util: No DFU capable USB device available
it frequently takes me 4 or 5 attempts when i even try, press reset and button1, release reset, release button1
……………………………………………………………… ————– 1 ————- —— 2 ——- ——– 3 ———
action ‘3’ inside the ‘first (fast) blinking’ led time, success is a much slower continous blink.
with my large hands its a pain, so regardless i tend to wire up a stlink usb stick on 22/21 (22 clk 21 dat)
i also tend to connect a usb/uart module on a9/a10 as well. no supplies to them just the gnd.
stephen
I have a ST-Link and two USB to TTL Serial adaptors on way. They have not arrived yet. Likely a few more weeks on the “slow boat”.
I have a couple very interesting boards I ordered a couple weeks ago. The STM32F103C8T6 boards I ordered I am really hoping will be what will be my close to ideal (as long as I do not exceed the 20K RAM, as I will not exceed the flash with the code I will need to develop). These interesting boards just arrive on the west coast on weekend. ETA with “trusty” (cough cough) Canada Post is those board should be here in a week. Three Baite Maple Minis are on way still, but ETA unknown.
The STM32F103 board (arrived last Friday) I had issues with is a MM clone that looks exactly like the Baite MM. It is not a Red or Blue pill board. My fingers slip on the small reset button so I understand the reset button challenges.
I do appreciate your noting the pins I will need to use for the ST-Link and USB to TTL Serial. That will be most helpful once at least one of the USB or ST-Link adaptors arrives. And once both have arrived. I will not just want to test them, but use so I understand their use.
I just cannot remember from my past months of reading and not able to find yet (how happens most of time seems) in searching a few times in last day if one has to always use the “reset” button to allow dfu-util to load the bin to board. I do know that to load the alternate V2.0 STM32duino firmware for the MM I need to do so with the ST-Link or USB to TTL serial. Until one of those adaptors arrive I have to use the “reset” button. I need find what I am sure exists about this (even if it says load the STM32duino V2.0 BL) or what I need to do that I have forgotton in my reading over the last few months. I am assume (from my memory or what I have read over the last few months) unlike the Red/Blue pill R10 issue, the R10 issue or similar does not exist with the MM clones.
I really hope there is a bootloader on a very interesting STM32F103C8T6 board and a STM32F407VET6 board to experiment with that will should arrive in week or less and will at least work in the STM32duino mode.
I also need to figure out if, and if so, how to download the existing bootloader in case I need or wish to load it back onto the board.
Regards,
John L. Males
Toronto, Ontario
Canada
27 November 2016 22:30
I just cannot remember from my past months of reading and not able to find yet (how happens most of time seems) in searching a few times in last day if one has to always use the “reset” button to allow dfu-util to load the bin to board.
I just cannot remember from my past months of reading and not able to find yet (how happens most of time seems) in searching a few times in last day if one has to always use the “reset” button to allow dfu-util to load the bin to board.
it frequently takes me 4 or 5 attempts when i even try, press reset and button1, release reset, release button1
……………………………………………………………… ————– 1 ————- —— 2 ——- ——– 3 ———
action ‘3’ inside the ‘first (fast) blinking’ led time, success is a much slower continous blink.
with my large hands its a pain, so regardless i tend to wire up a stlink usb stick on 22/21 (22 clk 21 dat)
i also tend to connect a usb/uart module on a9/a10 as well. no supplies to them just the gnd.
stephen
The old leaflabs repo for the bootloader is here
https://github.com/leaflabs/maple-bootloader
So you could rebuild it from their code, but the bootloader that comes on the board from china could be even older
Bus 002 Device 003: ID 1eaf:0004
After the compile is finished, Maple upload script gets run by the IDE which then sends a magic sequence to the USB Serial in the sketch, which causes it to JUMP to zero and exec the bootloader.
But if you have not selected the COM port (Serial USB) for the sketch code this is not possible as the upload script won’t know which port to send the magic number to
The idea with Boot1 is for non MM boards. On the MM the “Button” is connected to boot0 and boot1 is floating. Boot1 floating is a hardware error in the design and I have found it prevents the board going into its internal serial uploader which is needed if you want to reflash the bootloader on the MM
I pull boot1 low via 10k on my MMs if I want to upload via serial
The Boot1 think on the Jump link is just for non MM boards as they only have a reset button not a User Button.
On the MM it can be tricky to enter perpetual bootloader because the User button is not boot0, so if you press and hold while pressing and releasing reset, you end up in the STM32’s own internal Serial bootloader not the MM bootloader
You have to press and hold the User Button after you have released the reset button, but its a limitation of the hardware not the bootloader
Just to reiterate
DFU is only available for a few seconds after the bootloader starts (Unless you can press the button on the MM after pressing reset)
Note. In the original firmware, if you hold down the button too long it is also ignored (I didnt write the bootloader so this is by design by Leaflabs)
The newer bootloader is better, I think you can hold the button in and it stays in DFU mode.
If you don’t press the button, after a few secs there is no DFU upload data, the bootloader checks if there is a sketch in flash and if so it jumps to the sketch. If no sketch is present, I think the booloader resets and tries again
Note the old / original bootloader checks for a sketch in RAM as well as Flash, but the RAM option was removed as its virtually impossible to fit a meaningful sketch in and it also wastes 3K of the 20K RAM doing this, as the bootloader has to preserve its vars in RAM and Leaflabs allocated 3K to the bootloader for this.
On the new bootloader it free’s up all the RAM and only runs sketches from flash
NOte. The bootloader only provides DFU, not Serial
The sketch only provides Serial (not DFU)
The bootloader does not run after the code jumps to the sketch, and vice versa
One other trick I do on windows, to upload is…
Unplug the board (Maple mini or BP etc)
Tell the IDE to upload
When the IDE has finished compiling and is trying to upload.
Plug the board in.
This seems to work because dfu-util on Windows seems to have a timeout while it waits for a DFU device to appear, but unfortunately I don’t think the Linux version does this.
RogerClark wrote:You don’t need to set a jumper or press a button if things are working OK
After the compile is finished, Maple upload script gets run by the IDE which then sends a magic sequence to the USB Serial in the sketch, which causes it to JUMP to zero and exec the bootloader.
But if you have not selected the COM port (Serial USB) for the sketch code this is not possible as the upload script won’t know which port to send the magic number to
I don’t know what bootloader the MM clones have installed. But it seems to be an old one, possibly dating back to 2013 or 2014.
Re: MM reset button
The MM circuit is on github
https://raw.githubusercontent.com/leafl … lemini.pdf
And I think most clones are very similar to the original (though other people know more about this than I do)
Reset, is connected to Reset on the MCU,
User button is connected to Boot0
Re: Magic sequence
Nothing has changed in the new bootloader in this regard, as its the sketch that receives the sequence from the maple-uploader
Re: Bootloader versions
The new bootloader has changes to allow for compiler optimisation for size and more recently to work with gcc 4.9 and newer
Optimization for size, saved some Flash. (I think saved 8 k of flash)
Re: Bugs in upload script
There are timing issues, between the USB bus being reset and the DFU being available and dfu-util seeing this.
There is a configurable delay in the OSX version to handle this, I can’t recall if I did the same thing for Linux
The latest bootloader also has an extra mode where the sketch can lock it into DFU mode using the battery backed RAM which survives reset as long as power is maintained.
However I’ve not updated the core code to set the RAM location yet, so I’ll try to remember to do that soon, but I then need to test it on multiple boards to make sure it works.
(And as you can imagine I have very little spare time support this)
Sorry I have had a number of “interrupts” due to reasons for my important personal STM32 project. Compounding this is various items I ordered last Fall that should have arrived mid to later December 2016 eitehr have not arrived or are taking 3-4+ months to arrive. Examples are Baite Maple Mini Clones just arrived in last few days as well as U*SB to TTL Serial adapter. The STLink adapter still has not arrived. The orders not arriving or taking months to eitehr arrive or still not has taken much more time to address than I could have imagined.
WRT my expeiences with the first Baite Like Maple Mini Clones I had I decided to wait for the Baite Maple Mini Clones to arrive before I tried again in case these was some “other” unknown issues with the Looks like a Baite Maple Mini Clone.
I decided earlier today to see what using a Baite Maple Mini Clone with the IDE from a clean room test would result in. This took some time as there appears to be multiple issues that compound matters. Basically same issues as prior noted by me, and some other issues. I did solve the issues in some fast and dirty ways just to save time and prove most of the issues. I still have one issue to “prove” that is not listed mentioned i this topic as I never had a situation to present the possible cause.
In the findings today no differences between the Baite Maple Mini Clone and the look alike Bait Maple Mini Clone. Both Maple Mini Clones types I have work as expected exclusive of one outstanding issue I still have to fully prove and I fully expect will be an issue that is not specific to the board being used by me or in wider scope other boards that otherwise “work” fine.
I have also started making some extensive changes to some of the code related for these issues so far that I can address with code fixes and some other types of fixes. The question I have is what topic do you suggest I post the issues, fixes, and any issues can duplicare and unable to figure out a fix? Do you wish these to be seperate by types of issues I found and have a possible fix for? For issues I cannot figure out a fix for do I post those in a seperate topic or in same overall topic of the issues I found and also have possible fixes for?
As an FYI, due to the nature of the interrupts I am having that are the basis for the important personal STM32 project I may have unexpected delays in my replies. My applogies in advance, but I have no control over these “interrupts” nor the nature of these. I will reply. Perhaps not as soon as even I would like to reply, let alone otherwise.
Regards,
John L. Males
Toronto, Ontario
Canada
03 March 2017 04:20 EST
03 March 2017 05:48 EST (Typo Correction and correct time to EST not UTC)
i don’t think i’ve ever had a package even take 2 months from the far east, a few have had delivery windows that long(60days). that’s in about 2.5yrs.
i’m fairly sure a ship or plane has just arrived as i have 2 cards from the post office advising parcels/packages too large for
letter box. almost certainly both are dupont leads, but then again they could be 2 off nrf24 with big aerials or 2 off 3.2″ LCD; the LCD’s were ordered 19/2
.
none of my orders still to be delivered are older than maybe 5 weeks. oldest is 30/1, youngest 19/2
stephen
The issue is not just the Baite MM orders. I had many orders with tracking. All but one or two of those many orders arrived in Canada in very good time, but sat for weeks before many were delivered. Many weeks meaning in Canada for delivery to Toronto, not some igloo near the North Pole needing a sled and dogs to deliver, for 7-8+ weeks before actually delivered. In fact some orders showing as in Canada now for almost 3 months are not delivered still.
Prior to September 2016 orders typically arrived in about 30-40 days. This parallels your experiences.
Since September 2016 somthing has gone very seriously wrong with delivery to at leat me and that means to Toronto. This as you can deduce is not seller specific as these orders were across many different sellers. For example my STLink is now going on 28 weeks.
I have sellers extending delivery time expectations by 60 days at a time. It is just insane what has been going on in last few months from AliExpress sellers related to delivery times. I am certain this is not a seller problem. It even happens with AliExpress Delivery.
I have discussed the issues with AliExpress. So far AliExpress is happy I am telling them about the bucket examples such as in Canada for weeks, registered delivery full tracking failing as well just as badly, the odd few items that arrive near the 60 days, and the few that arrive in 2-4 weeks. This does not even dent the surface of the problems that have occurred since Spetember 2016.
Prior to September 2016 all was fine at 14 – 40 days delivery all via free shipping.
If you look at AliExpress listings now there are many more sellers charging for shipping than prior. Some of the shipping costs are sigigifant like $1.40 for a $1.00 item that never had shipping costs. The MM now has about a $1.40 shipping cost it never had prior to mid Fall last year. I believe many sellers are now charging shipping that never did prior is related to the problems that started last Fall that so far AliExpress does not seem to be trying to understand or find out the problems and solve them.
The number and actual shipping costs being charged by sellers hurts all as the extra shipping costs factor into decisions to purchase and I suspect still will not solve the problems that were never seller problems to start with.
I know the extra shipping costs and how those shipping costs are often scaled on quanity orders are factoring into my decision to make or not make a purchase. For now I have not placed any AliExpress orders due to the mess of about 30 orders I had since September 2016 that have presented nothing but challenges in many ways and still many have not arrived going on 9+ weeks.
Regards,
John L. Males
Toronto, Ontario
Canada
03 March 2017 12:55 EST
4 weeks is the worst case for me. If its not here in 4 weeks, it is almost certainly lost in the post.
It sounds like an issue related to your local postal service, as I am pretty sure no one else on the forum has to wait that long.
when i watch some of the ‘border control’ documentaries / programmes, i’m always seeing parcels being x-rayed
and having long lines laid out for examination by a sniffer dog.
maybe its been stepped up by a notch or two
stephen
when i watch some of the ‘border control’ documentaries / programmes, i’m always seeing parcels being x-rayed
and having long lines laid out for examination by a sniffer dog.
maybe its been stepped up by a notch or two
stephen
for the police type shows pretty close are Australia & US, UK third.
stephen
yes i do have kaffeine running, so it is my TV. i also have 10 desktops, mainly firefox and konsoles.
most of the time, i’m usually communing with forum, github, joe, makefiles, libopencm3, unicore-mx and arduino_stm32, also amazon kindle unlimited, ebay, aliexpress, pysol(anyone better than 1m 14s klondike?); but they’re not in any particular order. tv, taggart, prime suspect, lewis, morse, marple, new tricks and docu’s if none are on and they’re being saved anyway.
stephen
