From 0b0bfa4b7897abeddfc0bf66a17a835b890a1246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikael=20=C3=85gren?= Date: Thu, 17 Apr 2025 08:44:15 +0200 Subject: [PATCH] doc: Add ERASE_DATA syscall --- doc/release_notes.md | 6 +++--- hw/application_fpga/fw/README.md | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/doc/release_notes.md b/doc/release_notes.md index e68a258..84e82de 100644 --- a/doc/release_notes.md +++ b/doc/release_notes.md @@ -79,9 +79,9 @@ For full change log [see](https://github.com/tillitis/tillitis-key1/compare/TK1- - Support a filesystem on flash. - Add a system call mechanism and system calls: `RESET`, `ALLOC_AREA`, - `DEALLOC_AREA`, `WRITE_DATA`, `READ_DATA`, `PRELOAD_DELETE`, - `PRELOAD_STORE`, `PRELOAD_STORE_FIN`, `PRELOAD_GET_DIGSIG`, - `STATUS`, and `GET_VIDPID`. See [firmware's + `DEALLOC_AREA`, `WRITE_DATA`, `READ_DATA`, `ERASE_DATA`, + `PRELOAD_DELETE`, `PRELOAD_STORE`, `PRELOAD_STORE_FIN`, + `PRELOAD_GET_DIGSIG`, `STATUS`, and `GET_VIDPID`. See [firmware's README](../hw/application_fpga/fw/README.md) for documentation. - Harmonize with [tkey-libs](https://github.com/tillitis/tkey-libs). diff --git a/hw/application_fpga/fw/README.md b/hw/application_fpga/fw/README.md index 17e9040..63bfc25 100644 --- a/hw/application_fpga/fw/README.md +++ b/hw/application_fpga/fw/README.md @@ -594,6 +594,20 @@ syscall(TK1_SYSCALL_READ_DATA, offset, (uint32_t)buf, sizeof(buf); Read into `buf` at byte `offset` from the app's flash area. +#### `ERASE_DATA` + +``` +uint32_t offset = 0; +uint32_t size = 4096; + +syscall(TK1_SYSCALL_ERASE_DATA, offset, size, 0); +``` + +Erase `size` bytes from `offset` within the area. Returns 0 on +success. + +Both `size` and `offset` must be a multiple of 4096 bytes. + #### `PRELOAD_DELETE` ```