Skip to content
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

Unable to Run on Arduino Mega 2560 #24

Open
simonnarang opened this issue Nov 12, 2016 · 1 comment
Open

Unable to Run on Arduino Mega 2560 #24

simonnarang opened this issue Nov 12, 2016 · 1 comment

Comments

@simonnarang
Copy link

Great Library...

Having some trouble getting it to work though.

Here is my CMakeLists.txt:

cmake_minimum_required(VERSION 2.8.4)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/ArduinoToolchain.cmake)
set(PROJECT_NAME Robotic_Arm)
project(${PROJECT_NAME})

set(${CMAKE_PROJECT_NAME}_BOARD mega)
set(${CMAKE_PROJECT_NAME}_PORT /dev/ttys0)

set(${CMAKE_PROJECT_NAME}_SKETCH Robotic_Arm.ino)
generate_arduino_firmware(${CMAKE_PROJECT_NAME})

I have a mega 2560 board, I am getting these errors when I have it plugged in and am running through CLion:

/Applications/CLion.app/Contents/bin/cmake/bin/cmake --build /Users/Si/Library/Caches/CLion2016.2/cmake/generated/Robotic-Arm-7c975170/7c975170/Debug --target Robotic_Arm -- -j 4
-- Generating Robotic_Arm
-- Using /Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-objcopy for converting firmware image to hex
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/Si/Library/Caches/CLion2016.2/cmake/generated/Robotic-Arm-7c975170/7c975170/Debug
[  7%] Building CXX object CMakeFiles/mega_CORE.dir/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/HardwareSerial.cpp.obj
[  3%] Building CXX object CMakeFiles/mega_CORE.dir/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/CDC.cpp.obj
[ 10%] Building CXX object CMakeFiles/mega_CORE.dir/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/HardwareSerial0.cpp.obj
[ 14%] Building CXX object CMakeFiles/mega_CORE.dir/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/HardwareSerial1.cpp.obj
avr-g++: error: missing device or architecture after '-mmcu='
avr-g++: error: missing device or architecture after '-mmcu='
avr-g++: error: missing device or architecture after '-mmcu='
make[3]: *** [CMakeFiles/mega_CORE.dir/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/CDC.cpp.obj] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [CMakeFiles/mega_CORE.dir/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/HardwareSerial1.cpp.obj] Error 1
make[3]: *** [CMakeFiles/mega_CORE.dir/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/HardwareSerial0.cpp.obj] Error 1
avr-g++: error: missing device or architecture after '-mmcu='
make[3]: *** [CMakeFiles/mega_CORE.dir/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/HardwareSerial.cpp.obj] Error 1
make[2]: *** [CMakeFiles/mega_CORE.dir/all] Error 2
make[1]: *** [CMakeFiles/Robotic_Arm.dir/rule] Error 2
make: *** [Robotic_Arm] Error 2
@simonnarang simonnarang changed the title Unable to Run on Arduino Unable to Run on Arduino Mega 2560 Nov 12, 2016
@AndrzejSc
Copy link

AndrzejSc commented Dec 8, 2016

I had te same problem. You have to modify board.txt file in your arduino-1.X.X.X/hardware/arduino/avr/ folder.

Just add following (make backup of board.txt):

##############################################################
#   		MEGA 2560 EDIT BE ME

mega2560.name= Arduino MEGA 2560
mega2560.vid.0=0x2341
mega2560.pid.0=0x0010
mega2560.vid.1=0x2341
mega2560.pid.1=0x0042
mega2560.vid.2=0x2A03
mega2560.pid.2=0x0010
mega2560.vid.3=0x2A03
mega2560.pid.3=0x0042
mega2560.vid.4=0x2341
mega2560.pid.4=0x0210
mega2560.vid.5=0x2341
mega2560.pid.5=0x0242

mega2560.upload.tool=avrdude
mega2560.upload.maximum_data_size=8192
mega2560.upload.protocol=wiring
mega2560.upload.maximum_size=253952
mega2560.upload.speed=115200

mega2560.bootloader.tool=avrdude
mega2560.bootloader.low_fuses=0xFF
mega2560.bootloader.unlock_bits=0x3F
mega2560.bootloader.lock_bits=0x0F
mega2560.bootloader.high_fuses=0xD8
mega2560.bootloader.extended_fuses=0xFD
mega2560.bootloader.file=stk500v2/stk500boot_v2_mega2560.hex

mega2560.build.f_cpu=16000000L
mega2560.build.core=arduino
mega2560.build.variant=mega
# default board may be overridden by the cpu menu
mega2560.build.board=AVR_MEGA2560
mega2560.build.mcu=atmega2560
mega2560.build.board=AVR_MEGA2560
########### END EDIT BE ME

add to CMakeList.txt
set(${CMAKE_PROJECT_NAME}_BOARD mega2560)

and reload project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants