From: AceVest Date: Thu, 14 Jun 2018 12:31:49 +0000 (+0800) Subject: add ace arduino hardware X-Git-Url: http://zhaoyanbai.com/repos/Bv9ARM.ch06.html?a=commitdiff_plain;h=9c69be2081db9578d5f20301193cfebd5dde52c0;p=acecode.git add ace arduino hardware --- diff --git a/arduino/hardware/ace/README.md b/arduino/hardware/ace/README.md new file mode 100644 index 0000000..8a7f25d --- /dev/null +++ b/arduino/hardware/ace/README.md @@ -0,0 +1 @@ +https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification diff --git a/arduino/hardware/ace/avr/boards.txt b/arduino/hardware/ace/avr/boards.txt new file mode 100644 index 0000000..e3fde0f --- /dev/null +++ b/arduino/hardware/ace/avr/boards.txt @@ -0,0 +1,36 @@ +# See: http://code.google.com/p/arduino/wiki/Platforms + +menu.cpu=Processor + +############################################################## + +uno.name=Ace Arduino Uno + +uno.vid.0=0x2341 +uno.pid.0=0x0043 +uno.vid.1=0x2341 +uno.pid.1=0x0001 +uno.vid.2=0x2A03 +uno.pid.2=0x0043 +uno.vid.3=0x2341 +uno.pid.3=0x0243 + +uno.upload.tool=avrdude +uno.upload.protocol=arduino +uno.upload.maximum_size=32256 +uno.upload.maximum_data_size=2048 +uno.upload.speed=115200 + +uno.bootloader.tool=avrdude +uno.bootloader.low_fuses=0xFF +uno.bootloader.high_fuses=0xDE +uno.bootloader.extended_fuses=0xFD +uno.bootloader.unlock_bits=0x3F +uno.bootloader.lock_bits=0x0F +uno.bootloader.file=optiboot/optiboot_atmega328.hex + +uno.build.mcu=atmega328p +uno.build.f_cpu=16000000L +uno.build.board=AVR_UNO +uno.build.core=avr +uno.build.variant=avr diff --git a/arduino/hardware/ace/avr/cores/avr/AceAvr.h b/arduino/hardware/ace/avr/cores/avr/AceAvr.h new file mode 100644 index 0000000..8569407 --- /dev/null +++ b/arduino/hardware/ace/avr/cores/avr/AceAvr.h @@ -0,0 +1,13 @@ +/* + * ------------------------------------------------------------------------ + * File Name: AceAvr.h + * Author: Zhao Yanbai + * 2018-06-14 20:28:08 Thursday CST + * Description: none + * ------------------------------------------------------------------------ + */ + +#pragma once + + +void acevest(); diff --git a/arduino/hardware/ace/avr/cores/avr/Arduino.h b/arduino/hardware/ace/avr/cores/avr/Arduino.h new file mode 100644 index 0000000..52848bc --- /dev/null +++ b/arduino/hardware/ace/avr/cores/avr/Arduino.h @@ -0,0 +1,16 @@ +/* + * ------------------------------------------------------------------------ + * File Name: Arduino.h + * Author: Zhao Yanbai + * 2018-06-14 20:01:07 Thursday CST + * Description: none + * ------------------------------------------------------------------------ + */ + +#pragma once + +void setup(void); +void loop(void); + + +#include diff --git a/arduino/hardware/ace/avr/cores/avr/acevest.cpp b/arduino/hardware/ace/avr/cores/avr/acevest.cpp new file mode 100644 index 0000000..c94bc1a --- /dev/null +++ b/arduino/hardware/ace/avr/cores/avr/acevest.cpp @@ -0,0 +1,12 @@ +/* + * ------------------------------------------------------------------------ + * File Name: acevest.cpp + * Author: Zhao Yanbai + * 2018-06-14 20:27:23 Thursday CST + * Description: none + * ------------------------------------------------------------------------ + */ +void acevest() { + + +} diff --git a/arduino/hardware/ace/avr/cores/avr/main.cpp b/arduino/hardware/ace/avr/cores/avr/main.cpp new file mode 100644 index 0000000..9bb79f0 --- /dev/null +++ b/arduino/hardware/ace/avr/cores/avr/main.cpp @@ -0,0 +1,17 @@ +/* + * ------------------------------------------------------------------------ + * File Name: main.cpp + * Author: Zhao Yanbai + * 2018-06-14 20:21:33 Thursday CST + * Description: none + * ------------------------------------------------------------------------ + */ +#include +int main() +{ + setup(); + for(;;) { + loop(); + } + return 0; +} diff --git a/arduino/hardware/ace/avr/platform.txt b/arduino/hardware/ace/avr/platform.txt new file mode 100644 index 0000000..db10579 --- /dev/null +++ b/arduino/hardware/ace/avr/platform.txt @@ -0,0 +1,130 @@ + +# Arduino AVR Core and platform. +# ------------------------------ +# +# For more info: +# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification + +name=Ace Arduino AVR Boards +version=1.6.21 + +# AVR compile variables +# --------------------- + +compiler.warning_flags=-w +compiler.warning_flags.none=-w +compiler.warning_flags.default= +compiler.warning_flags.more=-Wall +compiler.warning_flags.all=-Wall -Wextra + +# Default "compiler.path" is correct, change only if you want to override the initial value +compiler.path={runtime.tools.avr-gcc.path}/bin/ +compiler.c.cmd=avr-gcc +compiler.c.flags=-c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects +compiler.c.elf.flags={compiler.warning_flags} -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections +compiler.c.elf.cmd=avr-gcc +compiler.S.flags=-c -g -x assembler-with-cpp -flto -MMD +compiler.cpp.cmd=avr-g++ +compiler.cpp.flags=-c -g -Os {compiler.warning_flags} -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto +compiler.ar.cmd=avr-gcc-ar +compiler.ar.flags=rcs +compiler.objcopy.cmd=avr-objcopy +compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 +compiler.elf2hex.flags=-O ihex -R .eeprom +compiler.elf2hex.cmd=avr-objcopy +compiler.ldflags= +compiler.size.cmd=avr-size + +# This can be overridden in boards.txt +build.extra_flags= + +# These can be overridden in platform.local.txt +compiler.c.extra_flags= +compiler.c.elf.extra_flags= +compiler.S.extra_flags= +compiler.cpp.extra_flags= +compiler.ar.extra_flags= +compiler.objcopy.eep.extra_flags= +compiler.elf2hex.extra_flags= + +# AVR compile patterns +# -------------------- + +## Compile c files +recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" + +## Compile c++ files +recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" + +## Compile S files +recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.S.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" + +## Create archives +# archive_file_path is needed for backwards compatibility with IDE 1.6.5 or older, IDE 1.6.6 or newer overrides this value +archive_file_path={build.path}/{archive_file} +recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}" + +## Combine gc-sections, archives, and objects +recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" -lm + +## Create output files (.eep and .hex) +recipe.objcopy.eep.pattern="{compiler.path}{compiler.objcopy.cmd}" {compiler.objcopy.eep.flags} {compiler.objcopy.eep.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.eep" +recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex" + +## Save hex +recipe.output.tmp_file={build.project_name}.hex +recipe.output.save_file={build.project_name}.{build.variant}.hex + +## Compute size +recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf" +recipe.size.regex=^(?:\.text|\.data|\.bootloader)\s+([0-9]+).* +recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).* +recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).* + +## Preprocessor +preproc.includes.flags=-w -x c++ -M -MG -MP +recipe.preproc.includes="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.includes.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" + +preproc.macros.flags=-w -x c++ -E -CC +recipe.preproc.macros="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.macros.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{preprocessed_file_path}" + +# AVR Uploader/Programmers tools +# ------------------------------ + +tools.avrdude.path={runtime.tools.avrdude.path} +tools.avrdude.cmd.path={path}/bin/avrdude +tools.avrdude.config.path={path}/etc/avrdude.conf + +tools.avrdude.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA + +tools.avrdude.upload.params.verbose=-v +tools.avrdude.upload.params.quiet=-q -q +# tools.avrdude.upload.verify is needed for backwards compatibility with IDE 1.6.8 or older, IDE 1.6.9 or newer overrides this value +tools.avrdude.upload.verify= +tools.avrdude.upload.params.noverify=-V +tools.avrdude.upload.pattern="{cmd.path}" "-C{config.path}" {upload.verbose} {upload.verify} -p{build.mcu} -c{upload.protocol} "-P{serial.port}" -b{upload.speed} -D "-Uflash:w:{build.path}/{build.project_name}.hex:i" + +tools.avrdude.program.params.verbose=-v +tools.avrdude.program.params.quiet=-q -q +# tools.avrdude.program.verify is needed for backwards compatibility with IDE 1.6.8 or older, IDE 1.6.9 or newer overrides this value +tools.avrdude.program.verify= +tools.avrdude.program.params.noverify=-V +tools.avrdude.program.pattern="{cmd.path}" "-C{config.path}" {program.verbose} {program.verify} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{build.path}/{build.project_name}.hex:i" + +tools.avrdude.erase.params.verbose=-v +tools.avrdude.erase.params.quiet=-q -q +tools.avrdude.erase.pattern="{cmd.path}" "-C{config.path}" {erase.verbose} -p{build.mcu} -c{protocol} {program.extra_params} -e -Ulock:w:{bootloader.unlock_bits}:m -Uefuse:w:{bootloader.extended_fuses}:m -Uhfuse:w:{bootloader.high_fuses}:m -Ulfuse:w:{bootloader.low_fuses}:m + +tools.avrdude.bootloader.params.verbose=-v +tools.avrdude.bootloader.params.quiet=-q -q +tools.avrdude.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{runtime.platform.path}/bootloaders/{bootloader.file}:i" -Ulock:w:{bootloader.lock_bits}:m + +tools.avrdude_remote.upload.pattern=/usr/bin/run-avrdude /tmp/sketch.hex {upload.verbose} -p{build.mcu} + +tools.avrdude.upload.network_pattern="{network_cmd}" -address {serial.port} -port {upload.network.port} -sketch "{build.path}/{build.project_name}.hex" -upload {upload.network.endpoint_upload} -sync {upload.network.endpoint_sync} -reset {upload.network.endpoint_reset} -sync_exp {upload.network.sync_return} + +# USB Default Flags +# Default blank usb manufacturer will be filled in at compile time +# - from numeric vendor ID, set to Unknown otherwise +build.usb_manufacturer="Unknown" +build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}' diff --git a/arduino/hardware/ace/avr/programmers.txt b/arduino/hardware/ace/avr/programmers.txt new file mode 100644 index 0000000..c100e84 --- /dev/null +++ b/arduino/hardware/ace/avr/programmers.txt @@ -0,0 +1,106 @@ +avrisp.name=AVR ISP +avrisp.communication=serial +avrisp.protocol=stk500v1 +avrisp.program.protocol=stk500v1 +avrisp.program.tool=avrdude +avrisp.program.extra_params=-P{serial.port} + +avrispmkii.name=AVRISP mkII +avrispmkii.communication=usb +avrispmkii.protocol=stk500v2 +avrispmkii.program.protocol=stk500v2 +avrispmkii.program.tool=avrdude +avrispmkii.program.extra_params=-Pusb + +usbtinyisp.name=USBtinyISP +usbtinyisp.protocol=usbtiny +usbtinyisp.program.tool=avrdude +usbtinyisp.program.extra_params= + +arduinoisp.name=ArduinoISP +arduinoisp.protocol=arduinoisp +arduinoisp.program.tool=avrdude +arduinoisp.program.extra_params= + +arduinoisporg.name=ArduinoISP.org +arduinoisporg.protocol=arduinoisporg +arduinoisporg.program.tool=avrdude +arduinoisporg.program.extra_params= + +usbasp.name=USBasp +usbasp.communication=usb +usbasp.protocol=usbasp +usbasp.program.protocol=usbasp +usbasp.program.tool=avrdude +usbasp.program.extra_params=-Pusb + +parallel.name=Parallel Programmer +parallel.protocol=dapa +parallel.force=true +# parallel.delay=200 +parallel.program.tool=avrdude +parallel.program.extra_params=-F + +arduinoasisp.name=Arduino as ISP +arduinoasisp.communication=serial +arduinoasisp.protocol=stk500v1 +arduinoasisp.speed=19200 +arduinoasisp.program.protocol=stk500v1 +arduinoasisp.program.speed=19200 +arduinoasisp.program.tool=avrdude +arduinoasisp.program.extra_params=-P{serial.port} -b{program.speed} + +usbGemma.name=Arduino Gemma +usbGemma.protocol=arduinogemma +usbGemma.program.tool=avrdude +usbGemma.program.extra_params= +usbGemma.config.path={runtime.platform.path}/bootloaders/gemma/avrdude.conf + +## Notes about Dangerous Prototypes Bus Pirate as ISP +## Bus Pirate V3 need Firmware v5.10 or later +## Bus Pirate V4 need Firmware v6.3-r2151 or later +## Could happen that BP does not have enough current to power an Arduino board +## through the ICSP connector. In this case disconnect the +Vcc from ICSP connector +## and power Arduino board in the normal way. +buspirate.name=BusPirate as ISP +buspirate.communication=serial +buspirate.protocol=buspirate +buspirate.program.protocol=buspirate +buspirate.program.tool=avrdude +buspirate.program.extra_params=-P{serial.port} + +# STK500 firmware version v1 and v2 use different serial protocols. +# Using the 'stk500' protocol tells avrdude to try and autodetect the +# firmware version. If this leads to problems, we might need to add +# stk500v1 and stk500v2 entries to allow explicitely selecting the +# firmware version. +stk500.name=Atmel STK500 development board +stk500.communication=serial +stk500.protocol=stk500 +stk500.program.protocol=stk500 +stk500.program.tool=avrdude +stk500.program.extra_params=-P{serial.port} + +jtag3isp.name=Atmel JTAGICE3 (ISP mode) +jtag3isp.communication=usb +jtag3isp.protocol=jtag3isp +jtag3isp.program.protocol=jtag3isp +jtag3isp.program.tool=avrdude +jtag3isp.program.extra_params= + +jtag3.name=Atmel JTAGICE3 (JTAG mode) +jtag3.communication=usb +jtag3.protocol=jtag3 +jtag3.program.protocol=jtag3 +jtag3.program.tool=avrdude +# Set a bitclock of 0.1us (the fastest supported value). This should +# work regardless of the crystal used, since JTAG doesn't use the MCU +# clock but dictates its own clock. +jtag3.program.extra_params=-B0.1 + +atmel_ice.name=Atmel-ICE (AVR) +atmel_ice.communication=usb +atmel_ice.protocol=atmelice_isp +atmel_ice.program.protocol=atmelice_isp +atmel_ice.program.tool=avrdude +atmel_ice.program.extra_params=-Pusb