Skip to content

Usage of driver to write/read tags #4

@ghost2303

Description

@ghost2303

Hi,

I know it's been a long time you worked on this code.
I use your code, because I want to use an ATMEGA328.

I have the following problem:
I want to write data to the tag, therefore, I need to authenticate in the first step.
As I understood your code, I have to use the command "mfrc522_to_card()" to authenticate and transceive data to/from tags (MIFARE tag).

Here's a simplified part how I do it:
{
// {authentification for key A, authenticate block 8, 6 bytes public key A, 4 bytes UID}
uint8_t auth_data[] = {PICC_AUTHENT1A, 0x08, 0xd3, 0xf7, 0xd3, 0xf7, 0xd3, 0xf7, 0xb9, 0xa0, 0xfd, 0xb8};
uint8_t auth_data_len = sizeof(auth_data);

// dummy for return data:
uint8_t data_return_block[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
uint32_t* data_return_size = sizeof(data_return_block);

// authenticate block:
uint8_t ret2 = mfrc522_to_card(MFAuthent_CMD, &auth_data[0], auth_data_len, &data_return_block[0], &data_return_size);
}

ret2 always returns value of ERROR (0x03). Public key and UID were read out using an app on my smartphone, so they should be ok.

Have you ever tried reading, writing, or at least authenticate the tag?
Do you remember any issues using this sequence?

I would appreciate if you would take some minutes of your time to help me with this issue.

Many thanks in advance!

BR, Thomas

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions