arduino zero bootloader

 


 
Before I show you how to do that, though, I want to talk about why you might want to upload a custom boot loader to a Arduino. So for me, I’ve needed to do it a few different times and they’ve ranged from getting more space from the pro mini. The soft bootloader uses two kilobytes and if you upload a custom one using the opto boot, you can get down to 512 bytes. So you get a little more room for your code and then the other reason is if you want to upload a special bootloader that has a special purpose, so my sensors has a custom bootloader that allows for over the air updates. So you can upload that to your pro mini and then you can upload your code over the air or wirelessly without having to plug it in, and that has been incredibly useful for me when I have remote nodes or nodes that I don’t want to dig out To update the code so, as I said before, I’m using the USB ASP subversion 2 – and I got this one eBay for just a couple bucks – you can use an Arduino Uno which I’ve tested before and had mixed results, which is why I switched over to this. Guy here once I had the cables connected like this, I labeled them and I’ve never had an issue with any miss wiring or wires being too long bad connection. Any of that so I use this it’s super simple and plus I don’t have to type my pro or starting my uno to upload a blue border.

So one of the things that was a struggle for me when I first started out was knowing how to connect in the wires there’s a lot of different wiring diagrams. Some of them are reversed. Things like that so I’m, going to show you here how I have it connected up and then, as you can see, I just taped it off and labeled it. So then any other time I want to upload. I can just connect it in to my pro mini I’m off and running so I’m, going to try and do this, so you can all see it first. We have on this side. So this is the bottom. We have etc’ and ground. So we have a little jumper here, that’s going to allow for so you can see it. Psy bolts are three bolts. I upload mine at 5 volts and I yeah, like I said, connecting 3 cc in the ground, so 5 volts and ground on this side. So 5 volts is the first pin and then the second pin is ground. Now, if you can see it here, but the next two pins on this side are not used, so they will be disconnect you’re, not connected okay. Next, we have from this side. Here we have mo si, then we have reset. Then we have s CK or serial clock and then the last one down is mi soo. So that is how you would connect those into the USB SP.

And then, if you go down here, you can hopefully see it, so the serial clock is going to pin 13 on my pro mini and then the green wire here, which was M ISO, is going to go to pin 12 on the pro mini and then find Me we have the white wire, which is mo si, which will go into pin 11 on the pro meaning, okay and then, on the other side, we have VCC, which goes into the 5 volts on the pro mini. Then we have ground which would obviously go to ground on the pro mini, and then the reset goes to reset on the pro mini. So hopefully you can see that this is how I just have it labeled or connected inside I’ll, never have to double check. I just taped it up and then 11 12, 13, 5 volts, reset and ground connection to the top of the pro mini or sorry. The pro mini opinion matters like that: okay, so that’s, the wiring and that’s the device I use let’s go over and take a look at the computer side of things to show you how to get it all uploaded. Oh yeah and obviously just connecting it in just plug it into the USB port of your computer here, okay, so the first thing you’re going to want to do is install the driver for the usbasp device. So, to do that, I actually found that if I went to the website for the USB ASP that the driver wasn’t signed so Windows 8 and above doesn’t like that, so instead, if you go and download the za dig tool.

However, you pronounce that and I’ll put a link to that in a video description. You can add the correct driver and I’ll show you that now so just obviously open up the application, then what you’re going to do is you’re going to list all your devices and it’s already found my usbasp. If it didn’t find it for you, you can just click the dropdown, then you’ll select the driver, so you can see that I already have this driver installed and I found that that is the driver. That’S required for Windows 10 if you’re using Windows, 8 and presumably lower you’re, going to want to use this driver here. At least this was the one that worked for me. So Windows 8 is the Lib USB 132 and Windows 10. Is this one here? Okay? So after you’ve selected it you just hit install driver, replace driver, whatever options available for you, and then it would install that driver your system. Ok! So now we’re going to use AVR dudas to test our communication with the USB sp2, our Pro Mini. This step is totally optional, but I like to use it just to make sure everything is communicating, as I think it should I’ll post the link in the description for the download. So, first you need to select programmer, so the USB ASP is all the way towards the bottom here. Fourth from the bottom and then what you’ll do is you will detect the MCU so it’s working properly, your pro minee should say, and at MIT 328p, which is great and then we’re also going to read the fuses just to make sure of that, and you can See it red in our fuses, so it’s definitely communicating properly.

