How to create an application that is updateable

EmbeddedLocoNet  Bootloader   


This page explains how you add support for the IPL protocol to your application. It is assumed that you already followed the steps to create the bootloader. It also is assumed that your application already has code to receive any LocoNet messages. The added code just examines a received packet to find out if it is the start packet of a software update.

The code to add

  1. You need to #define MANUFACTURER_ID, DEVELOPER_ID, PRODUCT_ID in the makefile, sysdef.h or project configuration.
  2. Link the file apps/BootLoader/BootloaderUser.c to your project
  3. Add this code to your LocoNet packet handler:

if (BootloaderParseMessage(pstLnMsg) == 1)  // pstLnMsg holds a pointer to the last
{                                           // message received
   printf("updating...\n"); // or whatever output is appropriate for your application
   BootloaderEnter();       // jump to the bootloader with a software generated reset

Create loadable hex file

...TBC...description about makefile magics...
EmbeddedLocoNet  Bootloader   
Author of this website: Stefan Bormann. Valid HTML 4.01 Transitional SourceForge Logo