Author Topic: Trying to load Arduino boot loader using AVR Studio 7 - ChinA OpenLog no softwar  (Read 1548 times)

0 Members and 1 Guest are viewing this topic.

Offline AllTheGearNoIdeaTopic starter

  • Supporter
  • ****
  • Posts: 269
  • Country: gb
    • AllTheGearNoIdea
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 IDE

I 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 questions

I 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.
AllTheGearNoIdea Where Its All About The Gear
 

Offline phil from seattle

  • Super Contributor
  • ***
  • Posts: 1029
  • Country: us
If you can upload the sketch to the logger via AS7, why worry about the boot loader?
 
The following users thanked this post: AllTheGearNoIdea

Offline AllTheGearNoIdeaTopic starter

  • Supporter
  • ****
  • Posts: 269
  • Country: gb
    • AllTheGearNoIdea
If you can upload the sketch to the logger via AS7, why worry about the boot loader?

Hello Phil

I 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
« Last Edit: December 08, 2017, 10:45:46 pm by AllTheGearNoIdea »
AllTheGearNoIdea Where Its All About The Gear
 

Offline JustMeHere

  • Frequent Contributor
  • **
  • Posts: 743
  • Country: us
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. 
 
The following users thanked this post: AllTheGearNoIdea

Offline AllTheGearNoIdeaTopic starter

  • Supporter
  • ****
  • Posts: 269
  • Country: gb
    • AllTheGearNoIdea
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 suggestion

Thanks

Regards Chris
AllTheGearNoIdea Where Its All About The Gear
 

Offline phil from seattle

  • Super Contributor
  • ***
  • Posts: 1029
  • Country: us
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
« Last Edit: December 10, 2017, 09:56:35 pm by phil from seattle »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf