Commit graph

750 commits

Author SHA1 Message Date
Mikael Ågren
05c854a82a doc: Update UDS core README according to implementation
Updates the UDS core README to reflect that:

- ADDR_UDS_FIRST and ADDR_UDS_LAST params have been removed
- The address range has been lowered to 8 words.
2025-12-04 14:04:19 +01:00
Michael Cardell Widerkrantz
107bbaa9ee build: Import TP-1 programming board on both run and flash targets
- Import TP-1 programming board on both run and flash.

- Import only TP-1, not any other USB devices.
2025-12-03 15:41:00 +01:00
Mikael Ågren
de31ebe64b tool: Mention preloaded app and its signature in tkeyimage README 2025-12-03 15:41:00 +01:00
Mikael Ågren
9c8c155fde build: Support flash app slot 1 signature
Add optional variable FLASH_APP_1_SIG which can be set to flash the
signaure for app slot 1
2025-12-03 15:41:00 +01:00
Mikael Ågren
5897e0fe11 build: Support flash app slot 1
- Add optional variable FLASH_APP_1 which can be set to flash an app
into app slot 1.
- Rename DEFAULT_APP to FLASH_APP_0 to be consistent.
2025-12-03 15:41:00 +01:00
Mikael Ågren
33fc1bb4ba tool: Print b2s errors to stderr
Useful since b2s often is used like this:

`b2s -c -m app.bin > mgmt_app_digest.h`
2025-12-03 15:41:00 +01:00
Mikael Ågren
6ad502c280 build: firmware.elf depend on digest of flash app 0
Firmware depends on the expected content of the flash. Not the actual
content of the flash.
2025-12-03 15:41:00 +01:00
Michael Cardell Widerkrantz
445c16feae tool: Support app1 in tkeyimage
Add support for an app in slot 1 and a signature for the same app.

- App digest and app signature is stored in the partition table
- The app is stored in app slot 1
- Two new flags are introduced: -app1 and -app1sig.
  - app1: The app binary
  - app1sig: A .sig file on a format similar the the files produced by
    tkey-sign. Signing algorithm is not checked, it is left to the app
    that will validate the signature to specify what algorithm to use.
- sigfile.go is imported from tkey-boot-verifier

Co-authored-by: Mikael Ågren <mikael@tillitis.se>
2025-12-03 15:41:00 +01:00
Daniel Jobson
f0c6016a6e ch552: add zero length packet handling
Terminate all 64-byte frames with a zero-length packet. Handle incoming
zero-byte frames by ignoring them. This fix addresses issues related to
transfers of an exact length of 64 bytes (or multiples thereof) on all
platforms. For simplicity, all 64-byte frames are terminated, regardless
of whether they are the last or not.
2025-11-13 11:38:47 +01:00
Daniel Jobson
5f3a065aaa Follow REUSE specification
- Add REUSE configuration
- Add compliant licenses in LICENSES/
- Add copyright SPDX tags
- Run REUSE complicance check in CI
- Remove spdx-ensure
2025-10-30 13:07:59 +01:00
Daniel Jobson
c53edbe4ac gitignore: ignore all archives in tkey-libs 2025-10-30 13:07:59 +01:00
Daniel Jobson
a37f687881 Change license to BSD-2-Clause
This was announced on the Tillitis Blog the 2nd of October 2024, for
more info visit https://tillitis.se
2025-10-30 13:07:59 +01:00
Daniel Jobson
ea82b0c1fd Update application_fpga.bin.sha256 2025-10-28 08:40:06 +01:00
Daniel Jobson
afdbaf99fb ch552: Make CTS active low, as per the standard 2025-10-28 08:40:06 +01:00
Daniel Jobson
1a47a2266f uart: Make CTS active low, as per the standard 2025-10-28 08:40:06 +01:00
Daniel Jobson
74e3d74c11 fpga: Update next-pnr seed to reach 24 MHz 2025-10-27 15:13:12 +01:00
Daniel Jobson
6104356892 tb: uart add framing error test
- Adds option to test invalid stop bit
- Adds a test that simulates an always low rx line
2025-10-27 08:54:34 +01:00
Daniel Jobson
395d241ed3 uart: add framing error handling
- Checks the stop bit, if it is not valid the data is discarded and
  enters a error state. Only checks first stop bit.
