I was wondering if it would be possible to load an app onto a wixel via one of the UART ports. I have a project where once the wixel is mounted, getting to the USB port would be problematic, as it will be very well sealed. It has a BLE module connected to one of the UARTs, and it would be preferable to be able to load an app onto the wixel via BLE. I understand the 80 byte restriction on the BLE, but would this still be possible? If so, what would be the considerations I would have to make in order to make this work?
Thanks in advance.
To load programs onto a Wixel using its UART, you would need to first load a bootloader onto the CC2511F32 that implements a set of serial commands that can be used to erase and write to the flash on the Wixel. The bootloader would occupy some portion of the flash memory of the CC2511F32, and you would need to adjust your compiler settings so that the app you are developing gets compiled into the right region of flash memory. You would also need to write or find appropriate software for the PC that can take the HEX file of your app as input and send it to the bootloader using the correct serial protocol.
I am not aware of any existing bootloader that you could use, so you would probably have to design and implement it yourself. There are a lot of things to consider when designing a bootloader, and I cannot give a full list of them.
One of the first decisions would be whether you will replace the Wixel’s USB bootloader, or just design your serial bootloader to live inside the “app” portion of the flash memory reserved by the USB bootloader. Removing the USB bootloader requires extra programming hardware and it is a permanent change, but it would give you 3 KB more flash memory and it might give you the option to write-protect your bootloader so that you can never accidentally erase it.
You will probably want some way to guarantee that you can start the serial bootloader even if the app you loaded is totally corrupted and not cooperating. (Maybe your BLE module could use some I/O lines to reset the Wixel and get it into serial bootloader mode?)
We provide some documentation for how the Wixel bootloader works which might be useful to you. You can find it in the “The Wixel USB Bootloader” section of the Pololu Wixel User’s Guide. You would also need to read some parts of the CC2511 datasheet to learn how the flash memory is organized and how to erase and write portions of it.
Really great info. I will let you know what I decide and how I end up doing it all. I like the idea of keeping it part of the app, but I also like the idea of saving some boot load space. I will have a deep think.
Thanks again for your knowledgeable responses. They are always enlightening.