cancel
Showing results for 
Search instead for 
Did you mean: 

ST25R3911B NFC-RFAL analogConfigs missing?

JDene.1
Associate

I'm trying to port the NFC-RFAL library to a smaller Arduino based MCU. I need an extremely minimal setup for retrieving UIDs from ISO15693 tags, so I'm getting rid of 50-80% of the state machines and structures, the whole analogConfig module, maybe anti-collision if I can, etc.

In the library, we often call rfalSetAnalogConfig() to set a bunch of registers using a look-up table. Here's a list of calls I might need that I found, scattered across the library.

rfalSetAnalogConfig((RFAL_ANALOG_CONFIG_TECH_CHIP | RFAL_ANALOG_CONFIG_CHIP_INIT));
rfalSetAnalogConfig((RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCV | RFAL_ANALOG_CONFIG_BITRATE_COMMON | RFAL_ANALOG_CONFIG_TX));
rfalSetAnalogConfig((RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCV | RFAL_ANALOG_CONFIG_BITRATE_COMMON | RFAL_ANALOG_CONFIG_RX));
rfalSetAnalogConfig((RFAL_ANALOG_CONFIG_TECH_CHIP | RFAL_ANALOG_CONFIG_CHIP_POLL_COMMON));
rfalSetAnalogConfig((rfalAnalogConfigId)(RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCV | rfalConvBR2ACBR(RFAL_BR_26p48) | RFAL_ANALOG_CONFIG_TX));
rfalSetAnalogConfig((rfalAnalogConfigId)(RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCV | rfalConvBR2ACBR(RFAL_BR_26p48) | RFAL_ANALOG_CONFIG_RX));
rfalSetAnalogConfig((RFAL_ANALOG_CONFIG_TECH_CHIP | RFAL_ANALOG_CONFIG_CHIP_FIELD_ON));
rfalSetAnalogConfig((RFAL_ANALOG_CONFIG_TECH_CHIP | RFAL_ANALOG_CONFIG_CHIP_FIELD_OFF));

I'm currently looking to get rid of the 3 analogConfig files, and replace every call to rfalSetAnalogConfig() by its corresponding calls of st25r3911ChangeRegisterBits() instead.

Here's where I'm blocked. The first line makes 10 st25r3911ChangeRegisterBits() calls, the second line makes 1, the third makes 4, but the last 5 lines don't make any call at all! rfalSetAnalogConfig() can't find any entry inside its look-up table, located in rfal_rfst25r3911_analogConfigTbl.h. This means calls that looks important (like when you change the bit rate, of want to turn the field ON/OFF) don't do anything at all.

Is this supposed to be expected behaviour? The library and example are supposed to be compatible... and I can't test them because I don't have the hardware.

Also, I read that rfal_rfst25r3911_analogConfigTbl.h is externally generated. Can I generate my missing configs? Am I missing a tool?

SETUP :

Arduino WiFi Rev2 (Atmega4809)

X-NUCLEO-NFC05A1 (st25r3911b reader)

A custom shield in between to remap incompatible pins

Icode SLIX SL2S2002_SL2S2102 tags (ISO15693/NFCV)

No STM32 boards :(

RFAL version 2.0.10

current rfal_rfst25r3911_analogConfigTbl.h as an attachment

1 ACCEPTED SOLUTION

Accepted Solutions

Hi JDene.1,

ad 1) Dyamic config tab is available on GUI even without a board connected.

ad 2) + 3) As explained it is expected that some of the modes one could configure are left empty currently. If you see them doing nothing then removing them does not hurt for the time being. Our software is build in a way that one could put something in there if required.

Regards, Ulysses

View solution in original post

3 REPLIES 3
Ulysses HERNIOSUS
ST Employee

Hello,

this file is not externally generated. The comment just suppresses findings from static analysis around the signature of the array I think around flexible arrays which is needed in case this is generated.

You can use our GUIs to retrieve that file from the DISCO firmware and play with it in the GUI. The then generated one will be more of a pure byte array.

Analog configs are a method to allow to change registers for certain operation modes. The registers touched there are often related to analog performance and offer possibility to change without recompiling the code. Of course it is not always needed to change the registers. One reason is that for NFC-V the ST25R39 readers only support 26kbps whereas NFC-A support 106,212,424 and 848.

Best Regards, Ulysses

JDene.1
Associate

Hi Ulysses,

1- I tried the GUI, but unfortunately, I don't have a compatible STM32 MCU. Everything is grey'd out, but anyway, I don't think it's gonna be necessary

2- Looking deeper into the code, it looks like most registers I can think of end up in the state I expect them to be : rfalSetMode() calls rfalSetAnalogConfigDebug() with RFAL_ANALOG_CONFIG_BITRATE_COMMON. Then, rfalSetBitRate() calls rfalSetAnalogConfigDebug() with rfalConvBR2ACBR(RFAL_BR_26p48) instead, which does nothing. I'm commenting it out. Then, st25r3911StreamConfigure() deals with the rest. I get my 424 kHz single-sub carrier, 26.48 kbps, etc. Everything looks fine for this set of register configs.

3- What about these 5?

rfalSetAnalogConfigDebug((RFAL_ANALOG_CONFIG_TECH_CHIP | RFAL_ANALOG_CONFIG_CHIP_FIELD_ON));
  rfalSetAnalogConfigDebug((RFAL_ANALOG_CONFIG_TECH_CHIP | RFAL_ANALOG_CONFIG_CHIP_FIELD_OFF));
  rfalSetAnalogConfigDebug((RFAL_ANALOG_CONFIG_TECH_CHIP | RFAL_ANALOG_CONFIG_CHIP_WAKEUP_ON));
  rfalSetAnalogConfigDebug((RFAL_ANALOG_CONFIG_TECH_CHIP | RFAL_ANALOG_CONFIG_CHIP_WAKEUP_OFF));
  rfalSetAnalogConfigDebug((RFAL_ANALOG_CONFIG_TECH_CHIP | RFAL_ANALOG_CONFIG_CHIP_POLL_COMMON));

All of these exit before doing anything, and that just feels off to me... I just need an extra confirmation that this is expected behaviour and that I can comment them out

Thanks

Hi JDene.1,

ad 1) Dyamic config tab is available on GUI even without a board connected.

ad 2) + 3) As explained it is expected that some of the modes one could configure are left empty currently. If you see them doing nothing then removing them does not hurt for the time being. Our software is build in a way that one could put something in there if required.

Regards, Ulysses