Author Topic: Burning Optiboot / DualOptiboot bootloader [solved]  (Read 67190 times)

gurari

  • NewMember
  • *
  • Posts: 48
  • Country: bg
Re: Burning Optiboot / DualOptiboot bootloader [solved]
« Reply #30 on: November 16, 2015, 04:28:51 PM »
Sorry for the dumb question, but I never tried burning bootloader to moteino when the radio module is soldered. Is this possible using AtmelStudio?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Burning Optiboot / DualOptiboot bootloader [solved]
« Reply #31 on: November 16, 2015, 04:52:54 PM »
You can but you will need to pullup D10.

underwater

  • NewMember
  • *
  • Posts: 6
  • Country: it
Re: optiboot loader
« Reply #32 on: May 09, 2016, 05:03:21 AM »
If you need to reflash a Moteino you:

- need an AVR programmer - just get the AVR ISP MKii (digikey, don't mess with other cheapie non OEM ones. Saving $10 here is REALLY not worth it - see http://www.digikey.com/product-search/en?keywords=ATAVRISP2-ND
- need to power the Moteino independently of the AVR programmer
- need to pullup pin D10 if the RFM69 radio is already soldered
- the pins are the standard ISP protocol pins (VCC, GND, RST, SPI_CK, SPI_MISO, SPI_MOSI)
- use AVR Studio with target Atmega328p

Hello Felix, thanks for the information.
Can you (or any of you in the forum) please detail the last part which is ''use AVR Studio with target Atmega328p''?

How can I load the bootloader inside atmega328p chip by using avrdude?

According to sparkfun tutorial (https://learn.sparkfun.com/tutorials/installing-an-arduino-bootloader) it is defined with the commands below;

First step setting the fusebits;
avrdude -b 19200 -c usbtiny -p m328p -v -e -U efuse:w:0x05:m -U hfuse:w:0xD6:m -U lfuse:w:0xFF:m
Second step is uploading the program;
avrdude -b19200 -c usbtiny -p m328p -v -e -U flash:w:hexfilename.hex -U lock:w:0x0F:m

Can you detail these commands regarding DualOptiboot?

best regards,
Mirac
« Last Edit: May 09, 2016, 05:45:02 AM by underwater »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: optiboot loader
« Reply #33 on: May 09, 2016, 07:40:19 AM »

Hello Felix, thanks for the information.
Can you (or any of you in the forum) please detail the last part which is ''use AVR Studio with target Atmega328p''?

How can I load the bootloader inside atmega328p chip by using avrdude?

If you need to reflash a Moteino with any bootloader you:

- cannot do it with avrdude (serially burn the bootloader, only through ISP method) still needs an AVR/ISP programmer with avrdude
- need an AVR ISP programmer (I use AVR ISP MKii)
- need to power the Moteino independently of the AVR programmer
- need to pullup pin D10 if the RFM69 radio is already soldered
- the pins are the standard ISP protocol pins (VCC, GND, RST, SPI_CK, SPI_MISO, SPI_MOSI)
- use AVR Studio with target Atmega328p - self explanatory once you look at it
« Last Edit: May 09, 2016, 11:23:31 PM by Felix »

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: optiboot loader
« Reply #34 on: May 09, 2016, 08:26:20 AM »

If you need to reflash a Moteino with any bootloader you:

- cannot do it with avrdude
This is not correct.  You can use avrdude, however...
Quote
- need an AVR ISP programmer (I use AVR ISP MKii)
you need this programmer or, as in the Sparkfun example, you use the AVR Pocket Programmer, which you can buy from Sparkfun and follow their hookup guide. In this case the instructions are exactly like Sparkfun's EXCEPT:
Code: [Select]
avrdude -c usbtiny -p m328p -v -v -e -u -U flash:w:arduino\avr\bootloaders\Moteino\DualOptiboot_V5.0_atmega328_BlinkD9.hex  -U lock:w:0x0F:m

Also, if you have flash memory installed on your Moteino I recommend that you have a 10K pullup resistor on pin 8 of the Moteino.


Tom

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Burning Optiboot / DualOptiboot bootloader [solved]
« Reply #35 on: May 09, 2016, 08:56:33 AM »
Tom,
Right, I was vague, I meant you cannot use avrdude via the traditional serial/ftdi method.
Also I did not see a need for a D8 pullup when FLASHMEM is present, only for D10 whenever a RFM69 is present.

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: Burning Optiboot / DualOptiboot bootloader [solved]
« Reply #36 on: May 09, 2016, 09:11:01 AM »
Also I did not see a need for a D8 pullup when FLASHMEM is present, only for D10 whenever a RFM69 is present.
Yes, my mistake.  I knew one of them needed a pullup and forgot which one.  Although a pullup on every SPI CS pin isn't a bad idea with ISP.

Tom

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Burning Optiboot / DualOptiboot bootloader [solved]
« Reply #37 on: May 09, 2016, 09:15:49 AM »
Also I did not see a need for a D8 pullup when FLASHMEM is present, only for D10 whenever a RFM69 is present.
Yes, my mistake.  I knew one of them needed a pullup and forgot which one.  Although a pullup on every SPI CS pin isn't a bad idea with ISP.

Tom
Yeah not a bad practice. Although all Moteinos with FLASHMEM I ever burned with ISP I never used a pullup and never had an issue. In contrast if I solder a RFM69 and I need to reflash it, it never works, the RFM69 scrambles the SPI/ISP and if I try it a few times it can brick the atmega with bad fuses.

OSBSS

  • NewMember
  • *
  • Posts: 29
  • Country: us
    • OSBSS - Open Source Building Science Sensors
Re: Burning Optiboot / DualOptiboot bootloader [solved]
« Reply #38 on: May 16, 2016, 03:18:12 PM »
Was anyone able to reprogram a Moteino/MoteinoMEGA using an Arduino Uno as ISP? I have a 10K pullup on pin 4 (MoteinoMEGA) and I'm trying to use the example code in the IDE, but it isn't recognizing it: avrdude: Expected signature for ATmega1284P is 1E 97 05. Tried programming another Uno with an Uno ISP and it works fine.

VdesmedT

  • NewMember
  • *
  • Posts: 39
  • Country: be

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: Burning Optiboot / DualOptiboot bootloader [solved]
« Reply #40 on: June 13, 2017, 07:21:33 AM »
Is this little guy good enough : http://www.newark.com/olimex/avr-isp-mk2/flash-programmer-avr-mcu/dp/27W3730 ?
It's got the right 'words' (you need ISP for the 328P) but no experience with it.   

You'll also have to add some pullup resistors if you're going to patch into a Moteino board (pullups on all SPI CS pins - Radio, Flash, etc).

Tom

VdesmedT

  • NewMember
  • *
  • Posts: 39
  • Country: be

fgomes

  • Jr. Member
  • **
  • Posts: 65
Re: Burning Optiboot / DualOptiboot bootloader [solved]
« Reply #42 on: November 27, 2017, 06:15:44 AM »
You can but you will need to pullup D10.
Hi Felix, why not to consider the pull-up resistor (10k) always assembled? It will just add a small additional current consumption each time the RFM module is accessed, or do you see any other problem having the resistor always there?

Best regards

Fernando

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Burning Optiboot / DualOptiboot bootloader [solved]
« Reply #43 on: November 27, 2017, 01:48:07 PM »
I would rather not add parts that are not needed in most cases.

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Burning Optiboot / DualOptiboot bootloader [solved]
« Reply #44 on: November 27, 2017, 10:04:35 PM »
I think it may be possible to use an FTDI cable directly as an ISP programmer using bit-bang mode, albeit slowly. I think AVRdude supports bit-banging using the '-c ft232r' programmer type, defined in avrdude.conf. I'm not sure how reset is handled though, I've never tried this.

Mark.
« Last Edit: November 28, 2017, 09:34:52 AM by perky »