Trying to load Arduino boot loader using AVR Studio 7 - ChinA OpenLog no softwar - Page 1
Forum section: electronics / general

author: AllTheGearNoIdea
author_rank: Unknown
timestamp: December 08, 2017, 09:41:16 pm
content: Hello I need some general help with using the AVR Studio 7 and Arduino. So the story is that I need some RS232 to SD card data loggers. I bought a few of these from sparkfun and very good they are. But they are expensive and I’m a cheap skate and I need 20 of them and cost stacks up.So I bought some openlogs from China as £2 is better than £15. Anyway they didn’t work and I figured out they have no software installed. I have never used Arduino before downloaded Arduino software and followed online advice to install the OpenLog sketch. Well that didn’t work either as the Arduino IDE wouldn’t talk to the AVR microcontroller. So after more reading I figured out I need a boot loader.First thing I found is the SPI programming header is covered in solder mask and the pads are bloody tiny. Scraped off the solder mask and soldered in some jumper cables.Next problem is I didn’t have a programmer so I bought the shareware avrIsp II. Following an online tutorial I installed AVR studio 7 and got the OPtiboot HEX file from the Arduino director on my computer. I found I could read and write to the Arduino and download load optiboot hex but still could not get it to talk to the Arduino IDEI then found out that the boot loader could be down loaded from the Arduino IDE. Unfortunately this didn’t work because there’s a conflict between the AVRIsp driver installed with AVR Studio and the Arduino IDE. Apparently a known problem- well it wasn’t known by me LOL.I found I could down load the boot loader using my bus pirate via the Arduino IDE. I get a little blue light flashing on my open log about every half second, I assume that’s a good sign. I can now connect using the Arduino serial cable and download sketches. So I must be on the home run.So here my questionsI assume when I downloaded the bootloader using the bus pirate and the Arduino IDE it must have correctly set all the memory configuration OSC settings and fuse bits ?Given that I was unable to do this using AVR studio originaly can I use AVR studio now to read back the successful configuration and make a note of the configuration settings. I have tried this but I’m not convinced the read function is actually reading the configuration correctly, I think it’s just showing what I setup originally and not what’s on the working mega chip.I uploaded the memory using the AVR Studio 7 from the working Mega 328P and compared this to the OPtiboot hex file I extracted from the Arduino directory and they are totally different. So my question is when you down load the boot loader using the Arduino IDE which boot loader does it actually install.Finally this has been a total pain in the arse apart prom paying £15 for a genuine OpenLog from sparkfun is there a easier way of downloading the open log sketch. Can I just get a combined hex file that has the OpenLog and bootloader compiled as a single hex file I can install using the AVR Studio.Finally I have a bit of experience using PIC microcontrollers but never used Atmel or Arduino so I’m a bit confused etc.

author: phil from seattle
author_rank: Super Contributor
timestamp: December 08, 2017, 10:19:23 pm
content: If you can upload the sketch to the logger via AS7, why worry about the boot loader?

author: AllTheGearNoIdea
author_rank: Unknown
timestamp: December 08, 2017, 10:38:30 pm
content: Quote from: phil from seattle on December 08, 2017, 10:19:23 pmHello PhilI don’t know how to upload the whole thing using AS7 I’m using the Arduino IDE so program the bootloader using SPI via the bus pirate. I then install a ftdi type interface to serial download the sketch via Arduino IDE.In a perfect world I would just plug one of the original working sparkfun Openlogs int AS7 suck off the configuration and application code save it, then program the lot in one step into the Unconfigured openlogs from China. Is this possible?I don’t really understand what I’m doing and I looking for a simpler method.I’m also trying to figure out why the boot loader installed via AS7 does not work ?Chris

author: JustMeHere
author_rank: Frequent Contributor
timestamp: December 09, 2017, 02:54:20 am
content: I use AVR Dude (http://download.savannah.gnu.org/releases/avrdude/). I also have a USBTinyISP. I do use AVR Studio, though I might be switching to Eclipse Arduino soon. AVR Dude is simple and is an essential tool. This is what Arduino IDE uses. You can set up AVR Studio to use AVR Dude too. Google around for how to do it.

author: AllTheGearNoIdea
author_rank: Unknown
timestamp: December 09, 2017, 10:30:56 am
content: I could give that a try but getting a bit tired trying to install all these different IDEs and trying to configure them for the programmer. I would quite like to stick with AVR Studio 7 unless there’s a compelling reason to use something different.I will however check out your suggestionThanksRegards Chris

author: phil from seattle
author_rank: Super Contributor
timestamp: December 10, 2017, 09:38:06 pm
content: AS7 is a nightmare, frankly. I think the design team members all suffered from extreme ADHD. I'm not sure how it works with your programmer but with Atmel ICE, you go to tools/device programming. Select the programmer (tool), device (the 328P? what ever's on your board) and the interface (ISP). Then look at the fuses. From that it's possible to deduce the clock rate and other settings.You probably can't pull the firmware off as they most likely used the lock fuse.By the way, have you looked here? -https://github.com/sparkfun/OpenLog/wiki/Flashing-Firmware