-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support new BGA-based MCU (HW rev 4)
Adds better hardware configuration, contained in platform_config.h. If the firmware detects different hardware revision that it was built for, it enters the bootloader mode. Contains other improvements and discoveries, most important listed below. This firmware was tested on both HW rev 3 and 4. Tested on Fedora Linux against: - libnitrokey test suite (libnitrokey v3.6-15-g871a1c9) - GNUK test suite (Nitrokey Start: RTM.10-20-g64f8671) - GnuPG 2.2.20 manual tests - OpenSC 0.20 manual tests Connected: Nitrokey/nitrokey-pro-hardware#20 Fixes #82 Squashed commit of the following: Blink debug LEDs in the development build Boot to the bootloader if flashed firmware does not suit to the hardware Correct compiler flags The -fdata-sections flag influences .text sections from the core drivers, which renders the CCID interface not working, and possibly introduced some other issues, despite having --gc-sections enabled only for the debug build. The -ffunction-sections flag seems to work fine otherwise. Leaving only for the debug builds for now. Debug: prepare test firmware with boot stages LED signalization Stage 1: boot start, before smart card configuration, no LED Stage 2: starting smart card configuration, awaiting for ATR, red LED blinking Stage 3: after smart card configuration, awaiting for USB configuration and connected state, blue/green LED flashes constantly Stage 4: after USB configration, boot process complete, blue/green LED blinking Debug: add ocd helpers for the development Introduce debug build with BUILD_DEBUG=1 switch Removing unused code sections results in a linking error, hence part of the code has to be discarded. To be confirmed, whether this changes the runtime behavior for the release version, and enable there as well. GC of the unused code is required for the development build, which does not fit the flash size otherwise. Mentioned error message: /gcc-arm-none-eabi-8-2018-q4-major/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../ar m-none-eabi/bin/ld: section .ARM.exidx LMA [000000000800b9cc,000000000800b9d3] overlaps section .data LMA [00000000080 0b9cc,000000000800c02b]
- Loading branch information
Showing
18 changed files
with
800 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.