Giter VIP home page Giter VIP logo

Comments (3)

rzajac avatar rzajac commented on May 25, 2024

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.

from arduino-cmake-ng.

MrPointer avatar MrPointer commented on May 25, 2024

@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 😃

from arduino-cmake-ng.

rzajac avatar rzajac commented on May 25, 2024

@MrPointer Thanks for helping. Your tip worked! You may close the issue.

from arduino-cmake-ng.

Related Issues (20)

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.

  • 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.

  • 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.

  • D3 photo D3

    Data-Driven Documents codes.