Компиляция скетча / прошивка платы из .bat-файла

Тема в разделе "Arduino & Shields", создана пользователем Vovka, 2 фев 2019.

  1. @Vovka Вы, по непонятным пока причинам, не читаете описание как использовать ардуино из командной строки. Прочту сам.
    Note that on Windows, due to the diffence between GUI and console apps, that the arduino_debug.exe is the appropriate executable to use if you want to use the majority of these command line options.
    Используйте arduino_debug.exe, строка для "Проверки" получится
    Код (Text):

    arduino_debug.exe --verify --verbose-build --pref build.path=C:\tmp\my_sketch_build --board arduino:avr:pro:cpu=8MHzatmega328 C:\Arduino\sketch_feb03a\sketch_feb03a.ino
     
    Код (Text):

    C:\Arduino\sketch_feb03a>C:\arduino-1.8.7\arduino_debug.exe --verify --verbose-build --pref build.path=C:\tmp\my_sketch_build --board arduino:avr:pro:cpu=8MHzatmega328 C:\Arduino\sketch_feb03a\sketch_feb03a.ino
    Загрузка конфигурации...
    Инициализация пакетов...
    Подготовка плат...
    Проверка...
    C:\arduino-1.8.7\arduino-builder -dump-prefs -logger=machine -hardware C:\arduino-1.8.7\hardware -tools C:\arduino-1.8.7\tools-builder -tools C:\arduino-1.8.7\hardware\tools\avr -built-in-libraries C:\arduino-1.8.7\libraries -libraries C:\Arduino\libraries -fqbn=arduino:avr:pro:cpu=8MHzatmega328 -ide-version=10807 -build-path C:\tmp\my_sketch_build -warnings=none -build-cache C:\Users\a4u\AppData\Local\Temp\arduino_cache_931631 -prefs=build.path=C:\tmp\my_sketch_build -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\arduino-1.8.7\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\arduino-1.8.7\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\arduino-1.8.7\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\arduino-1.8.7\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\arduino-1.8.7\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\arduino-1.8.7\hardware\tools\avr -verbose C:\Arduino\sketch_feb03a\sketch_feb03a.ino
    C:\arduino-1.8.7\arduino-builder -compile -logger=machine -hardware C:\arduino-1.8.7\hardware -tools C:\arduino-1.8.7\tools-builder -tools C:\arduino-1.8.7\hardware\tools\avr -built-in-libraries C:\arduino-1.8.7\libraries -libraries C:\Arduino\libraries -fqbn=arduino:avr:pro:cpu=8MHzatmega328 -ide-version=10807 -build-path C:\tmp\my_sketch_build -warnings=none -build-cache C:\Users\a4u\AppData\Local\Temp\arduino_cache_931631 -prefs=build.path=C:\tmp\my_sketch_build -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\arduino-1.8.7\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\arduino-1.8.7\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\arduino-1.8.7\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\arduino-1.8.7\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\arduino-1.8.7\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\arduino-1.8.7\hardware\tools\avr -verbose C:\Arduino\sketch_feb03a\sketch_feb03a.ino
    Using board 'pro' from platform in folder: C:\arduino-1.8.7\hardware\arduino\avr
    Using core 'arduino' from platform in folder: C:\arduino-1.8.7\hardware\arduino\avr
    Detecting libraries used...
    "C:\\arduino-1.8.7\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=8000000L -DARDUINO=10807 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\\arduino-1.8.7\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\arduino-1.8.7\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "C:\\tmp\\my_sketch_build\\sketch\\sketch_feb03a.ino.cpp" -o nul
    Generating function prototypes...
    "C:\\arduino-1.8.7\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=8000000L -DARDUINO=10807 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\\arduino-1.8.7\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\arduino-1.8.7\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "C:\\tmp\\my_sketch_build\\sketch\\sketch_feb03a.ino.cpp" -o "C:\\tmp\\my_sketch_build\\preproc\\ctags_target_for_gcc_minus_e.cpp"
    "C:\\arduino-1.8.7\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\tmp\\my_sketch_build\\preproc\\ctags_target_for_gcc_minus_e.cpp"
    Компиляция скетча...
    "C:\\arduino-1.8.7\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=8000000L -DARDUINO=10807 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\\arduino-1.8.7\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\arduino-1.8.7\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "C:\\tmp\\my_sketch_build\\sketch\\sketch_feb03a.ino.cpp" -o "C:\\tmp\\my_sketch_build\\sketch\\sketch_feb03a.ino.cpp.o"
    Compiling libraries...
    Compiling core...
    Используем предварительно скомпилированный файл: C:\tmp\my_sketch_build\core\wiring_pulse.S.o
    ....
    Архивирование откомпилированного ядра (кэширование) в: C:\Users\a4u\AppData\Local\Temp\arduino_cache_931631\core\core_arduino_avr_pro_cpu_8MHzatmega328_68495cf6d2e97e9a7605a52e6c66f9d4.a
    Linking everything together...
    "C:\\arduino-1.8.7\\hardware\\tools\\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\\tmp\\my_sketch_build/sketch_feb03a.ino.elf" "C:\\tmp\\my_sketch_build\\sketch\\sketch_feb03a.ino.cpp.o" "C:\\tmp\\my_sketch_build/core\\core.a" "-LC:\\tmp\\my_sketch_build" -lm
    "C:\\arduino-1.8.7\\hardware\\tools\\avr/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\\tmp\\my_sketch_build/sketch_feb03a.ino.elf" "C:\\tmp\\my_sketch_build/sketch_feb03a.ino.eep"
    "C:\\arduino-1.8.7\\hardware\\tools\\avr/bin/avr-objcopy" -O ihex -R .eeprom "C:\\tmp\\my_sketch_build/sketch_feb03a.ino.elf" "C:\\tmp\\my_sketch_build/sketch_feb03a.ino.hex"
    "C:\\arduino-1.8.7\\hardware\\tools\\avr/bin/avr-size" -A "C:\\tmp\\my_sketch_build/sketch_feb03a.ino.elf"
    Скетч использует 444 байт (1%) памяти устройства. Всего доступно 30720 байт.
    Глобальные переменные используют 9 байт (0%) динамической памяти, оставляя 2039 байт для локальных переменных. Максимум: 2048 байт.
     
     
    Vovka нравится это.
  2. Vovka

    Vovka Гик

    Спасибо, заработало!