Avr g error missing device or architecture after mmcu

When running arduino from rasp pi cli, it is not passing mmcu. Picked up JAVA_TOOL_OPTIONS: Loading configuration... Initializing packages... Preparing boards... Verifying... /home/pi/projects/vend...

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account

Labels

Component: CLI

The Arduino IDE’s command line interface

Type: Invalid

Off topic for this repository, or a bug report determined to not actually represent a bug

Comments

@ChillarAnand

When running arduino from rasp pi cli, it is not passing mmcu.

Picked up JAVA_TOOL_OPTIONS: 
Loading configuration...
Initializing packages...
Preparing boards...
Verifying...
/home/pi/projects/vendor/arduino/arduino-builder -dump-prefs -logger=machine -hardware /home/pi/projects/vendor/arduino/hardware -tools /home/pi/projects/vendor/arduino/tools-builder -tools /home/pi/projects/vendor/arduino/hardware/tools/avr -built-in-libraries /home/pi/projects/vendor/arduino/libraries -libraries /root/Arduino/libraries -fqbn=arduino:avr:mega -vid-pid=0X2341_0X0042 -ide-version=10804 -build-path /tmp/arduino_build_293002 -warnings=null -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=/home/pi/projects/vendor/arduino/hardware/tools/avr -prefs=runtime.tools.avr-gcc.path=/home/pi/projects/vendor/arduino/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/home/pi/projects/vendor/arduino/hardware/tools/avr -verbose /tmp/arduino.ino
/home/pi/projects/vendor/arduino/arduino-builder -compile -logger=machine -hardware /home/pi/projects/vendor/arduino/hardware -tools /home/pi/projects/vendor/arduino/tools-builder -tools /home/pi/projects/vendor/arduino/hardware/tools/avr -built-in-libraries /home/pi/projects/vendor/arduino/libraries -libraries /root/Arduino/libraries -fqbn=arduino:avr:mega -vid-pid=0X2341_0X0042 -ide-version=10804 -build-path /tmp/arduino_build_293002 -warnings=null -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=/home/pi/projects/vendor/arduino/hardware/tools/avr -prefs=runtime.tools.avr-gcc.path=/home/pi/projects/vendor/arduino/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/home/pi/projects/vendor/arduino/hardware/tools/avr -verbose /tmp/arduino.ino
Using board 'mega' from platform in folder: /home/pi/projects/vendor/arduino/hardware/arduino/avr
Using core 'arduino' from platform in folder: /home/pi/projects/vendor/arduino/hardware/arduino/avr
Detecting libraries used...
"/home/pi/projects/vendor/arduino/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu= -DF_CPU=16000000L -DARDUINO=10804 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR   "-I/home/pi/projects/vendor/arduino/hardware/arduino/avr/cores/arduino" "-I/home/pi/projects/vendor/arduino/hardware/arduino/avr/variants/mega" "/tmp/arduino_build_293002/sketch/arduino.ino.cpp" -o "/dev/null"
Generating function prototypes...
"/home/pi/projects/vendor/arduino/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu= -DF_CPU=16000000L -DARDUINO=10804 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR   "-I/home/pi/projects/vendor/arduino/hardware/arduino/avr/cores/arduino" "-I/home/pi/projects/vendor/arduino/hardware/arduino/avr/variants/mega" "/tmp/arduino_build_293002/sketch/arduino.ino.cpp" -o "/tmp/arduino_build_293002/preproc/ctags_target_for_gcc_minus_e.cpp"
avr-g++: error: missing device or architecture after '-mmcu='

Here is the same working correctly from ubuntu cli

"/home/chillaranand/projects/vendor/arduino/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR   "-I/home/chillaranand/projects/vendor/arduino/hardware/arduino/avr/cores/arduino" "-I/home/chillaranand/projects/vendor/arduino/hardware/arduino/avr/variants/mega" "/home/chillaranand/projects/vendor/arduino/hardware/arduino/avr/cores/arduino/WMath.cpp" -o "/tmp/arduino_build_178850/core/WMath.cpp.o"
"/home/chillaranand/projects/vendor/arduino/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections
 -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR   "-I/home/chillaranand/projects/vendor/arduino/hardware/arduino/avr/cores/arduino" "-I/home/chillaranand/projects/vendor/arduino/hardware/arduino/avr/variants/mega" "/home/chillaranand/projects/vendor/arduino/hardware/arduino/avr/cores/arduino/WString.cpp" -o "/tmp/arduino_build_178850/core/WString.cpp.o"

