Bootloader

From openPicus Wiki
Jump to: navigation, search

Contents

Introduction

Each Flyport module comes with a serial bootloader preloaded onboard so you don't need to buy an expansive programmer but you can simply use a serial connection to download the firmware you created with the IDE to the module.

What is a serial Bootloader

Normally a programmer is needed to flash firmware into a microcontroller. The programmer is an external device connected to the PC and to the target board that writes a new firmware (hex file) into the flash memory of the microcontroller and controls the boot and the reset of the device.
To avoid the cost of a standard programmer Flyport has an internal bootloader that allows you to flash firmware on it simply using a serial (UART) connection (for example using the low cost miniUSB Programmer that is a simple USB to UART converter).
What if your firmware sends an instruction to write to a “dangerous” memory address? No problems: the bootloader stops writing, avoiding “killing” itself. The IDE gives you a feedback saying that “the code can damage the bootloader, so it has not written it”.
The bootloader runs for a short time (3 seconds) only at the startup of the Flyport, so it doesn't slow it in any way. It uses very little memory (1KB) when Flyport has 256KB of memory!

How it works

When Flyport turns on (or after a reset) it waits for 3 seconds to receive a the char '0xC1' on the UART1 port (baudrate 115k). If it receives this char Flyport enters into programming mode and it's ready to accept the new firmware that will be flashed into the internal memory.
Otherwyse Flyport runs the last firmware present on the internal Flash memory.

Code

You can find source code and hex of the bootloader (DS30 modified) in each Flyport specific Wiki page.

Credits

FLYPORT uses a slightly customized version of the ds30 bootloader: opensource and lightweight bootloader for PIC microcontrollers.

Personal tools
Namespaces

Variants
Actions
START HERE
DEVELOPMENT
HARDWARE INFO
RESOURCES
PHASED OUT
Toolbox