Arduino Forum

Using Arduino => Microcontrollers => Topic started by: FedorAdarichev on Jan 08, 2018, 01:58 am

Title: 1284p Bootloader w/Arduino as ISP
Post by: FedorAdarichev on Jan 08, 2018, 01:58 am
Hello,

I'm trying to upload a bootloader to a 1284p TQFP44 with a standard layout.  I'm using as my guideline this post here: https://forum.arduino.cc/index.php?topic=321805.0.  I'm using Arduino IDE v1.6.3 and Arduino as ISP.  I chose "avr-developers.com pinout 16MHz using Optiboot" for my board selection.

A picture of my hardware setup is attached. I have a green wire soldered to my reset pin because I realized my FTDI header reset port will be going through a 0.1uF capacitor, so I bypassed it by just soldering the wire from the Arduino straight to the reset switch leg (which is directly connected to the reset pin of the 1284p).  Also, I lost one of the 22pF SMT capacitors for the oscillator, so that is why I have a THT one soldered there instead.

A .txt file of my error message in the Arduino IDE is attached.

Alternatively, I also tried this guideline: https://github.com/MCUdude/MightyCore.  I used Arduino IDE v1.6.11 for that version instead.  I was getting the same sync issue.

The 1284p is getting 5V at VCC, and there no signs of any faulty wiring connections.  The Arduino Uno that I am using is uploading other sketches no problem.

Any idea what my issue is?

Thank you,

Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: pert on Jan 08, 2018, 02:14 am
Did you upload File > Examples > 11.ArduinoISP > ArduinoISP to your Uno?
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: DrAzzy on Jan 08, 2018, 02:16 am
You have not uploaded Arduino as ISP to the arduino being used as a programmer, or you have not disabled reset on the Arduino (the easy way is to put 10uF cap between reset and ground on the programmer.). This sometimes seems to be necessary, and sometimes not; I've been told the behavior here was improved in a somewhat-recent version of the IDE. (I recommend MightyCore with 1.8.5 of the IDE - current release is excellent; the whole 1.8.x series has been solid, unlike 1.6.x which had a lot of bad releases)

I have a green wire soldered to my reset pin because I realized my FTDI header reset port will be going through a 0.1uF capacitor, so I bypassed it by just soldering the wire from the Arduino straight to the reset switch leg (which is directly connected to the reset pin of the 1284p). 
NO! It sounds like you had it wired correctly, and then went out of your way to break it.


There is no reset pin on an FTDI adapter.

The DTR (or RTS) output of the FTDI (or other USB-serial) adapter goes to one side of a 0.1uF cap, and the other side of the cap goes to the reset pin of the AVR. You MUST have the 10k pullup resistor from the reset pin to Vcc.

