Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFC] Protocol st25tb write data 0 at block when not initialized #4045

Open
yashikada opened this issue Dec 24, 2024 · 0 comments
Open

[NFC] Protocol st25tb write data 0 at block when not initialized #4045

yashikada opened this issue Dec 24, 2024 · 0 comments

Comments

@yashikada
Copy link

yashikada commented Dec 24, 2024

Describe the bug.

I'm developing a simple app for read tag ST25TB, after I started the poller with callback function where the NfcCommand is always Continue and no events are managed, start a write at block 0 with data 0x000000.
In that device block 0x0 is OTP so is irrecoverable unless you use a sequence of commands to reset the OTP area to the value 0xFFFFFFFF.

In file lib/nfc/protocols/st25tb/st25tb_poller.c function st25tb_poller_request_mode_handler should be check also the mode St25tbPollerModeWrite and don't assume it's Write if it's not Read.
In my test code the value of variable st25tb_event->data->mode_request.mode is 4, which means no mode, but everything that is not Read is automatically Write. So start a write which is never requested.

Reproduction

  1. develope an example NFC app which use St25Poller
  2. compile
  3. run
  4. put a tag ST25TB under FZ
  5. verify if the block 0 is written to 0x000000, you can see also in log debug

Target

No response

Logs

84872 [D][Nfc] FWT Timeout
84883 [D][ST25TBPoller] Read_block(0) result: 00000000
84886 [D][ST25TBPoller] wrote 00000000 to block 0

Anything else?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant