Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After exploring more deeply with @MageDelfador the use of printable log format, I've come to the conclusion that with the limitation of RevE hardware it is much better to manage log in binary format on chameleon.
The use of a bigger buffer is still required to avoid a card's reset, due to slow SPI write and conseguent timeout during communication with the reader.
The new log implementation uses commands compatible with the RevG implementation, but not all RevG's commands have been implemented (no LOGMODE and no STORELOG).
Optional
00016/02827: [00013] R | IDLE | 26
00022/02827: [00013] T | READY | 0400
00029/02827: [00014] R | READY | 9320
00036/02827: [00014] T | READY | FFFFFFFF00
00046/02827: [00016] R | READY | 9370FFFFFFFF0027D0
00060/02827: [00016] T | ACTIVE | 08B6DD
00068/02827: [00032] R | ACTIVE | 500057CD
00077/02827: [00032] T | HALT |
00082/02827: [00038] R | HALT | 52
00088/02827: [00038] T | READY | 0400
00095/02827: [00039] R | READY | 9370FFFFFFFF002750
00109/02827: [00040] T | ACTIVE | 08B6DD
00117/02827: [00048] R | ACTIVE | 500057CD
00126/02827: [00048] T | HALT |
The main goal of the logging function is the reader's analysis, so to reduce the card reset due to SPI write, I've implemented a dynamic trim function for tag data in the log. This function requires some space so it's also a compile option. There are 3 trim levels triggered by consecutive buffer flush due to fullfilment:
To parse the downloaded binary log file I've also added the code of a simple parser under Software/LogParser with a sample.
The binary log format is very simple and has been reduced to contain the minimal overhead to be parseable:
Header
Record
To get enough space to play with logs, I had to move the previous commands about WorkingMemory in a compile option that can be disabled to save space for log functions.