-
Notifications
You must be signed in to change notification settings - Fork 165
Description
Integration Guide
Background: Modkit is pushing Wiring as the preferred way for chip/board manufacturers to add hardware to Modkit Micro and other upcoming Modkit tools. This is pretty straightforward for AVR based boards but there is not a clear guide to adding new MCU's. Let's use this github issue thread to facilitate the creation of such a document. Let's keep this issue open until the documentation is complete and available in the source tree.
Files and directories
A given board entry in the Wiring drop-down-list is dependent on a number of files and directories. The following list attempts to explain how these different files and directories relate to the Wiring IDE and the microcontroller code build process.
Board Categories - Each folder in "wiring/framework/hardware" represents a different sub-menu in the Wiring IDE under tools->board. Logically, these folders are separated by manufacturer or other high level category.
Board Configurations - The actual boards in a given category are defined in a boards.txt file within that category's folder (eg: Wiring/framework/hardware/Wiring/boards.txt). Each board in the category has an entry in the boards.txt file of the follwing form:
WiringS.name=Wiring S @ 16 MHz
WiringS.upload.protocol=wiring
WiringS.build.mcu=atmega644p
WiringS.build.core=AVR8Bit
WiringS.build.hardware=WiringS
The name parameter determines the name that will show up in the drop down board list. The build.core parameter determines which core libraries will be used when compiling and corresponds to the name of a directory in the "wiring/framework/cores" folder. The build.hardware parameter determines which pin definitions (BoardDefs.h and BoardDefs.cpp) will be used and corresponds to the name of a directory within the "wiring/framework/hardware/CATEGORY" directory. The upload.protocol parameter determines which upload protocol will be used. It seems this is passed directly to avrdude.
Core Libraries This is the folder (eg wiring/framework/cores/AVR8Bit) referenced by the build.core parameter in the boards.txt file. This folder contains the core Wiring framework implementation for a given architecture as well as a "libraries" directory with any peripheral libraries (eg. Ethernet, Servo, etc).
Board/Hardware Definitions - This is the folder (eg wiring/framework/hardware/Wiring/WiringS) referenced by the build.hardware parameter in the boards.txt file. It contains the BoardDefs.h and BoardDefs.cpp files which are to be linked/compiled during compilation. Multiple products can share the same board definition (eg Arduino/Mega12802560).