Maple Mini Bootloader basic questions

akis_t
Sat Jun 27, 2015 11:43 am
The Atmega328 as used on the Arduinos is pre-loaded with a bootloader, which source code is given and can be re-compiled, something I always do to enable the Watchdog. You can upload the custom bootloader using avrdude and the USBasp. If you want to save space you can also upload your sketch via the ISP and thus get rid of the bootloader which takes around 2K. I have uploaded code onto a naked Atmega328 DIP package using the ISP and it runs happily using its internal clock (I think it was 8MHz), it only needed 1 external resistor for the reset line.

Could someone please explain to me how the STM32 works? How many bootloaders do we have? Is the source code avalable and does it compile? Do we have a watchdog? Do we need the bootloader at all?


mrburnette
Sat Jun 27, 2015 2:45 pm
akis_t wrote:<…>
Could someone please explain to me how the STM32 works? How many bootloaders do we have? Is the source code avalable and does it compile? Do we have a watchdog? Do we need the bootloader at all?

RogerClark
Sat Jun 27, 2015 9:33 pm
i second what Ray has written.

There is masses of information on this forum and elsewhere.

There is a small wiki on github

https://github.com/rogerclarkmelbourne/ … STM32/wiki

Bootloader is here

https://github.com/rogerclarkmelbourne/ … bootloader

i also have video tutorials on youtube

i also have a blog which has stm32 stuff on it


akis_t
Mon Jun 29, 2015 9:56 am
Thank you I have been reading, on and off.

I have some basic questions (distilled I hope)

1) The whole palaver with DFU and Serial stems from the fact the STM32 has in-built USB support and does not need special drivers as they come already with Windows. That statement gives the impression that I can simply plug in the Maple and off I go, which is not true. I still need to download and install (with some hardship) special drivers. If I plug in a memory stick for example I do not need to install anything and no hardships. The question is why mess with DFU and Serial so badly just to say ” I do not need FTDI ” – in the end what you need and what you have arrived to is much worse! I’d rather have the FTDI and allow my scripts to work seamlessly with uploading and serial comms just like the Arduino.

2) It appears that the STM32 has intrinsic support for uploading a binary through the Serial1 just like the Atmega328 has support for uploading a binary through the SPI. Which means we could have a bootloader that ignores the USB and uses Serial 1 or Serial 2 most likely to upload scripts and/or do Serial comms? Then we would not need *any* of the DFU/Serial fuss, we would be able to upload and debug seamlessly.


RogerClark
Mon Jun 29, 2015 10:01 am
I still need to download and install (with some hardship) special drivers

No. Please read the other responses.
You are not downloading and installing drivers, you are downloading a program that links the USB device to existing drivers that Windows has by default.

It appears that the STM32 has intrinsic support for uploading a binary through the Serial1

You can already upload via serial,
Select any Generic board.

See the Upload menu.
Select Serial.

(You also have the option of STLink upload and also via BlackMagic probe – both of which use SWD)

Its only “Maple” boards that have bootloader (DFU) upload as the only option.


chopc
Thu Jul 02, 2015 5:32 am
I’m a little reticent to post , but need some help , I have two “Maple-Mini” boards both behaving the same way , I flashed them with the stm32duino bootloader , using an FTDI adapter under Linux … No real problems , then I loaded the “Blink” program ( changing the Led pin to 33 ) with a recogniseable change in duration to confirm it was loading… All Good !
The Serial port was unrecognised before the upload but came up as ttyACM0 after the upload , The problem comes when I modify the sketch and then attempt to upload , says it’s uploading but never completes ! If I reflash the bootloader, the serial port dissapears again and reloading the sketch works ! But I can’t load sketches after this first load after flashing the bootloader .
Any ideas what I’m doing wrong ? I’m running Ubuntu 14.04 and Arduino 1.6.4

madias
Thu Jul 02, 2015 6:48 am
After flashing the bootloader V2, have you chosen the “Bootloader 2.0”?
Image

chopc
Thu Jul 02, 2015 6:52 am
Tried both with the same result !

madias
Thu Jul 02, 2015 7:20 am
…ok, many people forget to switch :)
Next step: Does this behavior occurs with the original bootloader also?
You can download it here: http://static.leaflabs.com/pub/leaflabs … i_boot.bin
…and on my MAC I always have to choose the right serial port from the menu before uploading (maybe fixed with the new repo for linux/osx).

chopc
Thu Jul 02, 2015 8:18 am
If I load the maple mini bootloader I get a message that it “cannot find the DFU device” using the Maple IDE , and if I try using the Arduino IDE with the Maple bootloader I get “dfu-util: No DFU capable USB device available”

Don’y know if that will give you any clues

Apologies for dely in reply , a meal got in the way !!

Regards art


RogerClark
Thu Jul 02, 2015 9:45 am
@chopc

When did you download the repo, I did a fix / enhancement in the last 7 days to add a upload-reset utility for both OSX and linux

Check in tools/linux folder and see if you have a file called upload-reset

If you don’t have this file, please update your copy of the repo

Next. If you are running linux, there is an issue with some versions of linux that the serial port permissions are incorrect
You need to install the udev rules using the install script in the tools linux folder.

Also, I’ve found that you may need to add the current user to the dialout group and the reboot your machine, for this to take effect (you may be able to log out and back in again, but you may as well reboot)


chopc
Fri Jul 03, 2015 7:25 am
As I remember it was downloaded about 5 days ago , as a precaution I downloaded yesterday and set up in a clean. new, Ubuntu14.10 partition… Seems that way yet another mistake ….. going backwards with it now not compiling because it can’t find libusb-1.0.so.0

I think it might be best for me to forget about the STM32 boards and stay with the ( horribly more expensive) Teensy 3.1 boards until ( and if ) the ArduinoSTM32 route become more of a public footpath than an intrepid programmer’s exploration into the unknown :-)

Thanks to everyone for the help Regards r4


RogerClark
Fri Jul 03, 2015 7:57 am
No worries

STM32 does work with Linux, but its hard to know what you exact problem is.

Good luck with Teensy, I hope its easy to use on Linux.


PaulRB
Sat Jul 04, 2015 7:21 pm
akis_t, see if anything in this post helps.

Paul


RogerClark
Sat Jul 04, 2015 9:11 pm
Paul

BTW

i changed the name of the udev script to just be install.sh, as it now also adds the current user to the dialout group.

Also since last week in both Linux and OSX I’m including the dfu binaries as part of the tools, so there is no longer the need to compile dfu-util yourself on Linux (or install Homebrew on OSX to get dfu-util)

Theoretically, if i did a boards manager package, there is supposed to be a way to call a post install script, which could run install.sh on Linux, but I’v been too busy with other projects this week to investigate further.
However i think the Nightly release of the IDE is now supposed to include a change to support evolving cores, so that people can go into the BM and simply press update to download the latest version.


martinayotte
Sat Jul 04, 2015 9:44 pm
Hi Roger,

RogerClark wrote:Also since last week in both Linux and OSX I’m including the dfu binaries as part of the tools, so there is no longer the need to compile dfu-util yourself on Linux (or install Homebrew on OSX to get dfu-util)


Leave a Reply

Your email address will not be published. Required fields are marked *