Closed rzajac closed 5 years ago
I think It was something wrong with my system or packages. I have solved it by removing all system packaged dealing with AVR then removed Arduino SDK and installed it again.
Changed the CMakeLists.txt
file to:
cmake_minimum_required(VERSION 3.8)
project(my_blinky LANGUAGES C CXX ASM)
get_board_id(board_id nano atmega328old)
add_arduino_executable(${PROJECT_NAME} ${board_id} main.cpp)
upload_arduino_target(${PROJECT_NAME} "${board_id}" /dev/ttyUSB0)
Created minimum main.cpp
file:
#include <Arduino.h>
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
}
Put toolchain files in toolchain
directory so my project directory structure looks like this:
$ tree -d -L 1
.
├── build
├── CMakeLists.txt
├── main.cpp
└── toolchain
├── Arduino-Toolchain.cmake
└── Platform
and did:
$ cd build
$ rm -rf ./* && ARDUINO_SDK_PATH=/usr/share/arduino cmake -DCMAKE_TOOLCHAIN_FILE=toolchain/Arduino-Toolchain.cmake ..
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- The ASM compiler identification is GNU
-- Found assembler: /usr/share/arduino/hardware/tools/avr/bin/avr-gcc
-- Arduino SDK version 1.8.8: /usr/share/arduino
-- Determined Platform Header: /usr/share/arduino/hardware/arduino/avr/cores/arduino/Arduino.h
-- Arduino SDK version 1.8.8: /usr/share/arduino
-- Determined Platform Header: /usr/share/arduino/hardware/arduino/avr/cores/arduino/Arduino.h
-- Check for working C compiler: /usr/share/arduino/hardware/tools/avr/bin/avr-gcc
-- Check for working C compiler: /usr/share/arduino/hardware/tools/avr/bin/avr-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Arduino SDK version 1.8.8: /usr/share/arduino
-- Determined Platform Header: /usr/share/arduino/hardware/arduino/avr/cores/arduino/Arduino.h
-- Check for working CXX compiler: /usr/share/arduino/hardware/tools/avr/bin/avr-g++
-- Check for working CXX compiler: /usr/share/arduino/hardware/tools/avr/bin/avr-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/thor/Documents/from-scratch/software/webcam/arduino/encoder/build
This time cmake
did not report any errors but when I tried to make
the project I got an error about missing reference to main. I will create separate ticket for it.
@rzajac Hi, sorry for the delay, been pretty busy lately. Well, first of all I'm glad to hear that the initial problem was related to your system setup. Now about that 2nd error, before you open a separate issue for it, you should know that Arduino generates its' own main.cpp file, which is why you can't create one of your own. Try to name it differently and see if the problem solves 😃
@MrPointer Thanks for helping. Your tip worked! You may close the issue.
OS: Linux Distribution: Ubuntu OS Version: 18.04.1 Platform: Arduino Platform SDK Version: [Arduino SDK version 1.8.8]
I get this error when trying to generate Makefile. Not sure how to debug it.
My
CMakeLists.txt
file: