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_EEPROM sample write does not take effect on NUCLEO-L433RC-P + X-NUCLEO-NFC04A1 #119

Open
Arachnid opened this issue Jan 11, 2022 · 4 comments

Comments

@Arachnid
Copy link

Description of defect

After building the NFC_EEPROM sample for the Nucleo-L433RC-P dev board with the Nucleo-NFC04A1 expansion, the sample compiles and runs, but while it claims to successfully write a message, the message in the EEPROM is not modified.

The following was added to mbed_app.json in target_overrides:

        "NUCLEO_L433RC_P": {
            "target.extra_labels_add": ["ST25DV"],

After compiling and flashing, the following output is observed:

Building an ndef message
message written successfully
Received an ndef message of size 20
message read successfully

However, the message when read by a smartphone remains unchanged - and no matter the URL set in the source, the length read back is always 20.

Target(s) affected by this defect ?

NUCLEO-L433RC-P + X-NUCLEO-NFC04A1

Toolchain(s) (name and version) displaying this defect ?

Arm Compiler 6

What version of Mbed-os are you using (tag or sha) ?

6.15.1

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

None

How is this defect reproduced ?

  1. Download this repository and open it as a workspace in Mbed Studio
  2. Select the NFC_EEPROM project as active
  3. Make the changes described above to mbed_app.json
  4. Compile and run the app.
@Arachnid
Copy link
Author

I've captured a trace of I2C bus activity with my 'scope, starting at the point where build_ndef_message returns:

"Tektronix MDO3034, version v1.14, serial number C016322"
"Bus Definition: I2C"
 Time, Repeat Start, Direction, Address, Data, Missing Ack
3.008000e-05,  , Write, 53, 20 03,  
1.221880e-04,  , Read, 53, 00,  
1.961280e-04,  , Write, 53, 20 03,  
3.646720e-04,  , Write, 57, 00 14,  
4.570400e-04,  , Read, 57, 7F,  
5.293840e-04,  , Write, 57, 00 15,  
6.543360e-04,  , Read, 57, 00,  
7.270080e-04,  , Write, 57, 00 16,  
8.193040e-04,  , Read, 57, 03,  
8.938560e-04,  , Write, 53, 00 00,  
9.862320e-04,  , Read, 53, E1 40 40 00,  
1.121664e-03,  , Write, 53, 00 04,  
1.214084e-03,  , Read, 53, 03 14 D1 01,  
1.350696e-03,  , Write, 53, 00 04,  
1.498520e-03,  , Write, 53,,  
1.661860e-03,  , Write, 53, 00 06,  
1.794940e-03,  , Write, 53,,  
1.869776e-03,  , Write, 53, 00 0F,  
2.002596e-03,  , Write, 53,,  
2.175912e-03,  , Write, 53, 20 03,  
2.268072e-03,  , Read, 53, 00,  
2.341896e-03,  , Write, 53, 20 03,  

3.183078e-02,  , Write, 53, 20 03,  
3.192303e-02,  , Read, 53, 00,  
3.199685e-02,  , Write, 53, 20 03,  
3.216452e-02,  , Write, 53, 00 00,  
3.225686e-02,  , Read, 53, E1 40 40 00,  
3.239296e-02,  , Write, 53, 00 04,  
3.248575e-02,  , Read, 53, 03 14 D1 01,  
3.262183e-02,  , Write, 53, 00 04,  
3.271393e-02,  , Read, 53, 03 14 D1 01,  
3.294784e-02,  , Write, 53, 00 00,  
3.303974e-02,  , Read, 53, E1 40 40 00,  
3.317590e-02,  , Write, 53, 00 04,  
3.326878e-02,  , Read, 53, 03 14 D1 01,  
3.340414e-02,  , Write, 53, 00 04,  
3.349654e-02,  , Read, 53, 03 14 D1 01,  
3.363666e-02,  , Write, 53, 00 06,  
3.372966e-02,  , Read, 53, D1 01 10 55 04 73 68 69 62 62 6F 6C 65 74 68 2E 6C 69 6E 6B,  
3.428787e-02,  , Write, 53, 20 03,  
3.438080e-02,  , Read, 53, 00,  
3.445467e-02,  , Write, 53, 20 03,  

I've inserted a linebreak between the set of operations triggered by write_ndef_message and those triggered by read_ndef_message. As you can see, it's not actually writing the NDEF data in the first section; in fact at 1.350696e-03 you can see that it writes the address where the NDEF data should go to the EEPROM, then writes 0 bytes of data.

I've not yet been able to track down where in the code this is happening, but this shows it's definitely an issue with the code.

@Arachnid
Copy link
Author

Using the debugger, I'm able to get as far as the HAL interface with the correct data present for a write - so it seems like this may be some kind of HAL/driver issue? I'm not sure where to go from here, although at this point it's probably not related to this particular example project.

@Arachnid
Copy link
Author

I am able to write to the EEPROM using the lower-level I2C library, however - so not a hardware or lower level HAL issue.

@saffetblt
Copy link

Hello, I can write NDEF messages to the M24SR integration using this project. The device I am developing needs to run at very low power consumption. The NFC integrated itself consumes power at a very micro-ampere level. But when I activate the library, the power consumption rises to around 3.16mA. There seems to be an issue with the I2C line shutting down. Have you had any experience with this subject?

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

No branches or pull requests

2 participants