When the port is opened, DTR goes low and stays low. The cap and pullup form an R-C circuit to convert that high to low edge into a low pulse - which is what we need, because we must bring the reset line low, but then release it (if we don't release it, the chip will be held in reset state and do nothing).

Of course, you're not getting the bootloader uploaded, so you're well before the point that this becomes an issue.
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: ron_sutherland on Jan 08, 2018, 08:47 am
Quote
I lost one of the 22pF SMT capacitors for the oscillator
I have had crystals get thermal shocked when soldering, it is risky to solder near those things. Also, I think the crystal load capacitors both need to have a good temperature coefficient (e.g. an NPO).

https://www.digikey.com/product-detail/en/murata-electronics-north-america/GRM1885C1H220JA01D/490-1411-1-ND/587624 (https://www.digikey.com/product-detail/en/murata-electronics-north-america/GRM1885C1H220JA01D/490-1411-1-ND/587624)
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: FedorAdarichev on Jan 08, 2018, 06:59 pm
@Pert:

Yes, I was using that sketch, but I did not actually upload it.

@ron_sutherland

I was not aware, thanks for the tip.  However, I was able to upload the bootloader (see below), so I am not sure if this indicates that the oscillator is shocked or not?

@DrAzzy:

I was naming my pins incorrectly.  We are on the same page about the DTR pin, which is what I meant when I said "reset" pin.  I have the DTR pin connected through a 0.1uF capacitor to the reset pin on the 1284p, and I have a 10k pull-up resistor from that reset line going to VCC, which I verified is actually giving me 5V to pull-up with using a multimeter.

That being said, I tried your recommendations and I got the bootloader burned! These are the changes I made:

1. Installed Arduino v1.8.6
2. Followed the instructions of this site: http://www.instructables.com/id/Arduino-18x-Clone-With-Atmega-853532644p1284p-the-/
3. Selected the ArduinoISP sketch, and uploaded it successfully with "Arduino Uno" selected under boards.
4. Connected all my wires to the 1284p clone board that I have, with reset still soldered to the leg of the reset switch so its a direct connection.
5. Selected board: "ATmega 1284", variant "p", B.O.D. 2.7V, pinout standard, 16MHz crystal.
6. Selected Programmer "Arduino as ISP (MightyCore)", and hit burn bootloader.

Now, the problem is that I cannot upload my sketches using the FTDI adapter I have.  I have two adapters, and they were both working before on my 328p clone board, so I do not think they are at fault.  I have selected "1284" under boards, and all the same settings that I had when I burned the bootloader.  I'm getting the following error message when I try to upload:

vrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x01

That same "resp=0x01" repeats 10 times.

Any idea what my issue is now?

Thanks,
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: DrAzzy on Jan 08, 2018, 07:39 pm
How do you have DTR and reset wired now? What's connected to reset? It should only be connected to one side of that cap (the other side of which goes to DTR on FTDI adapter), and the pullup (and optionally one side of a reset button).

If there is a reset line on your FTDI adapter, it should not be connected to the Arduino at all.
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: FedorAdarichev on Jan 08, 2018, 09:00 pm
It's wired like this:

DTR-------- 0.1uF cap ------- Reset on 1284P
                                    |
                                    |----Reset Switch (N.O.) ----GND
                                    |
                                10K Resistor
                                    |
                                    |
                                    |
                                 Vcc

The arduino is not not involved in any way anymore, I'm just trying to use the FTDI adapter to upload my sketch to the 1284p clone board.
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: DrAzzy on Jan 08, 2018, 09:48 pm
Okay good. That looks right...
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: FedorAdarichev on Jan 08, 2018, 10:02 pm
When I'm uploading sketches using my FTDI adapter, what do I need to have selected under Programmer? Does it still matter in this case or this selection only relevant when I burn the bootloader?
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: kprims on Jan 08, 2018, 10:17 pm
"It's wired like this:

DTR-------- 0.1uF cap ------- Reset on 1284P
                                    |
                                    |----Reset Switch (N.O.) ----GND
                                    |
                                10K Resistor
                                    |
                                    |
                                    |
                                 Vcc
"

Any possibility you have a capacitor tied across your reset button? On some minimum system boards I have with the capacitor on the reset I am able to get the FTDI to work by tying a 10uF Cap between the DTR and reset instead of the 0.1uF Cap.

Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: pert on Jan 08, 2018, 10:45 pm
this selection only relevant when I burn the bootloader?
It's only relevant for Tools > Burn Bootloader and Sketch > Upload Using Programmer for standard uploads it makes no difference.
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: FedorAdarichev on Jan 08, 2018, 11:09 pm
I do not have any capacitors tied across my reset switch.  I have tried using a 10uF capacitor instead of the 0.1uF capacitor from DTR to Reset, and its still giving me an error. 

Would a damaged oscillator be the problem, as ron_sutherland was mentioning? Because I was able to upload my bootloader, so I'm assuming at this point that the hardware on my clone board is OK, but is the crystal being used during the bootload burning?
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: pert on Jan 08, 2018, 11:19 pm
Try connecting your ISP programmer again and doing another Tools > Burn Bootloader as a test. The first time you did it the microcontroller was likely running on the internal clock, as that is the factory default setting.  But when you did the first Burn Bootloader, if you had Tools > Clock set to 16 MHz external oscillator then it changed the fuses to use the external clock source. If your crystal isn't working this will cause the second attempt at Burn Bootloader to fail since the microcontroller now requires an external clock source to run.
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: FedorAdarichev on Jan 08, 2018, 11:54 pm
I tried again, using the Arduino Uno to burn the bootloader.  The bootloader was successful.  I tried again to upload the sketch using the FTDI adapter, and still getting same error.
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: ron_sutherland on Jan 09, 2018, 03:38 am
Perhaps if you have an LED on the 1284p board burn a blink sketch with the ISP and see if the LED blinks with the timing you expect. May also want a duplicate blink running on the Uno so you can see if the rate is drifting apart.
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: DrAzzy on Jan 09, 2018, 03:53 am
I would:

Show Verbose Upload, post output here, including that first line where it shows the avrdude invocation.

Watch while it uploads, does the LED give the optiboot blink (is there an LED on the pin that the core assumes?) - this is a very important debugging step, as it tells you whether the chip is getting correctly reset when DTR goes low. If it does, it should be working.

If not, does the LED blink when you press reset? If it does - it's the autoreset circuit - if not either there isn't an LED on that pin, or the bootloader isn't running at all.


If it "should be working" per above:
* If you're not using a professionally made cable with the correct pinout for DTR/TX/RX/Vcc/Gnd - if not, swap TX/RX in case you got that backwards (my success rate with TX/RX and SDA/SCL on first try is barely better than random), see if that fixes it :-P (switch it back the way you expect it to be if this doesn't work)
* You're using MightyCore to burn the bootloader - you're using MightyCore to upload right?
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: FedorAdarichev on Jan 09, 2018, 06:51 pm
Here is my output:

