Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
make Crossworks compatible; increment bcdDevice in USB descriptor to …
Browse files Browse the repository at this point in the history
…make change evident
  • Loading branch information
majbthrd committed Jul 30, 2021
1 parent 2f78bb9 commit 02661fc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ The USBCRM mode should be universal, as it doesn't depend on optional external c

Pre-compiled images are already available via this project's Releases tab.

[Rowley Crossworks for ARM](http://www.rowley.co.uk/arm/) is presently suggested to compile this code, as it includes support for Clang; at this time, I am not aware of any other ready-to-use (and multi-OS to boot) Clang ARM cross-compiler package that I can readily point users to. With Crossworks for ARM v4.6.1, compiling v1.05 using the Clang 9.0.1 compiler produces a 1003 byte image. The more mainstream GCC lags behind Clang, although more recent GCC versions produce code that is less overweight than in years past.
[Rowley Crossworks for ARM](http://www.rowley.co.uk/arm/) is presently suggested to compile this code, as it includes support for Clang; at this time, I am not aware of any other ready-to-use (and multi-OS to boot) Clang ARM cross-compiler package that I can readily point users to. With Crossworks for ARM v4.8.1, compiling v1.06 using the Clang 11.1.0 compiler produces a 995 byte image. The more mainstream GCC lags behind Clang, although more recent GCC versions produce code that is less overweight than in years past.

|bootloader variant|Clang 9.0.1 (-O1) |GNU Arm 2018-q3 (-Os) |GNU Arm 2019-q4 (-Os) |
|------------------|------------------|----------------------|----------------------|
| USE_DBL_TAP | 1003 bytes | 1044 bytes (too big!)| 1041 bytes (too big!)|
| GPIO input | 979 bytes | 1008 bytes | 1006 bytes |
|bootloader variant|Clang 9.0.1 (-O1) |Clang 11.1.0 (-O1) |GNU Arm 2018-q3 (-Os) |GNU Arm 2019-q4 (-Os) |
|------------------|------------------|-------------------|----------------------|----------------------|
| USE_DBL_TAP | 1003 bytes | 995 bytes | 1044 bytes (too big!)| 1041 bytes (too big!)|
| GPIO input | 979 bytes | 975 bytes | 1008 bytes | 1006 bytes |

A Makefile supporting GCC is provided, but even if you have the latest GCC, it may not be able to output a version within the 1024 bytes available. The latest GCC for ARM can be here: [GNU Arm Embedded Toolchain](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm). Note that if you are adapting the Makefile for use with clang, try replacing the "-Os" argument in CFLAGS with something like "-O1" if the output size is larger than expected.

Expand Down
2 changes: 1 addition & 1 deletion bootloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ static void USB_Service(void)

#ifdef USE_DBL_TAP
#define DBL_TAP_MAGIC 0xf02669ef
static volatile uint32_t __attribute__((section(".dont_move"))) double_tap;
static volatile uint32_t __attribute__((section(".vectors_ram"))) double_tap;
#endif

void bootloader(void)
Expand Down
2 changes: 1 addition & 1 deletion linker/samd11d14.ld
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ SECTIONS

.dont_move_block (NOLOAD): ALIGN(4)
{
*(.dont_move)
*(.vectors_ram)
}

.data : ALIGN(4)
Expand Down

0 comments on commit 02661fc

Please sign in to comment.