MightyCore throwing an upload syntax error in 1.8.19?

Hi,

I'm properly stuck with this one and wondering if anyone has come across this error before or has any idea of what I might try to resolve it?

I have a custom board based on the 1284p MCU, I was kindly pointed in the direction of the MightyCore board files: GitHub - MCUdude/MightyCore: Arduino hardware package for ATmega1284, ATmega644, ATmega324, ATmega324PB, ATmega164, ATmega32, ATmega16 and ATmega8535 which I am hoping to use with this board. Code compiles fine but at upload I get the error below - I havn't edited anything in the board files but its still throwing a syntax error. I've tried all sorts of things including trying to upload using earlier IDE versions back to V1.5x but they all give the same error.

Any help very much appreciated :slight_smile:

Global variables use 250 bytes (1%) of dynamic memory, leaving 16134 bytes for local variables. Maximum is 16384 bytes.
C:\Users\Me\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\Me\Documents\Arduino\hardware\MightyCore\avr/avrdude.conf -v -patmega1284p -carduino -PCOM6 -b57600 -D -Uflash:w:C:\Users\Me\AppData\Local\Temp\arduino_build_790028/ASCIITable.ino.hex:i 

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "C:\Users\Me\Documents\Arduino\hardware\MightyCore\avr/avrdude.conf"
avrdude: error at C:\Users\Me\Documents\Arduino\hardware\MightyCore\avr/avrdude.conf:402: syntax error
avrdude: error reading system wide configuration file "C:\Users\Me\Documents\Arduino\hardware\MightyCore\avr/avrdude.conf"
avrdude: error reading system wide configuration file "C:\Users\Me\Documents\Arduino\hardware\MightyCore\avr/avrdude.conf"

It says there's a syntax error at line 402 of avrdude.conf

Have you looked at that line?

Hi awneil,

The code in that section of avrdude.conf is below, line 402 has empty "".... would that throw a syntax error?

398 # Overall avrdude defaults; suitable for ~/.config/avrdude/avrdude.rc
399 #
400 default_parallel   = "/dev/parport0";
401 default_serial     = "/dev/ttyS0";
402 default_spi        = "";
403 # default_bitclock = 2.5;

Here is a link to avrdude.config on github: https://github.com/MCUdude/MightyCore/blob/master/avr/avrdude.conf

I'm not confident enough to know how this should be but everything before the problem lines which include 402 is #commented out. Do lines 400, 401 and 402 need to have some sort of title and then get closed out with a ; like the code that comes after?

programmer
    id                     = "wiring";
    desc                   = "Wiring for bootloader using STK500 v2 protocol";
    type                   = "wiring";
    prog_modes             = PM_SPM;
    connection_type        = serial;
;

Can the board be read?

image

Are you using a programmer? (Not sure the above works with a programmer)

Hi Ledsyn,

I'm using FTDI via an external serial board, I have this board working using the 1.0.6 IDE and the board files produced by Maniacbug many moons ago. If I upload the 'ASCII table' demo code in 1.0.6 using the Maniacbug board files it all works, then if I open the serial monitor in 1.8.19 I get the expected serial output. If I use 'Get Board Info' in 1.8.19 I get the output below. Any idea how else I test this trip wire :slight_smile:

BN: Unknown board
VID: 0403
PID: 6001
SN: Upload any sketch to obtain it

Hm, you have both 1.0.6 and 1.8.19 IDE? What version of avrdude is in 1.8.19?

Hi ledsyn,

Yes, with 1.0.6 I can see it is using avrdude version 5.11 which uploads successfully (see below) and with 1.8.19 it uses avrdude 6.3 which fails at upload with the syntax error at the bottom of this post? I'm properly stuck :slight_smile:

IDE 1.0.6

avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "D:\Arduino IDE\arduino-1.0.6\hardware/tools/avr/etc/avrdude.conf"

         Using Port                    : \\.\COM6
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
         AVR Part                      : ATMEGA1284P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

IDE 1.8.19