@matthijskooijman

You didn’t say how you are calling the Arduino IDE on the CLI, which seems to be essential information here. The builder commandline contains -fqbn=arduino:avr:mega which suggests that is the board name you are passing on the commandline. However, it is missing the cpu option that distinguishes between the Mega with 2560 and 1280.

When I select the mega2560 in the Arduino IDE GUI and run verify, I see -fqbn=arduino:avr:mega:cpu=atmega2560 in the verbose output, which I think should fix your issue.

@ChillarAnand

@matthijskooijman I am using this command

arduino --port /dev/ttyACM* --board arduino:avr:mega --upload foo.ino

@per1234

Try this:

arduino --port /dev/ttyACM* --board arduino:avr:mega:cpu=atmega2560 --upload foo.ino

@ChillarAnand

Thanks. It fixed the issue. Is it documented anywhere?

@facchinm

@per1234
per1234

added

Component: CLI

The Arduino IDE’s command line interface

Type: Invalid

Off topic for this repository, or a bug report determined to not actually represent a bug

labels

Aug 4, 2017

@matthijskooijman

@facchinm, perhaps it would make sense for the IDE or arduino-builder to detect a missing parameter and error out (listing all possible values for the parameter perhaps)? AFAICS it is never valid to omit a parameter, right (the GUI doesn’t allow this either)? This is a common problem it seems, and listing the valid fqbns would be helpful to users.

@facchinm

I agree about adding a command to list available fqbns. Don’t have any strong opinion about failing on missing parameter, though.

Labels

Component: CLI

The Arduino IDE’s command line interface

Type: Invalid

Off topic for this repository, or a bug report determined to not actually represent a bug

I’m using an Arduino package called Arduino-makefile or Arduino-mk to program Arduino Uno from the command line. Recently I wanted to program an ATtiny85 microcontroller (MC). This is my makefile:

    ################ MAKEFILE ###################################
    ARDUINO_DIR = /usr/share/arduino
    ###################################################
    ISP_PROG = usbasp
    ALTERNATE_CORE = attiny-master
    BOARD_TAG = attiny
    BOARD_SUB = attiny85
    F_CPU = 16000000L
    ###################################################
    include /usr/share/arduino/Arduino.mk

    # !!! Important. You have to use 'make ispload' when using an ISP.

this is what I want to upload to the Attiny85 MC:

int led = 3;

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);     
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}

Here are the instructions for making the makefile: Makefile
I also downloaded this boards.txt file.
To upload the code into the MC I use the command sudo make upload which did not work, so I then used sudo make ispload. Both of these commands gave the error message:

avr-g++: error: missing device or architecture after ‘-mmcu=’
/usr/share/arduino/Arduino.mk:1215: recipe for target 'build-attiny-attiny85/ATtinyBlink.o' failed
make: *** [build-attiny-attiny85/ATtinyBlink.o] Error 1 

Я использую пакет Arduino под названием Arduino-makefile или Arduino-mk для программирования Arduino Uno из командной строки. Недавно я хотел запрограммировать микроконтроллер (MC) ATtiny85. Это мой make-файл:

    ################ MAKEFILE ###################################
    ARDUINO_DIR = /usr/share/arduino
    ###################################################
    ISP_PROG = usbasp
    ALTERNATE_CORE = attiny-master
    BOARD_TAG = attiny
    BOARD_SUB = attiny85
    F_CPU = 16000000L
    ###################################################
    include /usr/share/arduino/Arduino.mk

    # !!! Important. You have to use 'make ispload' when using an ISP.

Вот что я хочу загрузить в Attiny85 MC:

int led = 3;

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);     
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}

Вот инструкции по созданию make-файла: Makefile
Я тоже скачал этот файл доски.txt.
Чтобы загрузить код в MC, я использую команду sudo make upload, которая не сработала, поэтому я затем использовал sudo make ispload. Обе эти команды выдали сообщение об ошибке:

avr-g++: error: missing device or architecture after ‘-mmcu=’
/usr/share/arduino/Arduino.mk:1215: recipe for target 'build-attiny-attiny85/ATtinyBlink.o' failed
make: *** [build-attiny-attiny85/ATtinyBlink.o] Error 1 

