ArduinoISP - Kelboy GPIOs - Leonardo

Manual firmware upgrade

How to do a firmware upgrade in a Kelboy. Step by Step
Bit
18-10-2020
ArduinoISP - Kelboy GPIOs - Leonardo

This board has a shutdown control to avoid consuming energy, by having a shutdown programmed in the firmware, the Arduino Leonardo controller does not remain on for more than 30 seconds without the presence of an operating system (with the original firmware). That is why it is important to highlight the need to turn on the board at the time of the update.since what we are going to use is the Arduino UNO to program the Arduino Leonardo. The process has a series of verifications, so if we make a mistake it will give us a signature error (check the headers to see if it really is an Arduino Leonardo or is it another device).The Kelboy 2.0 board is built with an open architecture, which means that anyone with the tools available on the Internet can understand, download and upgrade this board for free.

Like any board with a certain complexity, it has to have something that manages the hardware, that turns it on, and that has a certain logic to ensure the correct operation of the hardware itself. Large companies keep this code closed since without it you ensure that the manufacturer has the exclusivity and control of the maintenance of the device. We want the life span of Lemoncrest products to be managed by each user, showing that we do not create any obsolescence in them, and the Kelboy 2.0 is in that situation.

Bootloader

In this large board there are some controllers, we are going to focus on the fact that the "brain" in charge of managing all the hardware is a small Arduino Leonardo, and like all Arduinos they need to be programmed.

There are two ways to program the bootloader:

The first one can be done with a single command. We are developing programs to facilitate the update of possible improvements in the near future.

The second is the interesting one, and explains how to do it "from scratch". To carry out the process we recommend that you use an Arduino UNO, but everyone can use whatever they like.

To program this bootloader (a closed Arduino process) you will need to prepare your programmer for this purpose (in this case the Arduino UNO board).

Preparing the Arduino programmer from your environment

Arduino helps you with this task by providing the community with an example of an ISP programmer, you can find the source code to work on as follows:

Image

Once you have the example on screen, it is time to read the documentation and understand what to do. We are going to use a series of digital GPIOs to program the Kelboy 2.0 Arduino Leonardo through the Arduino UNO programmer.

That's not magic, so you have to define a GPIO mapping:

Image

We have followed the official recommendation and left the RESET in D6, so we need to change it in the source code, in addition to uncommenting the constant USE_OLD_STYLE_WIRING (line 81).

Once that is done, we program the Arduino UNO by uploading the code.

With that step finished we have half the process, we continue connecting the cables respecting the declared configuration:

  • Kelboy MISO - Arduino D12
  • Kelboy SCK - Arduino D13
  • Kelboy RST - Arduino D6
  • Kelboy MOSI - Arduino D11
  • Kelboy GND - Arduino GND

Image

Programming

We must change the Arduino environment configuration like described in the next picture:

Image

It's important respect the options which are in the picture, since what we are going to use is the Arduino UNO to program the Arduino Leonardo. The process has a series of verifications, so if we make a mistake it will give us a signature error (check the headers to see if it really is an Arduino Leonardo or is it another device).

Once configured that way we proceed:

Image

We wait for it to finish. For this process we need that when the "burn bootloader" is launched, the Kelboy 2.0 board is turned on, so that it turns on the Arduino Leonardo and can be programmed.

This board has a shutdown control to avoid consuming energy, by having a shutdown programmed in the firmware, the Arduino Leonardo controller does not remain on for more than 30 seconds without the presence of an operating system (with the original firmware). That is why it is important to highlight the need to turn on the board at the time of the update.

Kelboy 2.0
This article is considered part of offered documentation by Lemoncrest products.
Comments
Page 1Page 1ear iconeye iconFill 23text filevr