We can also see the results down here in the status window, so we are good to go all right, so we have everything connected and we’re almost ready to start burning our bootloader. Now, if this is your first time and I’m guessing it is since you’re watching this video, I would recommend burning a pro mini bootloader when you have the resonator connected. Some of them are sold without this resonator. Basically, what this will allow you to do is recover. The bootloader at least give you better odds of recovering it. If you do flash it with the wrong bootloader, so let’s say you didn’t have this and you flashed a 16 megahertz external oscillator. It may not be able to be reflashed until you connect in an oscillator or resonator. So, just a word of caution: you can do some damage well, I don’t want to say damage, but you could potentially break your device or at least make it harder to recover from a bad bootloader burn, not to say that it’s impossible to recover it’s, just not As easy as reflashing, so if it’s your first time, you may want to just use one of the pro minis that has the resonator on it. Okay, disclaimer. Out of the way, I am going to use the Arduino IDE to burn the bootloader there’s a lot of different ways to do it, but this is the way I’m going to show if you don’t have the IDE installed and don’t how to do it.

I have another video that I’ll link to here for how to do that, but I’m going to assume you already have it installed? Ok, so what we need to do is we need to go to tools and we’re going to choose our programmer. So in our case, we’re going to choose usbasp, which I already have selected here and then we’re just going to select the board and processor that we want to use, if applicable, so I’m, actually going to burn the Arduino Uno bootloader to this Pro Mini. What that will do is it will use the op boot bootloader and because they have that external resonator at 16 megahertz. It will actually allow me to save some space in the bootloader and recover some of that memory for my sketch. So I can use larger sketches and because you know, and the pro mini use the same atmega chip. This works with no problems as long as you’re using the external resonator okay. So I just selected the Arduino Uno here and I already have my programmer selected. So I just go to burn bootloader and you can see down here how fast that was. So this is what the report looks like I’m, not going to go into the details here. Basically, what you want to look for down here is done and that it verified 100 you’ll see very quickly if there’s any errors, it’ll say out of sync or continual try continually try, but this was a successful burn, so that’s it be burned on your bootloader.

If I wanted to go back to the pro mini bootloader, I just select it from the boards menu here, choose the pro mini, and then I will choose my processor. I don’t know what I want and the 5 volt 16 megahertz prime bootloader and that’s it it’s. As easy is that alright, so what if we wanted to burn a custom boot loader that was not already added to our boards menu here? A perfect example of this is the awesome, is bootloader created by Olivier or TECA, as he’s known on the my sensors forum. Basically, what this bootloader will allow you to do is upload sketches, either via USB and the FTDI adapter or over the air using the NRF radios. So you can actually upload a brand new, my sensor sketch wirelessly without having to connect it. So, if you’re in a home automation, you want to do something like that: it’s amazing, for having those devices, you know hidden behind objects or inside of objects, and you can still upload new code with that bootloader. So anyway, let me show you that now so the first thing you’re going to want to do is download the bootloader so I’m going to go back out to the internet here and I’m going to go to the my sensors github page, so it’s just github.com slash. My sensors and I’m going to open up the my sensors bootloader link here so we’re going to want to do the easiest way.

We’Re not going to use all these files with the easiest way to get them is just to download over here so I’m. Just going to download the zip and then I’ll open it, ok! So inside of this zip file, we have multiple files. What we’re looking for is the hex file, so a bootloader file is a hex file. So, even if you’re, not using the my sensors bootloader or the my S, bootloader, maybe a DES ophtho boot, you would look for a hex file and then you’d also want to add some text to your existing boards. Txt file. Ok, so we need to find a location that we need to put these files, so I actually just found out on my Windows: 10 PC that it’s, not in the normal spot, that I was looking for because I haven’t added my boot loaders on my Windows. 10. Pc yet so the easiest way to find the location is to go back to the arduino ide go to file and then we’re going to open up the EEPROM clear example sketch so it’s just going to be down here. Eep ROM EEPROM clear, then what we’re going to do is we’re going to click on the sketch menu and show the sketch folder. This will take us to the location of the example sketches and from there we can find the board’s text folder, as well as the bootloaders folder. So here I’m going to click on the one dot 6.