Sketch uses 1216 bytes (0%) of program storage space. Maximum is 130048 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 16375 bytes for local variables. Maximum is 16384 bytes.
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Users\ME\AppData\Local\Arduino15\packages\MightyCore\hardware\avr\1.0.6/avrdude.conf -v -patmega1284p -carduino -PCOM7 -b115200 -D -Uflash:w:C:\Users\ME\AppData\Local\Temp\arduino_build_83994/Blink.ino.hex:i

avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\ME\AppData\Local\Arduino15\packages\MightyCore\hardware\avr\1.0.6/avrdude.conf"

         Using Port                    : COM7
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xff
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xff
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xff
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xff
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xff
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xff
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xff
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xff
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xff
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xff

avrdude done.  Thank you.

Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.



I soldered an LED to PB0 on the 1284p, and when I hooked up my FTDI adapter to the computer to upload the sketch (provided power to my clone board), that LED blinked three times.  When I hit upload on the sketch, the "TX" LED on the FTDI adapter blinked three times.  The LED on the MCU actually did different things.  It either didn't blink at all when trying to upload, or it actually did start blinking randomly. It also did not blink when I had power provided through the FTDI adapter and I hit the reset button. 

I tried to re-burn the bootloader, I am getting this error message now:

Error while burning bootloader.
Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

I am for sure using MightyCore.  I switched the TX/RX wires on the FTDI, and it still gives me the same error.
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: kprims on Jan 09, 2018, 07:49 pm
"I can see your approach, but I can't even get any sketch to upload, that's the problem."

Using "Sketch/Upload Using Programmer"?
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: FedorAdarichev on Jan 09, 2018, 08:49 pm
@kprims

When I try and upload using programmer (Arduino Uno), I get the following error:

An error occurred while uploading the sketch
Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.


The LED on the 1284p board (on pin PB0) blinks repeatedly with double pulses while plugged in with the Arduino Uno.  There are no such pulses when I hit upload with the programmer, though.
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: DrAzzy on Jan 09, 2018, 09:38 pm
0x000000 signature indicates wiring mistake or that the clock is no longer running; That would explain why nothing else was working.