- Adds an error state to the RX FSM. The core starts in this state to
  not assume a valid idle rx line on start up. Prevents accepting
  frames on a constant low rx line and filling the fifo.
- bugfix: always reset bitrate_ctr when leaving state ERX_BITS and
  remove unused bitrate_ctr counter in ERX_STOP
2025-10-27 08:54:31 +01:00
Michael Cardell Widerkrantz
aa04cf068f
doc: Add LICENSE file for picorv32 custom ops 2025-09-02 11:09:15 +02:00
Michael Cardell Widerkrantz
cbcb7fb1de
build: Run static code analysis after fw build
Since we now generate at least one source code file we need to run the
static code analysis after the build.
2025-09-02 11:09:15 +02:00
Michael Cardell Widerkrantz
34e9f0a314
tkey-libs: Import tag fw-5 of tkey-libs
Use tag fw-5 from https://github.com/tillitis/tkey-libs/
2025-09-02 11:09:12 +02:00
Michael Cardell Widerkrantz
17e5e77187
build: Always rebuild firmware if any header file changes 2025-09-01 18:19:54 +02:00
Michael Cardell Widerkrantz
18386b4865
build: Remove all built qemu artefacts when cleaning 2025-09-01 18:19:54 +02:00
Michael Cardell Widerkrantz
90a91ba1ba
build: Create and use a complete filesystem image
- Create a flash image in flash_image.bin, useful for both a real TKey
  and QEMU.

- Use flash_image.bin directly in prog_flash for a real TKey, which
  also flashes the bitstream.

- Remove building of tools/default_partition.bin.

- Update documentation about the tool use.

- We keep the load_preloaded_app.sh for development purposes,
  but it's no longer used in the build.
2025-09-01 18:19:54 +02:00
Michael Cardell Widerkrantz
65ff0a5d61
doc: Document the filesystem 2025-09-01 18:19:54 +02:00
Michael Cardell Widerkrantz
6fc4d264cc
build: Introduce DEFAULT_APP with automatic builds
Introduce the Makefile variable DEFAULT_APP which should be the path
to the device app binary to include in the obliagory slot 0.

Build automatically: the default app, the new digest file
mgmt_app_digest.h for the firmware which contains the digest of
DEFAULT_APP, the default partition table, and all the tools necessary
to generate this.
2025-09-01 18:19:54 +02:00
Michael Cardell Widerkrantz
9eed887a75
ci: Bump to tkey-builder:5rc2 2025-09-01 18:19:53 +02:00
Michael Cardell Widerkrantz
d3492e2a34
tool: Change b2s to output exact variable used
- Use correct name.
- Don't declare it as static.
- Lose the toolchain
- Use only basename of path in the b2s comment
2025-09-01 18:19:53 +02:00
Jonas Thörnblad
13767ee7df
Add loopbackapp for app debugging using physical TKey with QEMU
This app takes data coming in on any of the normal USB endpoints
like CDC and FIDO (or CCID) and outputs the data on the DEBUG
endpoint.

Using the scripts (tkey_to_udp_linux.py, tkey_to_udp_win.py) in
QEMU (tk1 branch) under tools/tk1, the data from the DEBUG
endpoint can be read and sent over the network to the script
udp_to_qemu_linux.py that feeds it to QEMU.
2025-08-28 17:01:07 +02:00
Jonas Thörnblad
1926d19146
fw: Change loader app
- Change loader app from testloadapp to defaultapp
- Update default_partition.bin to contain defaultapp.bin
2025-08-22 15:11:01 +02:00
Michael Cardell Widerkrantz
babdef52f5
toolchain: Add Go package
- Add Go 1.23.
- Set up PATH for container to include the Go binaries.
2025-07-17 07:53:50 +02:00
Jonas Thörnblad
a0f699aea5
Update USB product descriptor for Castor 2025-06-27 15:01:29 +02:00
Jonas Thörnblad
62adf4da71
Update USB VID and PID for Castor
VID has been wrong for some reason, therefore changed to the
correct value 0x1209.