15. Your version number may be different and then we’re going to see boards text as well as the bootloaders folder. So I recommend creating a copy of your boards text file. So if you ever mess it up, you can always get it back. So just right. Click copy here, if you want you, can rename it I’m just going to leave this one alone for now, just to save some time. Okay, then, we need to go back to our downloaded files and open the board. Txt file provided for us, so I’ll, just double click on here and I’m going to copy this text and I’ll go back and I’m going to right. Click on my board text file and I’m, going to edit with notepad plus plus, I have found notepad plus plus, to be much better than the standard Windows. Notepad application, when I was trying to copy in some text somehow must have copied in some additional symbols or something and messed it up. My file pretty good, so I use notepad plus plus now, ok, so I’m, just going to paste in that text that was supplied for us notice, it’s, given us a name, my s bootloader here, ok, and what we want to look for here is the location. So the my sensors bootloader hex, we need to create on my sensors folder inside of our boots, boot loaders folder I’m, going to go back here now open up my boot loaders folder and I’ll just create a new folder called my sensors.

Ok, open that up and then I’m going to copy in my bootloader hex file. Here, ok that’s it now one last thing: some of you may be screaming at the screen right now. We need to go back to our boards. Txt file notice the red that means it’s not saved, so we just need to save it. Otherwise none of this will work all right. So now we go back, we have to exit out of the Arduino IDE all instances and then we’ll relaunch it. So now we can go under tools, board and notice. At the bottom we have our my sensors bootloader. So just like books that you know we just select, it burn bootloader, and that is all we need to do so thanks everyone for watching.

 
 

arduino zero bootloader Video

 

 

 

 

 

 

arduino zero bootloader news

 

 

 

 

 

 

 

arduino zero bootloader Social

 

 

 

 

official.arduino
2019-09-13T20:23:14+0000

See the world through the eyes of this camera-equipped, snake-like robot.
safe image.php?d=AQB2kdm3zOD71KQX&w=720&h=720&url=https%3A%2F%2Fblog.arduino.cc%2Fwp content%2Fuploads%2F2019%2F09%2FUntitled 2 3 - arduino zero bootloader
official.arduino
2019-09-13T16:58:23+0000

This 3D-printed prosthesis uses computer vision to adjust its grip depending on the object.
safe image.php?d=AQD dQbotzfS6mLl&w=720&h=720&url=fbstaging%3A%2F%2Fgraph.facebook - arduino zero bootloader

 

 

Originally posted 2017-05-06 07:46:21.

(Visited 106 times, 1 visits today)

About The Author

You might be interested in