I think your replacement crystal loading cap is the problem here; a film cap really isn't appropriate for use as a loading cap (or a decoupling cap, for that matter, for the same reason - too much parasitic inductance) - you need a ceramic one - and that film cap also looks too big to be 22pf too; the loading cap must be the correct capacitance.
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: ron_sutherland on Jan 09, 2018, 09:56 pm
You have an ATMEGA1284P-AU (44TQFP) package which has PB0 at pin 40, RX at pin 9, TX at pin 10. The DIP package has PB0 at pin 1, RX at pin 14, and TX at pin 15. Are you using the right pins? On an ATMEGA1284P-AU package pin 1 is MOSI and is also used for ISP which would explain why the bootloader no longer uploads with the ISP tool if it has an LED.

I see MightyCore has a lot of bootloaders to pick from.

https://github.com/MCUdude/MightyCore/blob/master/avr/bootloaders/optiboot_flash/makeall (https://github.com/MCUdude/MightyCore/blob/master/avr/bootloaders/optiboot_flash/makeall)

Do the options show up in the IDE to allow selecting the bootloader to upload, e.g. one that matches the baud rate (BAUD_RATE=115200) and the crystal (AVR_FREQ=16000000L)?

Does the crystal have any markings, are you sure it is 16MHz?

Update: options do show up