Recommend Projects

  • React photo

    React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo

    Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo

    Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo

    TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo

    Django

    The Web framework for perfectionists with deadlines.

  • Laravel photo

    Laravel

    A PHP framework for web artisans

  • D3 photo

    D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Visualization

    Some thing interesting about visualization, use data art

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo

    Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo

    Microsoft

    Open source projects and samples from Microsoft.

  • Google photo

    Google

    Google ❤️ Open Source for everyone.

  • Alibaba photo

    Alibaba

    Alibaba Open Source for everyone

  • D3 photo

    D3

    Data-Driven Documents codes.

  • Tencent photo

    Tencent

    China tencent open source team.

solved

Hi, I am trying to build for a Keystone ATmega2560 board using the arduino-makefile package.

I’ve used advice from https://jcs.org/2019/12/17/arduino.

Makefile

BOARD_TAG = mega
include /usr/local/share/arduino-makefile/Arduino.mk

I can gmake without the BOARD_TAG and with other tags like leonardo; however the mega board_tag does not work

Arduino.mk

-------------------------
Arduino.mk Configuration:
- [AUTODETECTED]       CURRENT_OS = OPENBSD 
- [USER]               ARDUINO_DIR = /usr/local/share/arduino 
- [COMPUTED]           ARDMK_DIR = /usr/local/share/arduino-makefile (relative to Common.mk)
- [DEFAULT]            ARDUINO_VERSION = 100 
- [DEFAULT]            ARCHITECTURE =  
- [DEFAULT]            ARDMK_VENDOR = arduino 
- [DEFAULT]            ARDUINO_SKETCHBOOK =  
- [USER]               AVR_TOOLS_DIR = /usr/local 
- [COMPUTED]           ARDUINO_LIB_PATH = /usr/local/share/arduino/libraries (from ARDUINO_DIR)
- [USER]               ALTERNATE_CORE_PATH = /usr/local/share/arduino 
- [COMPUTED]           ARDUINO_VAR_PATH = /usr/local/share/arduino/variants (from ALTERNATE_CORE_PATH)
- [COMPUTED]           BOARDS_TXT = /usr/local/share/arduino/boards.txt (from ALTERNATE_CORE_PATH)
- [DEFAULT]            USER_LIB_PATH = /libraries (in user sketchbook)
- [DEFAULT]            PRE_BUILD_HOOK = pre-build-hook.sh 
- [USER]               BOARD_TAG = mega 
- [COMPUTED]           CORE = arduino (from build.core)
- [COMPUTED]           VARIANT = mega (from build.variant)
- [COMPUTED]           OBJDIR = build-mega (from BOARD_TAG)
- [COMPUTED]           ARDUINO_CORE_PATH = /usr/local/share/arduino/cores/arduino (from ALTERNATE_CORE_PATH, BOARD_TAG and boards.txt)
- [ASSUMED]            MONITOR_BAUDRATE = 9600 
- [DEFAULT]            OPTIMIZATION_LEVEL = s 
- [DEFAULT]            MCU_FLAG_NAME = mmcu 
- [DEFAULT]            CFLAGS_STD = -std=gnu11 -flto -fno-fat-lto-objects 
- [DEFAULT]            CXXFLAGS_STD = -std=gnu++11 -fno-threadsafe-statics -flto 
- [COMPUTED]           DEVICE_PATH = /dev/ttyU0 (from MONITOR_PORT)
- [DEFAULT]            FORCE_MONITOR_PORT =  
- [AUTODETECTED]       Size utility: Basic (not AVR-aware)
- [COMPUTED]           BOOTLOADER_PARENT = /usr/local/share/arduino/hardware/arduino//bootloaders (from ARDUINO_DIR)
- [COMPUTED]           ARDMK_VERSION = 1.5 
- [COMPUTED]           CC_VERSION = 8.5.0 (avr-gcc)
-------------------------
mkdir -p build-mega
/usr/local/bin/avr-g++ -x c++ -include Arduino.h -MMD -c -mmcu= -DF_CPU=16000000L -DARDUINO=100  -D__PROG_TYPES_COMPAT__ -I/usr/local/share/arduino/cores/arduino -I/usr/local/share/arduino/variants/mega    -Wall -ffunction-sections -fdata-sections -Os -fpermissive -fno-exceptions -std=gnu++11 -fno-threadsafe-statics -flto buildtest.ino -o build-mega/buildtest.ino.o
avr-g++: error: missing device or architecture after '-mmcu='
gmake: *** [/usr/local/share/arduino-makefile/Arduino.mk:1262: build-mega/buildtest.ino.o] Error 1