Comment (41)

  1. Good Job! Had the same Problem with the UNO and made a little adapter board to plug in the usbaso cable and the mini. Also works fine.

    Now I really want to try OTA but the flashing part is missing from this video.

    1. Thanks! I will eventually make a video on the OTA process but it was beyond the scope of this one. I wanted to do a generic “burn bootloader” video first as I needed to show how to do that for another upcoming video I’m working on that requires flashing a bootloader. There are so many videos I want to do but never enough time 🙂

  2. Great explanation! I’ve been using AVRDUDESS for several years now for uploading to avrs. Really wonderful software.

    1. Ok, I will try to figure things out myself, but it would be awesome if you make a video explaining this topic and thanks for this great video by the way:)

  3. AWESOME! I really wish more people would upload proper videos like this if they’re gonna record and upload content. excellent video! thank you for the information. I hope you keep stuff like this coming! I’ve had a Pro Mini in my tackle box forever and I haven’t used it because of being to dumb n apprehensive…with this info the pro mini will be thrown into the rotation to finally get some use. thanks again!

  4. Hi Pete,
    many compliments for Your tutorial.
    I have a problem: I bought an Arduino Mega 2560 “Chinese Clone” and It’s impossible to load any sketch in It.
    I tried all ways but I think the bootloader has not loaded.
    I say that because when I connect Arduino to the PC, the L blink very shortly and then never more…
    Do You think it’s possible to recover this situation following your tutorial?
    Do IO need to download the Arduino Mega 2560 bootloader or is included in IDE?
    Thanks a lot, Umberto.

    1. Hmm. You could try. I’ve never personally flashed a bootloader to a Mega. The bootloader should be there with the IDE so you shouldn’t need to download another one.

    2. Hey,
      I have bought an Arduino Nano clone.
      I have tried uploading the sketch but bootloader isn’t installed in it ,so the sketch is not getting up loaded.
      Can I install the bootloader using this method ?
      Umberto ,I have a question for you.
      Did you successfully installed the bootloader on your board ?

  5. When i click detect mcu in avrdudes;

    Unable to detect MCU

    avrdude.exe: set SCK frequency to 1500000 Hz
    avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.
    avrdude.exe: error: programm enable: target doesn’t answer. 1
    avrdude.exe: initialization failed, rc=-1
    Double check connections and try again, or use -F to override
    this check.

    avrdude.exe done. Thank you.

    So what now then ?

    1. Are you sure your wiring is correct? If so, you may have a locked bootloader that will need to be updated with a “high power” programmer. Are you able to upload a bootloader to other Pro Minis (from a different seller)?

    2. Pete B no, i have a working uno, a non working uno, a working nano, and this usbasp. So i tried to burn the bootloader to sick uno, both from working uno, and my working nano. None of them worked. All cables are right.

      Should i risk my precious working nano, and use my working uno to burn bootloader to my working nano ? (Just to see if my usbasp is working or not ?) or should i just toss the sick uno 🙂 and move on ?

    3. Hmm. It doesn’t sound good. Maybe just write off the non-working Uno. You could always buy a pro mini to experiment with. They are very cheap and learning how to burn a bootloader is a good thing to know for the future 🙂 Good luck!

  6. So how can i with cmd without any ide , also i want to ask something , how mcu understand that this program is for bootloader you wrote , did you any change fuse settings , before flash bootloader section ?

    1. I actually did not write the bootloader. Just used it 🙂 You may have to write fuses depending on the bootloader. For this one I don’t believe I did though.

  7. thanks for the very clear and helpful video. I need to OTA, now can I burn the MYSBOOTLOADER and use my own sketch? and how to trigger flashing on the remote node ( the one which has MYSBOOTLOADER, which i tried and succeeded 🙂 )? Maybe you can do a video on that ? thanks for your time.

    1. I have that video on the list but it’s not at the top unfortunately. I have been so busy lately I haven’t had a chance to work on any videos. I’m hoping I’ll be able to get back to it after summer ends and the kids go back to school.
      For the MYSBootloader questions I suggest you head over to the MySensors forum. You will be able to get better help from there. But, you will burn the bootloader using the process in the video then you can upload a sketch using the arduino IDE with an FTDI adapter or use FOTA with the MYSController or I believe MyController will do it as well.

    2. Alright. Now with the cheap ESPs people starts to ignore nrf24. But still I think such a video will get good Likes for the channel. Since I looked up the net and couldn’t find anything for that. Thanks for your time.

    3. Yeah, the advantage of MySensors is you can interchange controllers easier. I haven’t played with the esp yet. I know MySensors supports it but I haven’t had the need yet.

  8. I went a step further but I do not know if it was too hasty. I installed on a pcb the micro atmega328p-au including an external resonator of 8mhz. In order to be able to access its programming later, I arranged ISP and FTDI ports as if it were a pro mini 3.3v to 8mhz, however, following the steps that you indicated I was not able to establish communication. I tried different arduino plates such as pro mini or nano obtaining good results. But I can not advance my project.
    Any suggestions

    1. Hmm, I’m not sure. Just double check the wiring. Also, the pins on the atmega are not the same number on the pro mini. That messed me up when I was trying to add a resonator.

  9. i have a question what is this
    avrdude: Yikes! Invalid device signature.
    Double check connections and try again, or use -F to override this check.
    i had got about 50 + attiny 85 from JD joy buy and when they came only in plastic bag are they dead from static or am i doing some thing wrong.
    the set up i have the attiny 85 will program perfect on the first batch i got, bit they had been in anti static tube…
    hope you can help
    i am using Arduino as ISP

    1. They could be bad or they could need a high voltage programmer. They are probably refurbished if they came in a bag. If so, it’s likely they have had the programming pins repurposed in the fuse settings. You must use a high voltage programmer, like the actual Atmel toolchain hardware, to reset these fuses. Those tools have the ability to do a 12v routine that resets all fuses. I haven’t messed with these chips myself, but I think there may be some alternatives like an Ardy Uno shield or something. If you’re on Windoze just get the Atmel tools and tool chain for the most headache free and functional option. Many people claim to only use windoze still due to Atmel Studio and AVR’s.

  10. Hi, i want to update the firmware on the USBasp device, is there a way to update firmware using the pro mini.?? thank you.

  11. Fantastic, editing the boards.txt file was what I’d forgotten and took me ages until I found your video. Many thanks! (Works for Mac too, by the way).

LEAVE YOUR COMMENT

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