(https://forum.arduino.cc/index.php?action=dlattach;topic=521308.0;attach=240470)

Update+: wait I don't see a baud rate to click... hmmm
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: trungdn on Jan 09, 2018, 11:29 pm
@kprims

When I try and upload using programmer (Arduino Uno), I get the following error:

An error occurred while uploading the sketch
Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.


The LED on the 1284p board (on pin PB0) blinks repeatedly with double pulses while plugged in with the Arduino Uno.  There are no such pulses when I hit upload with the programmer, though.

http://www.instructables.com/id/Arduino-atmega6441284-clone/

I followed this instruction and it works pretty well to me.
I use FTDI to upload as well.

Try to use the libraries mention on this instruction. Make sure the connection is correct. It happened to me few times. Check clock, RX, TX connection.   
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: FedorAdarichev on Jan 09, 2018, 11:31 pm
@DrAzzy

I want to confirm that yes I do have a 22pF capacitor on there, but it is film as you are indicating.  I replaced it with a 7pF and 15pF in parallel (producing 22pF).  I attached a photo as well, maybe that will reveal some problem I am not seeing.  I'm still getting the same avrdude: Device signature = 0x000000 when trying to burn the bootloader.

@ron_sutherland

Right now, I have RXI from the FTDI adapter going to pin 12 TXD1 on the 1284p, and TXD from the FTDI adapter going to pin 11 RXD1 on the 1284p.  This is according to MCUDude's "Standard" pinout, which is what I selected when I burned the bootloader (as opposed to Bobuino pinout). So, in this case, would my connections be correct? Does it have to be pins 9 and 10 instead of 11 and 12? And if it does have to be 9 and 10, is there a way I can edit this in the MightyCore software?

As far as baud rate options, there is nowhere in the IDE where I can select the baud rate, but I can select the MHz rating, and assuming my vendor supplied the right information and sent the right parts, I am using a 16 MHz oscillator.  It also has "16" written on top of it, you can see this in the photo as well.  Do you know how I can make a selection for the baud rate?

Thank you gentleman, I have a feeling we are close to finding a solution!

Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: FedorAdarichev on Jan 10, 2018, 12:06 am
@trungdn

What version of Arduino IDE are you using?
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: ron_sutherland on Jan 10, 2018, 01:32 am
I think all the bootloaders in MightyCore are set to use UART0 so you need to use pin 9 and 10 (on the TQFP package) as the bootload port.

OP image
(https://forum.arduino.cc/index.php?action=dlattach;topic=521308.0;attach=240478)

pinout of 1284p-au
(https://forum.arduino.cc/index.php?action=dlattach;topic=521308.0;attach=240484)

Quote
is there a way I can edit this in the MightyCore software?
yes, but I only know how to do this on Linux.
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: ron_sutherland on Jan 10, 2018, 01:52 am
Actually, Hans may want to add that option, if you want to start an issue on GitHub.

https://github.com/MCUdude/MightyCore/issues (https://github.com/MCUdude/MightyCore/issues)
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: ron_sutherland on Jan 10, 2018, 09:27 am
Decided to have a look at the bootloader, so first make a fork

https://github.com/epccs/MightyCore/ (https://github.com/epccs/MightyCore/)

I had problems building the serial bootloader on Ubuntu 17.10  so I tried 16.04 on a different machine which is what these notes are for

Github cloned it into my Samba file-share with has CR+LF on the scripts, it is the the everlasting line-ending gift from hell. Which was some of the issue I was having on 17.10.

Code: [Select]
make atmega1284p AVR_FREQ=16000000L BAUD_RATE=115200 UART=0 LED=B0 LED_START_FLASHES=2 -BIGBOOT
...
avr-gcc -g -Wall -Os -fno-split-wide-types -mrelax -fno-caller-saves -mmcu=atmega1284p -DF_CPU=16000000L  -DBAUD_RATE=115200 -DLED_START_FLASHES=2    -DLED=B0  -DBIGBOOT -DUART=0 -Wl,--section-start=.text=0x1fc00 -Wl,--section-start=.version=0x1fffe -Wl,--relax -nostartfiles -nostdlib -o atmega1284p/optiboot_flash_atmega1284p_115200_16000000L.elf optiboot_flash.o -lc
optiboot_flash.o: In function `appStart':
/home/rsutherland/Samba/git/MightyCore/avr/bootloaders/optiboot_flash/optiboot_flash.c:887: undefined reference to `eeprom_write_byte'
/home/rsutherland/Samba/git/MightyCore/avr/bootloaders/optiboot_flash/optiboot_flash.c:887: undefined reference to `eeprom_read_byte'
collect2: error: ld returned 1 exit status


Looking in the bootloader I see

Code: [Select]
#if defined(SUPPORT_EEPROM) || defined(BIGBOOT)
    case 'E': // EEPROM
 do {
    putch(eeprom_read_byte((uint8_t *)(address++)));
 } while (--length);
 break;
#endif


some how the SUPPORT_EEPROM flag is being set, but I don't want to waste time looking at the Makefile it is to full of cruft (would that be better in a readme, or a donotreadme).

anyway I am just going to comment that and build the bootloader.
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: ron_sutherland on Jan 10, 2018, 09:28 am
I striped the other hex files to limit the confusion.

Anyway this is the bootloader image I ended up with that has UART = 1

https://github.com/epccs/MightyCore/tree/master/avr/bootloaders/optiboot_flash/atmega1284p (https://github.com/epccs/MightyCore/tree/master/avr/bootloaders/optiboot_flash/atmega1284p)

If you want to try it I guess you can replace the one you have in

Code: [Select]
C:\Users\<your_user>\AppData\Local\Arduino15\packages\MightyCore\hardware\avr\1.0.8\bootloaders\optiboot_flash\atmega1284p

Note: I will probably nuke the repo in a few weeks but wanted to have a look at the bootloader, I was using xboot on my 1284p board but would like to have options in case I have problems when I start working on it again.
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: FedorAdarichev on Jan 10, 2018, 10:01 pm
It works!

I replaced the oscillator on my board, and also shortened up the leads on the replacement 22pF capacitor I had.  With these changes, I was able to successfully burn the the UART1 version of the bootloader per ron's instruction as outlined above.  Now, after burning that version of the bootloader, I am able to still use the same PCB layout I currently have to upload sketches with my FTDI.

Big thanks to DrAzzy and ron_sutherland for helping me through this!

However, now that I have my sketch uploaded, I'm trying to debug using serial print, and I'm not seeing anything on my serial monitor, is this also some additional code in the bootloader that has to be included?
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: DrAzzy on Jan 10, 2018, 10:12 pm
However, now that I have my sketch uploaded, I'm trying to debug using serial print, and I'm not seeing anything on my serial monitor, is this also some additional code in the bootloader that has to be included?
Nope, it ought to just work - the fact that you can upload using serial instead of ISP indicates that you have the wiring correct.

I don't see a way it could be broken here unless you forgot Serial.begin() or something in the sketch... it would have to be a bug in the core, but I can't imagine such an unsubtle bug being in MightyCore; everyone uses Serial.
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: pert on Jan 10, 2018, 10:44 pm
Make sure the baud rate setting in the bottom corner of Serial Monitor matches the value in your Serial.begin().
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: ron_sutherland on Jan 10, 2018, 10:55 pm
Nice :)

Seria1*.begin() where *= is the number 1 (UART= 1 right?)
the number looks too much like the letter.

also remember the core you are using is

 https://github.com/MCUdude/MightyCore/tree/master/avr/cores/MightyCore (https://github.com/MCUdude/MightyCore/tree/master/avr/cores/MightyCore)

I would look it over some and not assume it is the same as the Arduino core.

Also, you are in charge of keeping that hex file, e.g. expect that I will remove that fork at some point.
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: DrAzzy on Jan 10, 2018, 11:02 pm
Seria1*.begin() where *= is the number 1 (UART= 1 right?)
He's probably using UART0 (Serial) not UART1 (Serial1) since it sounds like he's talking over the same serial port as he's programmed it with, and the bootloader uses UART0.
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: ron_sutherland on Jan 10, 2018, 11:14 pm
This is how I made the bootloader hex in the fork of MightyCore on GitHub

(https://forum.arduino.cc/index.php?action=dlattach;topic=521308.0;attach=240633)

https://github.com/epccs/MightyCore/commit/44e84319371771d2231489a72bf72ea239836a76 (https://github.com/epccs/MightyCore/commit/44e84319371771d2231489a72bf72ea239836a76)
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: pert on Jan 10, 2018, 11:39 pm
Also posted at:
https://github.com/MCUdude/MightyCore/issues/75 (https://github.com/MCUdude/MightyCore/issues/75)
If you're going to do that then please be considerate enough to add links to the other places you cross posted. This will let us avoid wasting time due to duplicate effort and also help others who have the same questions and find your post to discover all the relevant information. When you post links please always use the chain links icon on the toolbar to make them clickable.
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: FedorAdarichev on Jan 11, 2018, 12:01 am
@pert

I apologize, will do on cross-referencing in the future.

@DrAzzy and @ron_sutherland

You are right, I forgot to put the "1", I changed it, and now it works!

@ron_sutherland

I have saved that hex file to my computer and also noted how you made it.

Thank you all!
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: ron_sutherland on Jan 11, 2018, 12:17 am
Maybe it would be good to keep that issue open for a little, it would be better If Hans could add the UART=1 option since it does work and he knows how to make such options show up in the IDE.
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: hansibull on Jan 11, 2018, 10:08 am
Hi!

Quote
Maybe it would be good to keep that issue open for a little, it would be better If Hans could add the UART=1 option since it does work and he knows how to make such options show up in the IDE.
It's not difficult at all to add UART=1 to the boards menu, but I don't think I want that. Some users also wanted a separate menu for the bootloader baud rate, but I didn't implement it. This is to keep the boards menu as simple as possible. Remember, most users are happy with using UART0 with the default baudrate.

I may implement this later, but this require a bit of work in order to make this as elegant as possible.
I'm thinking about adding a parameter like this to select which UART to use MightyCore  boards.txt#L76 (https://github.com/MCUdude/MightyCore/blob/master/avr/boards.txt#L76)
Title: Re: 1284p Bootloader w/Arduino as ISP
Post by: hansibull on Jan 11, 2018, 11:19 pm
I'm doing some work on the bootloaders. Will integrate them into MightyCore soon. The bootloader repo can be found here: MCUdude Optiboot_flash (https://github.com/MCUdude/optiboot_flash)