Pine

🌲 Indoor Infrared receiver and transmitter with temperature sensor 🎐

power AA
wireless Infrared
mcu SAMD21G18
bom items 49
bom cost USD $9.71
vendors 2
completed September 2020

Burning Arduino bootloader

bootloader SWD J-Link Segger medium

Uploading the Arduino Zero bootloader with J-Link SEGGER


Details

Create the bootloader file

  1. Clone ArduinoCore-samd
  2. Go to folder /bootloaders/zero
  3. (Option) Append Makefile line 66 for crystalless board with -DCRYSTALLESS
     CFLAGS_EXTRA=-D__SAMD21G18A__ -DBOARD_ID_$(BOARD_ID) -D$(SAM_BA_INTERFACES) -DCRYSTALLESS
    
  4. (Optional) Edit board_definitions_arduino_zero.h line 26 to change product name
     #define STRING_PRODUCT "Pine"
    
  5. (Optional) Edit sam_ba_usb.c line 156 to change manufacturer name
     #define STRING_MANUFACTURER "Hutscape"
    
  6. Run make
  7. Ensure files bootloaders/zero/samd21_sam_ba.bin and bootloaders/zero/samd21_sam_ba.hex are created

Burn the bootloader

  1. Download and open SEGGER J-Flash Lite
  2. Connect the J-Link SEGGER with SWD pins to the PCB J-Link pinout mapping to SWD pins Connecting the J-Link SEGGER via the ribbon cable to the pogo pins
  3. Choose the created bootloader data file samd21_sam_ba.bin
  4. Click Program Device
  5. Disconnect J-Link SEGGER and connect the PCB to the laptop
  6. Double press the reset button to bring it into the bootloader mode
  7. Query ls -al /dev/cu.usbmodem* to ensure the port is detected
  8. Query arduino-cli board list | grep arduino to ensure the board is detected
      /dev/cu.usbmodem14101           Serial Port (USB) Arduino Zero (Native USB Port) arduino:samd:arduino_zero_native arduino:samd
    
  9. Flash the blinky LED program with crystalless option

Schematic

Wire up the hardware accordingly

 setup

References