How do I write a software that programs the rabbit using asynchronous serial mode?

How do I write a software that programs the rabbit using asynchronous serial mode?

I have a project that works and I can load the code using the Rabbit Field Utility. I have also implemented the example for remote program update using HTTP and a secondary location.

For our application, we want to write our own program update utility because the module is part of a larger system, and we want to update all of the software using a single tool.

From what I understand, I need to:

  1. Set SMODE pins to high.
  2. Send byte triplets at 2400 bps, 8-N-1, over serial port A:
    The bytes are: Address MSB, Address LSB, Data Byte.

There are two things that I don’t understand about this process:

  1. Do the bytes in a *.bin file have limitations on the addresses they need to go in? Can I write the bytes to any address, or do I need to read address information from the *.bin file, and then write the bytes to the correct locations?

  2. How does the “secondary location” work? If I have two copies of the *.bin stored, how do I switch between them using Serial Port A and SMODE?

If it’s acceptable to use RFU during manufacturing to install an initial version of your firmware, you can make use of the Remote Program Update infrastructure to install further updates over the async serial port.

Use the existing Remote Program Update samples as a starting point to implement your own serial protocol for receiving firmware updates into the secondary location.

Feel free to ask additional questions regarding how RPU works – I wrote the original implementation while working for Digi.

If you want to use the bootstrapping with SMODE pins and triplets, you’ll probably want to implement something similar to how RFU works. It bootstraps a simple program to memory that can then switch to a higher baud rate and store your program to the board’s flash.

Digi has made the source to RFU available in the past, including the command-line RFU utility. If you require the bootstrapping functionality (as opposed to building a serial update feature into your program), then get in touch with Digi’s support department about getting the RFU source as a starting point for your own tool.