<< return to blog entries
2010-06-02 03:24:24 (7512 views) In this big mess of laws, regulations, manufacturing and hardware, the few embedded software programming parts with which we used to struggle have come to seem trivially easy. However, there's one small and mean programming task with teeth we're finally attacking and that's the part where we allow you to reprogram the DL2K-LINK without external hardware.
There are many constraints:
- hardware can in no case become "broken" by incorrectly terminated upgrades. This is not exactly trivial as the chip used is a "programmable system on a chip" (PSoC) which can actually reconfigure its hardware inputs and outputs based on the firmware. It actually reconnects its internals! High tech chip... so if by any chance the configuration becomes messed up and a line is told to pull itself up while the other end tries to pull down (radio chip) this could create excess current going through the CMOS circuitry and even damage the hardware irreparably... so we need heavy checksum verification before anything is written to the program flash memory.
- in case of a failed firmware download, the unit must be able to start itself in "bootloader" mode to enable subsequent download attempts.
Now the part with teeth is that for us to be able to completely reconfigure the DL2K-LINK driver and functionality there needs to be another complementary driver (on the same device) which enables downloading the firmware. So essentially this part can be "booted" as 2 different USB devices; the DL2K-LINK and the firmware downloader.
And to do this you have to keep a close eye on USB descriptors, memory areas, checksum storage areas, and so forth. Whereas normally you create code and let the compiler put it where it may, here you must be aware of how it's compiled, where it goes, how it's rewritten, what the memory paging system is, and so forth.
Same as the firmware download on the DL2000 receiver (and the remote too which is entirely similar and will come up soon). Except that here you've got two USB devices in one...
Good news is that finally after struggling for a while it's working... (it downloads firmware and reboots with the new program) so we just have to move big blocks of code and do some cleaning up in order to restore all the features, and all will be well.
Blog posts must be getting more and more incoherent... we're crazy-busy-dizzy...
Comments
Post new comment
|
It's time guys to finish and SELL your product.
dyonisos