An error occurred while uploading the sketch
avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\Me\Documents\Arduino\hardware\MightyCore\avr/avrdude.conf"
avrdude: error at C:\Users\Me\Documents\Arduino\hardware\MightyCore\avr/avrdude.conf:402: syntax error
avrdude: error reading system wide configuration file "C:\Users\Me\Documents\Arduino\hardware\MightyCore\avr/avrdude.conf"

From the Boards Manager (in 1.8.19), can you reinstall the AVR Core?

Edit: And if that won't help, reinstall the MightyCore as well.

Thanks Ledsyn, I've now done both of those reinstalls but to no avail..... I'm struggling to think of new things to try :slight_smile:

Rats. Time to bring out the ESD mat and format c:\ I guess... :wink:

Nah, but the last thing I can think of is of course to reinstall the IDE.

Another possibility is that you got a super old IDE, and the latest, from the 1.x family. Perhaps something is shared between them, that the latest version chokes on. Something you could just try out for fun is to create a new user and see if same thing shows up when you run 1.8.19.

Well..... some positive news: If I copy the avrdude.conf file from the location C:\Users\Me\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17\etc to the MightyCore location C:\Users\Me\Documents\Arduino\hardware\MightyCore\avr (overwriting the MightyCore avrdude.cong file after making a backup) everything compiles and uploads as expected :slight_smile: Some initial tests suggests this works but the issue I have now is that I have no idea if this is a sensible solution of if I have made a heap of problems which I'm yet to discover?....... :slight_smile:

1 Like

Well I can't find this

default_spi

option documented anywhere, it's present only in @MCUdude 's avrdude.conf files AFAIK, maybe he can shed some light (I hope he gets notified now).

I can't tell :upside_down_face:

The latest version of MighyCore requires Avrdude 7.1 to work.
The easy solution is to install the latest version using the boards manager.

The other solution is to either update the toolchain Arduino IDE uses (not all that easy), or copy the Avrdude.conf file found in the MightyCore v2.1.3 release, which was the last version before I ditched Avrdude 6.3 in favor of 7.1

1 Like

Thanks both, much appreciated. @hansibull I have used 'boards manager' to update 'Arduino AVR Boards' to the latest verion 1.8.6 and then uploaded some code to the 1284p - the verbose output shows that the AVRdude version besing used is 6.3-20190619 . Where would I find version 7.1 and what is the easiest way to install this? Hopefully I've done something simple wrong and its an easy fix :slight_smile:

1 Like

Remove the MightyCore folder Under User/Arduino/hardware, restart Arduino IDE, and follow these instructions:

https://github.com/MCUdude/MightyCore#boards-manager-installation

1 Like

@hansibull Wow, thanks - that was easy and worked seamlessly without any hacks or tinkering! When I originally did the manual install of MightyCore I thought I was playing it safe - turns out to be the opposite! Thanks for your help getting me there, I can now begin using the board which is great news :slight_smile: Have a good weekend.

1 Like

So it's leftovers from earlier installation in other words?

The problem is that a "Manual" install of MightyCore doesn't include any toochain or tool information in general. In other words, the manually installed core will use the most recent version of avr-gcc and avrdude that the IDE has available. So if you happen to have MiniCore installed through boards manager, the IDE will use the avr-gcc and avrdude version bundled with this core when compiling and uploading using MightyCore.

The next MightyCore release (v3.0.0) will completely replace the Optiboot bootloader with the way superior Urboot bootloader, but this requires Avrdude 7.1 in order to work. So while we're waiting for the "Official" Arduino AVR core to adopt the latest Avrdude version, I should try to figure out how Avrdude 7.1 can be installed "manually", so that Arduino IDE picks it up.

1 Like

Thanks for taking the time to explain @hansibull, its great to have a solution and learn something new. Its also fantastic to hear that there is a future for MightyCore and I look forward to using it more - I've never heard of Urboot so I will head of and read up about it, thanks for the link :slight_smile:

1 Like