I am not sure how to fix «missing device or architecture after ‘-mmcu='». The mega build_tag is included inside «arduino/boards.txt»

SOLVED: added MCU flag and compiles. I haven’t tested with my board yet so I will see if I have any other problems

BOARD_TAG =mega 
MCU =atmega2560
include /usr/local/share/arduino-makefile/Arduino.mk

edit 2: found that adding mega.build.mcu=atmega2560 to arduino/boards.txt also solves it; however i am unsure if I should commit this or this should just stay since there are different mega mcu’s

edit3: ^ i realize that there was more trouble shooting mostly with the flags

i was so stuck getting this error constantly

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

I fixed the flag for the editor to be stk500v2, documenation really does save the day

ALSO LETS GO IT FINALLY WORKS, i might make a post on this later that is more organized

Я использую пакет Arduino под названием Arduino-makefile или Arduino-mk для программирования Arduino Uno из командной строки. Недавно я хотел запрограммировать микроконтроллер ATtiny85 (MC). Это мой make-файл:

    ################ MAKEFILE ###################################
    ARDUINO_DIR = /usr/share/arduino
    ###################################################
    ISP_PROG = usbasp
    ALTERNATE_CORE = attiny-master
    BOARD_TAG = attiny
    BOARD_SUB = attiny85
    F_CPU = 16000000L
    ###################################################
    include /usr/share/arduino/Arduino.mk

    # !!! Important. You have to use 'make ispload' when using an ISP.

Это то, что я хочу загрузить в Attiny85 MC:

int led = 3;

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);     
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}

Вот инструкции по созданию make-файла: Makefile Я также скачал этот файл boards.txt. Чтобы загрузить код в MC, я использую команду sudo make upload, которая не сработала, поэтому я использовал sudo make ispload. Обе эти команды дали сообщение об ошибке:

avr-g++: error: missing device or architecture after ‘-mmcu=’
/usr/share/arduino/Arduino.mk:1215: recipe for target 'build-attiny-attiny85/ATtinyBlink.o' failed
make: *** [build-attiny-attiny85/ATtinyBlink.o] Error 1 

1 ответ

Попробуйте удалить BOARD_TAG и оставить только BOARD_SUB.


0

prosoitos
30 Сен 2020 в 18:04

avr-g++: error: missing device or architecture after ‘-mmcu=’ #6585

Comments

ChillarAnand commented Aug 4, 2017

When running arduino from rasp pi cli, it is not passing mmcu.

Here is the same working correctly from ubuntu cli

The text was updated successfully, but these errors were encountered:

matthijskooijman commented Aug 4, 2017

You didn’t say how you are calling the Arduino IDE on the CLI, which seems to be essential information here. The builder commandline contains -fqbn=arduino:avr:mega which suggests that is the board name you are passing on the commandline. However, it is missing the cpu option that distinguishes between the Mega with 2560 and 1280.

When I select the mega2560 in the Arduino IDE GUI and run verify, I see -fqbn=arduino:avr:mega:cpu=atmega2560 in the verbose output, which I think should fix your issue.

ChillarAnand commented Aug 4, 2017

@matthijskooijman I am using this command

per1234 commented Aug 4, 2017

ChillarAnand commented Aug 4, 2017

Thanks. It fixed the issue. Is it documented anywhere?

facchinm commented Aug 4, 2017

matthijskooijman commented Aug 4, 2017

@facchinm, perhaps it would make sense for the IDE or arduino-builder to detect a missing parameter and error out (listing all possible values for the parameter perhaps)? AFAICS it is never valid to omit a parameter, right (the GUI doesn’t allow this either)? This is a common problem it seems, and listing the valid fqbns would be helpful to users.

facchinm commented Aug 4, 2017

I agree about adding a command to list available fqbns. Don’t have any strong opinion about failing on missing parameter, though.

Источник

Erro avr-g++: error: missing device or architecture after ‘-mmcu=’ #175

