WellDone/MoMo-Firmware — pull request #138 by amcgee (2014-10-16 18:13:00+00:00)
Title: Update pic12_executive and gsm_module to use local build settings

(coded by @timburke)

This PR updates the gsm_module to be compatible with the latest v5 gsm board hardware. It does the following:

Updates the pic12 build system to look for module_settings.json files to allow for local module settings
Updates pic12_executive and gsm_module to use module_settings.json
Makes gsm_module target two architectures to produce a v5 hardware (microsim) and v4 hardware compatible hex file.
Fixes target name parsing in unit testing for pic12 to enable proper generation of unit testing summaries.
Updates gsm_module code to be compatible with both v5 and v4 gsm hardware.
Adds port_definitions.h and updates port.h to encode knowledge of what ports on each chip can be made analog. This allows application code to make a pin ANALOG when possible without having to know whether the physical pin that it is controlling on each target architecture supports setting the pin to analog. Often you want to set a pin as analog if possible to save power but not care if it is not supported since it's not required from a functionality standpoint. This was necessary to implement now since some of the pins on v5 were not analog-able whereas they were on v4 gsm hardware.

Update test files to be compatible with build system

Bugfix momo shell

Add ability to programmatically generate test runners from module unit tests

- Also fix bug in finding src files specified in module tests

Remove verbose printing

Finish work to integrate pic24 unit tests into build system

- linkedlist test is currently not passing on pic24f16ka101 for reasons
that are unclear.

Update mainboard code and build system to include metadata

- stores checksums of the firmware image and an 8-byte hardware id
that will be checked by the bootloader before loading the application

Update linker script to include metadata section

Update bootloader to explicitly validate all firmware code.

Controller firmware now includes a 32 word metadata segment
that contains checksums for the interrupt vector table, alternative
IVT, metadata block and all firmware code. This block is validated
by the bootloader before jumping into application code and if it
is not valid, the bootloader signals its error status by toggling
the ALARM line at a rate of 50ms*ERROR_CODE where error code is 1-7
so looking at the alarm pin pulse width tells you the error code.

This has been tested on the current hw version and works

Add support for dumping and creating controller firmware metadata
blocks.

Add ability to inspect ControllerBlock metadata in momo tool

BUGFIX: the routine to pack controller firmware was off by 1 word

This means that the firmware would be packed incorrectly into FLASH.
It looks like this only affected the highest ROM word so this may not
have actually caused any problems in the field but it was preventing
the new bootloader from running firmware because it failed validation. This is now fixed.

Update hexfile to show addres where two files differ