This PR implements the new version of asynchronous MIB v2.0. There are still refinements left to do but it works and appears stable in hardware so I'm putting it up for @amcgee to test.
The documentation of each part is in doc/8{0,1,2,3}-MIB-*.md
Specifically, this PR implements:
New PIC12 Executive with the following features
Very good unit test coverage of major functionality
Checksum verification before running application firmware
New application MIB block that supports API compatibility version and firmware version
Support for MIB protocol v2.0
PRO mode compiler is no longer required for compilation
Updated PIC24 firmware with the following new features
Cleaned up various headers that weren't actually portable or out of date
Support for MIB protocol v2.0
Fixed performance bug in taskloop where a task could be added to the loop without being run until the device woke from sleep from an external event (this is still possible but the odds of it happening are greatly reduced).
Updated all pic24 chips to be more robust to noise on the bus.
Included in the new MIB bus code is a better of way of checking whether the bus is idle that cannot be confused by noise. Previously, if noise caused a false start to appear on the bus, everyone could hang thinking the bus was in use forever. Now, the bus is checked for ~ 4 clock periods and if no activity is seen, it is assumed to be idle. This check is sufficient since it is not possible for someone to be in the middle of a call without either SDA or SCL going low at least once in 4 clock periods. (really 1 clock period but the 4 is to allow for clock slop and ease of implementation.
Updating Instructions
You must update pymomo to the latest PR version, gpsim to the latest PR version and this PR at the same time and reflash every pic12_executive, mainboard and fsu together since old and new firmwares are not compatible on the wire. Compilation of the new code also required an updated pymomo using the PR on that repository since new build steps were added to patch in checksums into pic12 application firmwares and the mib file format changed.
Known issues
[ ] The new MIB requires slightly more application space to store slave endpoints than the old version, causing mib12_reflash to run out of ROM. This is fixable but not high priority
[ ] A new way to iterate over communication modules needs to be implemented in pic24 code to support the comm system
[ ] the gsm_module needs to be updated to be compatible with the new mib api (I didn't rewrite it since Austin is going to update it anyway.
[ ] There is not yet support on pic12 for querying which interfaces a device supports though this is straightforward to add.
This PR implements the new version of asynchronous MIB v2.0. There are still refinements left to do but it works and appears stable in hardware so I'm putting it up for @amcgee to test.
The documentation of each part is in doc/8{0,1,2,3}-MIB-*.md
Specifically, this PR implements:
Included in the new MIB bus code is a better of way of checking whether the bus is idle that cannot be confused by noise. Previously, if noise caused a false start to appear on the bus, everyone could hang thinking the bus was in use forever. Now, the bus is checked for ~ 4 clock periods and if no activity is seen, it is assumed to be idle. This check is sufficient since it is not possible for someone to be in the middle of a call without either SDA or SCL going low at least once in 4 clock periods. (really 1 clock period but the 4 is to allow for clock slop and ease of implementation.
Updating Instructions
You must update pymomo to the latest PR version, gpsim to the latest PR version and this PR at the same time and reflash every pic12_executive, mainboard and fsu together since old and new firmwares are not compatible on the wire. Compilation of the new code also required an updated pymomo using the PR on that repository since new build steps were added to patch in checksums into pic12 application firmwares and the mib file format changed.
Known issues