Comments

rafaelgov95 commented May 19, 2017

When running upload, it gives the following error

/exemple/CMakeLists.txt

/exemple/exemple.cpp

n cpp the Serial function turns red without a library

I need grateful help!

The text was updated successfully, but these errors were encountered:

MrPointer commented May 30, 2017 •

It is because the ‘Mega’ board has multiple architectures it can operate on.

As such, you should manually specify the architecture being used by adding the following line to your CMakeLists.txt file:
set(mega.build.mcu atmega2560)

Note that some other boards such as the ‘Nano’ also have this «limitation», and therefore should be manually defined. However, every board has a different ID, and possibly a different architecture, thus have to be defined differently, according to the following pattern:
set(BOARD_ID.build.mcu ARCHITECTURE)

Serial will be resolved afterwards, even without including the HardwareSerial header file.

rafaelgov95 commented May 30, 2017

Put the indicated line but did not do it, continue with the error.

MrPointer commented May 30, 2017

Try to reset CMake’s cache instead of just reloading it, should solve the issue.

rafaelgov95 commented May 30, 2017

Do you have any design you can share? I think it’s a problem in the project!

Источник

avr-g++: error: missing device or architecture after ‘-mmcu=’ #426

Comments

joshuacox commented Apr 28, 2016

I’ve read through the other threads on this but I have my BOARD_SUB set to atmega328, and the core is set according to the arch wiki:
https://wiki.archlinux.org/index.php/arduino#Arduino-mk

whcih tells me I need something like this in my Makefile:
BOARD_TAG = nano
BOARD_SUB = atmega328
ARDUINO_DIR = /usr/share/arduino
ARDMK_DIR = /usr/share/arduino
AVR_TOOLS_DIR = /usr
ARDUINO_CORE_PATH = /usr/share/arduino/hardware/arduino/avr/cores/arduino
BOARDS_TXT = /usr/share/arduino/hardware/arduino/avr/boards.txt
ARDUINO_VAR_PATH = /usr/share/arduino/hardware/arduino/avr/variants
BOOTLOADER_PARENT = /usr/share/arduino/hardware/arduino/avr/bootloaders
include /usr/share/arduino/Arduino.mk

it was all working till I reinstalled on my machine, so I’m not certain what went wrong

I’ve got all the usual suspects installed:

The text was updated successfully, but these errors were encountered:

sej7278 commented Apr 28, 2016

i think your Makefile is overly-complex so something has been set incorrectly, better to let it auto-detect your environment. this works for me:

joshuacox commented Apr 28, 2016 •

ya when I mentioned it was working before it was pretty minimal at that point, I added all that other stuff when attempting to fix it myself before reaching out here, I don’t have anything in my $(HOME) other than the sketchbook it’s all in /usr/share/arduino , so my similarly slim makefile is thus:

same result though:

sej7278 commented Apr 28, 2016

i’ve no idea really, it looks like it should work. could you try a basic (blink?) script without any libraries.

i assume you’ve not got 1.0 and 1.6 mixed in there — don’t usually see 1.6 installed in /usr/share/arduino

joshuacox commented Apr 28, 2016 •

Just to test I fired up the blue IDE and it worked, so at least it can use the toolchain to build a hexfile, same Makefile

perhaps I should checkout arduino directly

sej7278 commented Apr 28, 2016 •

core and variant are empty too.

any chance you could try the git version, maybe the arch package is messed up?

could you do a make show_boards ?

you haven’t used the awful boards manager to download the nano328 core have you?

here’s my output (from debian) with a basic blink-style sketch, i really can’t see any difference other than core and variant, its like it can’t read the boards.txt

joshuacox commented Apr 29, 2016

ugh, I forgot the arduino repo was a full gig!

while it downloads I’ve been toying with a docker image that does it instead using debian jessie:

make run and make enter and from inside the container I can even program over USB. This might be end up being how I program for these things if on arch linux like I am on this machine.

sej7278 commented Apr 29, 2016

i did kinda mean the git version of arduino-mk not arduino lol 😉

sej7278 commented Apr 30, 2016

i’ve not really got any arch experience, maybe i’ll fire up a docker image to play with, but i can only think the problem is the arch package of arduino-mk (or the ide?) as its almost a year out-of-date, we need to see if you get the same problem from the git head of arduino-mk

