Commit Graph
42 Commits
Author SHA1 Message Date
iceman1001 a878043061 fix missing appmain changes 2026-09-12 15:24:46 +02:00
iceman1001andClaude Opus 5 (1M context) 9a8e179266 fix spiffs downloads >= 64K, and stop losing flash errors
CMD_SPIFFS_DOWNLOAD read the whole file into BigBuf first.  BigBuf_calloc()
takes a uint16_t while the size is a uint32_t, so a 64K file allocated zero
bytes and anything larger wrapped to a short buffer the file was then read
straight past the end of.  rdv40_spiffs_read_stream() opens the file once and
hands out one frame at a time, so the size never reaches the allocator, and the
SPIFFS path now honours start_index.  Verified with an 80K round trip: upload,
download, byte identical.

The same BigBuf_calloc(filesize) wrap was in copy_in_spiffs(); it now copies in
SPIFFS_WRITE_CHUNK_SIZE chunks.

Separately, every flash failure was invisible.  SPIFFS_CHECK_RES() only treats a
negative result as an error and the HAL hooks returned 128/129/130, so SPIFFS
saw success.  The erase path was worst: Flash_Erase4k() only reports that the
command was sent, both Flash_CheckBusy() results were discarded, and
'return (SPIFFS_OK == erased)' yields 1 on failure.  A flash dump from a device
that hit this showed one block written without being erased - its object index
header held '0x14000 & 0x10000', and the filename ANDed away to empty.  Erases
are now read back and retried, and the HAL returns real SPIFFS error codes.

Flash_Write() returned len unconditionally even after a rejected page, which
also defeated the 'res == payload->len' check in CMD_FLASHMEM_WRITE.

Feedback, so none of this is silent again: CMD_SPIFFS_WRITE answers with the
SPIFFS result, the client aborts on the first refusal and names the byte it
stopped at, dl_it() checks the terminator status, and both transfer directions
print inline progress.

Co-Authored-By: Claude Opus 5 (1M context)
2026-09-12 14:58:08 +02:00
iceman1001 6411ba1ee4 add 2026-07-30 17:06:36 +02:00
iceman1001 19cc98c532 hooked up the new DSP code. Should improve the t55xx commands 2026-07-30 16:43:09 +02:00
iceman1001 2c6e607110 style 2026-07-15 16:39:15 +02:00
iceman1001 7af8674b22 fix saflok test output and add it to test script 2026-06-30 02:22:56 +02:00
Philippe Teuwen d078e8a62b make style 2026-05-21 20:54:44 +02:00
iceman1001 cbb572afad style 2026-05-11 14:36:17 +02:00
Philippe Teuwen c00e4801b7 make style 2026-02-06 13:43:41 +01:00
iceman1001 1fa5e28a38 unify text and hints for static enc nonces a bit more 2025-06-08 21:46:31 +02:00
iceman1001 875b3c44b4 unify text - step 1 2025-03-25 10:12:16 +01:00
Philippe Teuwen ad84875afd cppcheck nullPointerOutOfMemory 2025-03-24 23:46:43 +01:00
iceman1001 4d603a4530 unify hint text 2025-03-20 22:55:26 +01:00
iceman1001 17a8f0f9c2 text 2025-03-20 12:17:37 +01:00
iceman1001 ff765f569f change out some non-breaking wait for response from some command which shouldnt have it. Sniff / simulate / bruteforce should have it. and some minor text / style 2024-10-04 10:01:50 +02:00
iceman1001 2c1f45f3aa fix const params and if statements 2024-05-14 11:20:36 +02:00
iceman1001 6a933555df mem spiffs dump now honors the -d filename and save to file when used together with the -t param 2024-03-05 14:55:30 +01:00
iceman1001 035572798e text and style 2024-01-02 21:52:06 +01:00
Anonymous 117aa46e9e cmdflashmemspiffs.c: allow dump from SPIFFS to trace buffer without saving to local fs 2023-12-27 00:00:01 -05:00
iceman1001 fb23d2047f reworked the JSON format for 14a, 14b, 15, cryptorf, lto, NDEF.\nDeprecated EML format. Pm3 client do not save EML files any more.nPm3 client will continue to load EML files. 2023-10-02 20:11:23 +02:00
iceman1001 32fcf5e870 make 16 bytes default cols 2023-05-27 17:00:28 +02:00
iceman1001 95d1631bed style 2022-03-23 18:22:03 +01:00
iceman1001 045f30d00d refactoring function to download file from spiffs 2022-03-12 18:57:06 +01:00
Philippe Teuwen 30aa7aa7d1 Adapting license headers, WIP 2022-01-08 00:40:52 +01:00
iceman1001 77f49c8efc text - unified 2022-01-01 09:39:05 +01:00
Philippe Teuwen 6a2f2b3979 rename global conn 2021-08-21 20:21:08 +02:00
Ray Lee 11afbdfba3 make style 2021-08-17 20:27:04 +08:00
Ray Lee d3232a5ebd rm stupid code 2021-08-17 20:23:31 +08:00
Ray Lee 5e22345111 work around 2021-08-17 18:15:15 +08:00
Ray Lee 0b01b060cf fix naming convertion messes up 2021-08-17 13:02:22 +08:00
iceman1001 007b916643 style 2021-04-08 11:08:39 +02:00
iceman1001 1b59b38058 fix coverity 314850, and textual changes 2021-04-05 08:47:03 +02:00
iceman1001 1b2091932e fix 'mem spiffs view' and bad file stats retrieval 2021-03-10 10:43:49 +01:00
iceman1001 ba79bb7b06 fix some missing command when printing helps/markdown 2021-03-09 16:09:36 +01:00
iceman1001 ad2b0879fc added: mem spiffs view - to view a file on SPIFFS\n mem spiffs dump - now uses cliparser and NG 2021-03-09 14:38:31 +01:00
iceman1001 02aabf90d3 mem spi mount/unmount/test/check/tree/info/remove/rename/wwipe - now uses cliparser. remove/rename uses NG 2021-03-08 17:39:21 +01:00
Philippe Teuwen 4ed57c7c4d make style 2020-08-13 12:25:04 +02:00
iceman1001 ccbfdf9e88 add: mem spiffs wipe 2020-08-08 12:33:12 +02:00
iceman1001 c99ed14c6e textual 2020-07-15 01:29:44 +02:00
iceman1001 091f9fb94c chg: adapt the eml block size based on filename 2020-07-14 23:11:44 +02:00
Philippe Teuwen 8bdda55115 Fix prompt colors in log -> spurious space in color macros -> adjust lots of files... 2020-04-22 02:22:55 +02:00
Bjoern Kerler 81bc0bc2b9 Reorder client src directories 2020-04-16 10:53:24 +02:00