Oak

🌳 An outdoor LoRa-GPS tracker with an E-Ink display πŸ”‘

power 18650
wireless LoRa,
sensor GPS, E-Ink
mcu SAMD21G18
bom items 82
bom cost USD $78.93
vendors 6
completed July 2022

Create a custom Arduino Board

custom arduino difficult

Create a local and downloadable custom Arduino board


Before starting

Details

There are 2 ways of creating a custom Arduino Board. Create a local custom board for testing or create a downloadable custom board

Refer to the 2 repositories created:

  1. hutscape-arduino-boards
  2. arduino-board-index

Create local custom board

  1. Identify the architecture that is closest to the microcontroller you are using E.g. SAMD21G
  2. Identify the corresponding similar repository of the custom board E.g. Arduino Zero
  3. Find the closest board variant location on your computer based on the operating system

     ~/Library/Arduino15/packages/arduino/hardware/samd/1.8.11/variants/arduino_zero
    
  4. If required, change variants.h and variant.cpp
  5. Copy the most similar board and amend the namespace in boards.txt in locally in the path ~/Library/Arduino15/packages/arduino/hardware/samd/1.8.11/

     # Oak (Native USB Port)
     # --------------------------------------
     oak.name=Oak
     ...
    
  6. Amend other properties accordingly E.g. add the -DCRYSTALLESS

     oak.build.extra_flags=-DCRYSTALLESS -D__SAMD21G18A__ {build.usb_flags}
    
  7. Change platform.txt version

     name=Arduino SAMD (32-bits ARM Cortex-M0+) Boards
     version=1.8.11
    
  8. View the newely added board locally in Arduino IDE

Custom Arduino board locally

Create downloadable custom board

  1. Identify the architecture that is closest to the microcontroller you are using E.g. SAMD21G
  2. Identify the corresponding similar repository of the custom board E.g. Arduino Zero in ArduinoCore-samd
  3. Remove all other bootloaders in the bootloaders folder and keep only the ones required E.g. zero

     β”œβ”€β”€ bootloaders
     β”‚Β Β  └── zero
    
  4. Remove all other variants in the variants folder and keep only the ones required E.g. folder arduino_zero renamed to oak

     └── variants
       └── oak
    
  5. Copy api folder into cores/arduino folder
  6. Simplify the file boards.txt and keep only the board required
    • change the namespace E.g. arduino_zero_native to oak
    • change *.name, *.build.usb_product, *.build.usb_manufacturer accordingly
    • change *.build.variant accordingly
     # Oak (Native USB Port)
     # --------------------------------------
     oak.name=Oak (Native USB Port)
     ...
     oak.build.usb_product="Hutscape Oak"
     oak.build.usb_manufacturer="Hutscape"
     ...
     oak.build.extra_flags=-DCRYSTALLESS -D__SAMD21G18A__ {build.usb_flags}
     ...
     oak.build.variant=oak
     ...
    
  7. Ensure the folder names under variants are the same as in the file boards.txt properties *.build.variant
     $ ls variants
     oak
    
     $ cat boards.txt| grep "variant="
     oak.build.variant=oak
    
  8. Change the file platform.txt properties name= and version=

     name=Hutscape Boards
     version=1.0.0
    
  9. Git commit the entire board
  10. Git tag it with the same version written in platform.txt
  11. Download a zip file of the entire repository
  12. Add the new version of the board in package_hutscape_index.json
    • Add SHASUM
         shasum -a 256 hutscape-oak-arduino-boards-x.y.z.tar.gz
      
    • Add size in bytes
  13. Copy and paste the package_hutscape_index.json URL into the File > Preferences > β€œAdditional Boards Manager” textbox in Arduino IDE
     https://raw.githubusercontent.com/hutscape/arduino-board-index/main/package_hutscape_index.json
    

    Copy and paste the custom board URL into Board Manager in Arduino IDE

  14. Restart Arduino IDE
  15. Go to Tools > Boards Manager > Search for Hutscape or Oak Install custom Arduino board Custom Arduino board is installed
  16. Choose the custom board installed for compiling and uploading Choose the custom Arduino Board installed

References