joshuacox commented Apr 30, 2016 •

Sorry about that, I was traveling yesterday. Sure enough checking the git repo (of Arduihno-Makefile, and not Arduino itself, lol). And then including it properly e.g.

results in a perfectly fine compile, I’m raising this issue with the AUR and closing here. @sej7278 I greatly appreciate the second set of eyes on my situation.

PS — the docker thing surprisingly works very well if anyone is stuck inbetween a rock and a hard place.

sej7278 commented Apr 30, 2016

not a problem @joshuacox, the AUR probably just needs to update to the 1.5.1 release (git HEAD), i’m quite surprised docker supports serial uploading and stuff too, that’s cool.

joshuacox commented Apr 30, 2016

of note, it is the —privileged option that grants this power to the docker container. Which is complete unmitigated access to /dev/* amongst other things (like the ability to overwrite /etc/shadow ; ). But this is me running it on my own machine dedicated to this purpose, so I’m comfortable with the risk.

embed commented Aug 4, 2017 •

Currently I am having the same problem. Manjaro (Arch) Linux, MArduino-Makefile from git(here), Arduino 1.8.2 from Arduino.cc. Makefile

Also I have exactly the same problem if I compile the Blink example for anything other than uno. I need to build for pro. I think I need to choose a sub option.

sej7278 commented Aug 4, 2017

yes if you use arduino 1.5 or later you will generally need a submenu-board, there’s no such thing as a «pro»

sej7278 commented Aug 5, 2017

@jobegit looks like you have a similar issue — you’re using the old 1.0.x style BOARD_TAG without a BOARD_SUB, but you probably also need to specify your ARDUINO_SKETCHBOOK

embed commented Aug 5, 2017

@sej7278 BOARD_SUB=16MHzatmega328 solved it, thank you. @jobegit

mrphysh commented Aug 30, 2018

I am having the same issue .. maybe exactly the same. i am using a Mega and a simple Makefile. My Linux Mint distro is new. The IDE has never worked, but I like the idea of using the cmd line anyway.
I see no path for diagnosing this. I tried to delete the Arduino altogether, but the system would not let me. I am committed to learning this system. Any guidance.?
make_error_compile_txt.txt

mrphysh commented Aug 30, 2018

I am having the same issues. I just tried [sudo apt autoremove] followed by [sudo apt-get install avrdude make gcc-avr arduino-mk] still same problem I see no way to diagnose this! (The IDE does not work)

sej7278 commented Aug 31, 2018

@mrphysh you’re using arduino 1.0.5 from the debian (mint) repo’s, so this should work with a mega2560 (its not the same issue at all):

i noticed you’re Arduino.mk is lowercase, have you broken your install? this should be all you need to fix it:

mrphysh commented Aug 31, 2018

thanks, that helped a lot.

sammilei commented Apr 24, 2020 •

I am using maga2560 in Mac
the way I fixed it is to use _SUB instead of _TAG:

Lazlolozla commented Jan 7, 2023 •

Yo tenía el mismo problema con mi clon chino de arduino mega2560. Yo había instalado Arduino.mk hace como 5 años en lubuntu 14.04 y funcionaba perfectamente. Despues cambié de equipo y ahora uso Kubuntu 22.04 pero no me funcionaba. Hasta que llegué aquí y pude solucionarlo con sus aportaciones. Gracias!

En lubuntu 14.04 lo tenía así: (Ya no recuerdo de donde lo copie el Makefile no es mio) usando el antiguo Arduino.mk

#make – Sólo compila
#make upload – Compila y sube
#make clean – Borra todas las dependencias creadas
#make depends – Actualiza las dependencias
#make reset – reset the Arduino by tickling DTR on the serial port
#make raw_upload – upload without first resetting
#make show_boards – list all the boards defined in boards.txt

ARDUINO_DIR = /usr/share/arduino
ARDUINO_PORT = /dev/ttyACM0

USER_LIB_PATH = /home/usuario1/sketchbook/arduinomega2560/libraries
BOARD_TAG = mega2560

Ahora en Kubuntu 22.04 con el mas reciente Arduino.mk quedo así: 55e003f

#make – Sólo compila
#make upload – Compila y sube
#make clean – Borra todas las dependencias creadas
#make depends – Actualiza las dependencias
#make reset – reset the Arduino by tickling DTR on the serial port
#make raw_upload – upload without first resetting
#make show_boards – list all the boards defined in boards.txt

ARDUINO_DIR = /usr/share/arduino
ARDUINO_PORT = /dev/ttyACM0

USER_LIB_PATH = /home/usuario1/sketchbook/arduinomega2560/libraries
BOARD_TAG = mega
BOARD_SUB = atmega2560

Источник

Error compiling for —fqbn arduino:avr:mega (missing cpu flags) #17

Comments

FernandoGarcia commented Aug 28, 2018 •

I have successfully installed Go compiler and Arduino CLI using this steps:

go get -u github.com/arduino/arduino-cli

arduino-cli sketch new MyFirstSketch

So I tried using sudo the result is:

sudo: arduino-cli: command not found

To try solved this issue I have created the folder manually using

sudo mkdir -p /home/pi/Arduino/MyFirstSketch

On next step I could not download package_index.json due permissions error again.

After I have successfully installed AVR core using:

arduino-cli core install arduino:avr

The result for arduino-cli core list is:

ID Installed Latest Name
arduino:avr 1.6.21 1.6.21 Arduino AVR Boards

Now using arduino-cli board list the result is always:

FQBN Port ID Board Name
/dev/ttyUSB0 0403:6001 unknown

In this point I don’t know what to do to go on since the CLI doesn’t find a FQBN to my Arduino mega connected to USB port.

Can someone help please?

The text was updated successfully, but these errors were encountered:

FernandoGarcia commented Aug 28, 2018

I don’t know if it helps but the output for lsusb is:

Bus 001 Device 004: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC

So I’m not using Arduino drivers.

mastrolinux commented Aug 28, 2018

From what I see the board is discovered and you can use it by passing the right core during compilation. /dev/ttyUSB0 0403:6001 you get unknown board because the board does not seem to be original so vid and pid are not matching the standard Arduino Mega values.

FernandoGarcia commented Aug 28, 2018

Thanks for your reply.

But what’s the right value for Arduino Mega 2560 in this line for the argument —fqbn:

arduino-cli compile —fqbn arduino:samd:mkr1000 Arduino/MyFirstSketch

arduino:avr:mega2560 by example?

FernandoGarcia commented Aug 28, 2018

Tried arduino-cli compile —fqbn arduino:avr:mega2560 Arduino/MyFirstSketch but the result is:

Error: Error resolving FQBN: board arduino:avr@1.6.21:mega2560 not found

It should be only arduino-cli compile —fqbn arduino:avr:mega Arduino/MyFirstSketch

FernandoGarcia commented Aug 28, 2018

For arduino-cli compile —fqbn arduino:avr:mega Arduino/MyFirstSketch

avr-g++: error: missing device or architecture after ‘-mmcu=’
Error: exit status 1
Compilation failed.

sandeepmistry commented Aug 28, 2018

Since the Mega has additional options (see Java IDE menu options for it), the FQBN needs the cpu type specified.

FernandoGarcia commented Aug 29, 2018

Thanks for your reply.

The settings are right now but I have permissions problem again.

arduino-cli compile —fqbn arduino:avr:mega:cpu=atmega2560 Arduino/MyFirstSketch

Build options changed, rebuilding all
Sketch uses 1462 bytes (0%) of program storage space. Maximum is 253952 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 8183 bytes for local variables. Maximum is 8192 bytes.
Error: open Arduino/MyFirstSketch/MyFirstSketch.arduino.avr.mega.cpu=atmega2560.hex: permission denied
Error copying output file.

sudo arduino-cli compile —fqbn arduino:avr:mega:cpu=atmega2560 Arduino/MyFirstSketch

sudo: arduino-cli: command not found

FernandoGarcia commented Aug 29, 2018 •

It worked now I had to make:

sudo chown -R pi:pi Arduino

I don’t know why I had this permissions problem since the first command in Arduino CLI.

arduino-cli sketch new MyFirstSketch

A problem I had was pointed in #6 also.

I’ll close this issue for now.
Thanks for all.

Источник

Понравилась статья? Поделить с друзьями:
  • Autolt error line 797
  • Autolt error line 25015
  • Autolt error line 20976
  • Autolt error line 20973
  • Autolt error line 20969