Commit Graph

6 Commits

Author SHA1 Message Date
Marcos Chaparro fbc7767fcb Set crc and flag for memory checks to '1' at build time
Ensures the memory addresses used for flash memory integrity check
are initially 0xFFFFFFFF, so the application can write a new CRC in the
first boot.

Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2019-04-17 21:27:43 -03:00
Marcos Chaparro 1ae059349f CRC integrity check of flash memory
The check only covers address 0x08008000 to 0x805FFFF, where application
code is stored. It excludes virtual eeprom area (first 0x8000 bytes)
because it is modified on runtime with user configurations.

After a fresh flash programming the CRC is read as 0xFFFFFFFF and firmware
computes and stores the new CRC and a reset is invoked.
After reset the CRC will be available for checking code integrity.

Linker file had a wrong flash2 size, it was set to 480kB, thus allowing
the linking of binaries larger than 393216 (x3 128kB sectors).
The bootloader won't program binaries that span more than 3 sectors.

Now flash2 length is set as (393216 - 8) to ensure that the last 8 bytes
are left blank (0xFFFF) and  reserved for CRC information.

Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2019-04-15 20:56:42 -03:00
Benjamin Vedder c4ff81e849 Ported to ChibiOS 3, refactoring, cleanup, added safe start delay after fault for PPM app, removed unused ST libraries 2015-10-08 23:09:39 +02:00
Benjamin Vedder bc7a779632 Bootloader support, CAN fixes 2015-05-08 22:53:59 +02:00
Benjamin Vedder 44c1701cf9 Included stable version of ChibiOS, fixed i2c issues, gave more RAM in linker script, added table-based gamma correction for PCB LEDs 2015-01-05 05:48:29 +01:00
Benjamin Vedder 1f1a8af1d7 Full runtime configuration support with flash storage 2014-09-15 02:39:58 +02:00