Git Product home page Git Product logo

Comments (7)

a9183756-gh avatar a9183756-gh commented on June 14, 2024

I tried compiling for the Optiboot on Mega2560 here, and it seems to be working well.

From the above error message, it looks like the toolchain expects the compiler inside /usr/share/arduino/hardware/tools/avr (Location of Arduino installation), but could not find. So it tries to find alternative package manager path in /home/hacki/git/homeduino/_pkg_mgr/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7 and could not find there as well (Since package manager is not enabled). Toolchain never looks for the compiler from PATH (It is not as per the specification). Where is it located in your installation, that may provide a clue?

You may try providing the CMAKE_C_COMPILER and CMAKE_CXX_COMPILER paths in the the generated ArduinoSystem.cmake in the build directory. However this file can get overwritten whenever BoardOptions.cmake is changed and is not a reliable solution.

Alternatively, you may try using package manager, as given below, which downloads the compiler and uses, if not found in the expected locations.

cmake -D CMAKE_TOOLCHAIN_FILE=/path/to/Arduino-toolchain.cmake -D ARDUINO_BOARD_MANAGER_URL=https://github.com/Optiboot/optiboot/releases/download/v8.0/package_optiboot_optiboot-additional_index.json /path/to/Examples/01_hello_world

from arduino-cmake-toolchain.

hacki11 avatar hacki11 commented on June 14, 2024
hacki@lx-hacki:~/git/homeduino$ locate avr-g++
/usr/bin/avr-g++
/usr/share/arduino/hardware/tools/avr/bin/avr-g++

acki@lx-hacki:~/git/homeduino$ locate avr-gcc
/usr/bin/avr-gcc
/usr/share/arduino/hardware/tools/avr/bin/avr-gcc

If i change avr-gcc and avr-g++ executables in ArduinoSystem.cmake and add the path /usr/share/arduino/hardware/tools/avr/bin to ARDUINO_FIND_ROOT_PATH it will work.

Using the BOARD_MANAGER_URL leads to the same issue. Seems there is a dependency to exactly this compiler:

acki@lx-hacki:~/git/homeduino$ cmake -DCMAKE_TOOLCHAIN_FILE=~/git/Arduino-CMake-Toolchain/Arduino-toolchain.cmake  -D ARDUINO_BOARD_MANAGER_URL=https://github.com/Optiboot/optiboot/releases/download/v8.0/package_optiboot_optiboot-additional_index.json --debug -D CMAKE_VERBOSE_MAKEFILE=VERBOSE .
ARDUINO_INSTALL_PATH:/usr/share/arduino
ARDUINO_PACKAGE_PATH:/home/hacki/.arduino15
ARDUINO_PREFERENCE_FILE:/home/hacki/.arduino15/preferences.txt
ARDUINO_SKETCHBOOK_PATH:/home/hacki/Arduino
-- Found Arduino package /home/hacki/git/homeduino/_pkg_mgr/package_optiboot_optiboot-additional_index.json
-- Found Arduino package /home/hacki/.arduino15/package_index.json
-- Found Arduino package /usr/share/arduino/hardware/package_index_bundled.json
-- Found Arduino Platform: /home/hacki/git/homeduino/_pkg_mgr/packages/Optiboot/hardware/avr/0.8.0
-- Selected Arduino Board: Optiboot on Mega2560 [avr.optiboot2560]
-- Platform dependency Optiboot 8.0 => 'Arduino AVR Boards' from 'Arduino'
-- Platform dependency Optiboot 8.0 => 'Arduino AVR Boards' from 'Arduino'
-- Tool dependency Optiboot 8.0 => 'avr-gcc (7.3.0-atmel3.6.1-arduino7)' from 'Arduino'
-- Tool dependency Optiboot 8.0 => 'avrdude (6.3.0-arduino17)' from 'Arduino'
-- Tool dependency Optiboot 8.0 => 'arduinoOTA (1.3.0)' from 'Arduino'
-- Tool dependency Optiboot 8.0 => 'avrdude (6.0.1-arduino5)' from 'Arduino'
-- Tool dependency Optiboot 8.0 => 'avr-gcc (7.3.0-atmel3.6.1-arduino7)' from 'Arduino'
-- Tool dependency Optiboot 8.0 => 'avrdude (6.3.0-arduino17)' from 'Arduino'
-- Tool dependency Optiboot 8.0 => 'arduinoOTA (1.3.0)' from 'Arduino'
_rule_cmd:/home/hacki/git/homeduino/_pkg_mgr/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-gcc

from arduino-cmake-toolchain.

hacki11 avatar hacki11 commented on June 14, 2024
  • removed anything of optiboot from ~/.arduino15/
  • updated "Arduino AVR Boards" in Boardmanager in Arduino IDE
  • added optiboot package json Arduino additional board manager urls
  • installed Optiboot 8.0 in Boardmanager in Arduino IDE

now it will find the right compiler!

Edit: Wow, there is even an upload network task in my jetbrains clion ide. thanks for the effort you put in this project, it's awesome!

from arduino-cmake-toolchain.

hacki11 avatar hacki11 commented on June 14, 2024

if i understood upload-network cmake target correctly, if have to create an additional make call with the required environment variables to the upload-network target, right?

like:
grafik

from arduino-cmake-toolchain.

a9183756-gh avatar a9183756-gh commented on June 14, 2024

Good to know that it worked after you refreshed your Arduino Installation. I still wonder why the alternative package manager did not work for you. In case you need this, you may try with a new build directory, and post the full error logs for analysis.

Network upload depends on the way you achieved network connectivity to the board. Some possible options that may work are

  1. esp-link in which case you may want to look at the Arduino specific comments there. upload-network arguments take these parameters. Be aware of the need of 5V/3.3V voltage conversion between Mega and ESP.
  2. ArduinoOTA if you are using some Ethernet/WiFi shield. If you copy the platform.local.txt as instructed, and then invoke the clean CMake build. upload-network parameters should change appropriately (taking only IP address, port and password).

from arduino-cmake-toolchain.

hacki11 avatar hacki11 commented on June 14, 2024

I took option 2.
Had to copy my platform.local.txt to /home/hacki/.arduino15/packages/Optiboot/hardware/avr/0.8.0.
Then i can use the following make file run configuration with just NETWORK_IP, NETWORK_PASSWORD and TARGET like you said:
grafik

Works:

Connecting to board ...  done
Uploading sketch ...  done
Flashing sketch ...  done

Sketch uploaded successfully
Built target upload-network

Thanks again, great work!

from arduino-cmake-toolchain.

a9183756-gh avatar a9183756-gh commented on June 14, 2024

Will close this issue and label this as question as there are no changes made.

from arduino-cmake-toolchain.

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.