New PID to differentiate Castor from Bellatrix.
2025-06-27 15:01:29 +02:00
Jonas Thörnblad
1a904e8857
Fix allowed_app_digest formatting
Fix formating of BLAKE2s digest of app allowed to start from
flash slot 0.
2025-06-27 15:01:29 +02:00
Jonas Thörnblad
03d96c3e96
tool: Fix b2s BLAKE2s digest zero padding 2025-06-24 18:18:17 +02:00
Jonas Thörnblad
c0b3c80620
Add make targets for building CH552 firmware with podman 2025-06-24 17:27:21 +02:00
Mikael Ågren
460d310c73
fw: Fix qemu_firmware build warnings 2025-06-19 08:50:13 +02:00
Michael Cardell Widerkrantz
f4f8c9e6c6
doc: Update Building & flashing docs
- Point out where to find tools.

- Add some description that we assume a Linux dist.

- Move the make targets around: make flash builds and flashes the
  entire thing so someone who just want to exactly that can use it
  right away.

- Explain what kind of hardware the USB controller is.

- Add a description on how to be able to use chprog without being
  root when running chprog.
2025-05-30 18:07:29 +02:00
Sasko Simonovski
ed9395c832
doc: Describe how to test alpha release in release notes
Adds information and link on how to test alpha release.
2025-05-28 11:56:22 +02:00
Mikael Ågren
888f18e5fe
doc: Refer to CH55x Reset Controller silk screen labels in flash docs 2025-05-26 07:59:50 +02:00
Michael Cardell Widerkrantz
24ef7b412b
doc: Add description on how to build and flash USB controller firmware 2025-05-23 15:43:44 +02:00
Michael Cardell Widerkrantz
f5d2cfef15
doc: Mention the tkeyimage tool in firmware README 2025-05-23 14:12:36 +02:00
Michael Cardell Widerkrantz
9a93da087d
doc: Document how to flash with filesystem 2025-05-23 14:12:36 +02:00
Michael Cardell Widerkrantz
916c37eab9
doc: Update release notes
Co-authored-by: Mikael Ågren <mikael@tillitis.se>
2025-05-23 14:05:58 +02:00
Michael Cardell Widerkrantz
29e5888482
doc: Remove old toolchain setup text
Use current information in Developer Handbook,
https://dev.tillitis.se/ instead of relying on this old description.
2025-05-23 14:05:58 +02:00
Mikael Ågren
e8acc7aee2
build: Flash partition table when running make prog_flash
Changes make targets:

- prog_flash in hw/application/Makefile which flashes only the
  bitstream is renamed to prog_flash_bs.

- prog_flash in hw/application/Makefile is modified to flash the
  bitstream, the testloadapp.bin in app slot 0, and the partition table.

- flash in contrib/Makefile is modified to use prog_flash from
  hw/application/Makefile
2025-05-22 15:24:45 +02:00
Mikael Ågren
4172db8dfb
build: Do not use sudo when running tillitis-iceprog 2025-05-22 15:06:39 +02:00
Mikael Ågren
7b1c1e5076
testapp: Update to 24 MHz clock 2025-05-22 09:31:54 +02:00
Michael Cardell Widerkrantz
1fec28ff0d
doc: Complete copyright and licenses
- Point out licensing terms in docs.
- Add missing SPDX tags
- Update the SPDX checker to check all the files we want to check.
- Include spdx-ensure in CI.
2025-05-22 09:31:54 +02:00
Michael Cardell Widerkrantz
8f9c706b9e
doc: Correct the GPL file
Import file

https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt

verbatim since it clearly says in the license that we are now allowed
to change it. I think it might have been a cut and paste from

https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

before?
2025-05-22 09:31:54 +02:00