Skip to content

Firmware Overview

benpoon-microchip edited this page Aug 29, 2018 · 2 revisions

Application firmware and boot-loader are preloaded to the board for Master Conference 2018 by default. The board is provisioned to Microchip AWS IoT and able to work with "Microchip Sensor Board" Alexa skill.

Application Firmware

Folder mcu-firmware/ contain the source code of the MCU appication firmware. There are 2 project solution files:

saml21g18b_sensor_board_demo_ECC.atsln - This is the project used to perform ECC608 configurion for AWS provision
saml21g18b_sensor_board_demo_JITR.atsln - This is the project for the demo application. Board running this firmware connect to AWS IoT, publish and subscribe AWS Shadow Topics

If the board did not provision to AWS IoT or you want to provision the board to other AWS IOT account, you need to program project saml21g18b_sensor_board_demo_ECC.atsln to the board first. Running some python scripts to generate private key and device certificate and store to ECC608 on the board. And then program saml21g18b_sensor_board_demo_JITR.atsln project to run the demo application. You can go to AWS Provision Setup for more details.

The starting address of Application firmware is 0x2000 in current project and the boot-loader is 0x0. If user use Atmel ICE to program the firmware to the board wihtout using boot-loader, starting address is need to be set back to 0

Steps to set the starting address to 0: Open the solution project in Atmel Studio -> Right click the solution file and select "Properties" -> Select Toolchain -> Select "ARM/GNU Linker" -> Select Miscellaneous --> Remove "-Wl,--section-start=.text=0x2000," in the Linker Flags

Boot-Loader Firmware

Boot-loader allow user to upgrade the MCU firmware through USB port. Boot-loader mode is triggered by press and hold SW1 during power on. SAM-BA V2.18 PC GUI is used to load a firmware to the board through USB port.
If USB firmware upgrade feature is not needed, user can use Atmel-ICE Debugger to load firmware to the board directly without using SAM-BA V2.18

Programming Procedure of Application

There are 2 method to program application firmware to board. One method is programming through USB port, the other method is using Atmel ICE programming tool to program the firmware the board

Method 1: Programming through USB port

  1. Connect PC to WINC1500 Secure Wi-Fi Board with USB cable

  2. Press and hold SW1 on the Board during power on the board, LD2 turn off if the board success to trigger the bootloader

  3. Launch SAM-BA V2.18 on PC, a GUI is display

  4. Select the correct port for the connection on the GUI

  5. Select "saml21_wsenbrd" for the board

  6. Click "Connect"

  7. In Tab "Flash", set the Address to 0x2000

  8. In Tab "Flash", select the firmware bin file in "Send File Name"

  9. Click "Send File"

Method 2: Programming with Atmel ICE tool
(If user use Atmel ICE to program the application to the board, starting address is need to be set back to 0)

  1. Connect Atmel ICE to the board like below photo

  2. Launch Atmel Studio, select Tools -> Device Programming

  3. Select "Atmel-ICE" as "Tool" and "ATSAML21G18B" as "Device"

  4. click on "Apply"

  5. Select "Memories" and the application firmware in "Flash"

  6. Click "Program"

Programming Procedure of Boot-loader

User can use Atmel ICE programming tool to program the boot-loader the board

  1. Connect Atmel ICE to the board like below photo

  2. Launch Atmel Studio, select Tools -> Device Programming

  3. Select "Atmel-ICE" as "Tool" and "ATSAML21G18B" as "Device"

  4. click on "Apply"

  5. Select "Memories" and the boot-loader firmware (SAM-BA_MONITOR_ROMLESS.ELF) in "Flash"

  6. Click "Program"

Debug UART Console

MCU Debug UART bus and WINC1500 Debug UART bus are connect to J9 connector.
The circuit is as below:

User can use a USB-to-UART converter to connect PC and the board Debug UART to capture MCU log or WINC1500 log. TeraTerm can be run on PC to capture the log. Baud rate is 115200