cancel
Showing results for 
Search instead for 
Did you mean: 

How to Modify RFAL Library for ST25R3918 Without ST25R3916_CMD_TEST_ACCESS Register

zeynepdicle
Associate III

I am using the ST25R3918 and the 'pollingTagDetect' example from the RFAL library. This chip does not have the ST25R3916_CMD_TEST_ACCESS register.

How can I modify this library?

This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
32 REPLIES 32

 

I didn't modify it, and I am using a 27.12 MHz crystal.

I cannot exceed the MS/s value. I installed extensions for STMicroelectronics - ST25R3916 (B) on Logic 2. I used it and added a capture in this link.

Hi;

the General Purpose Timer is started with a value of 2C38h i.e. 6.68 ms

BrianTIDAL_2-1696844638004.png BrianTIDAL_1-1696844618983.png

Therefore the GPT expires 6.68 ms after the E0h direct command:

 

BrianTIDAL_4-1696844926144.png

So, compared to the original code, the ST25R3916_TEST_TMR_TOUT has been modified.

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi @Brian TIDAL ,

How's it going? I hope everything is smooth on your end.

I'm still working on my tests, but I haven't reached a conclusion yet. Once again, I'd like to share my boards and code details. Perhaps we've missed some details that could help solve the problem.

I'm using our designed ST25R3918 with a single-ended antenna module, along with stm32f0discovery, stm32f4-discovery, and nucleo-l053r8 boards.

Here's how the system clock is configured:

SYSCLK: 32 MHz (tried different values)

HCLK: 32 MHz (tried different values)

SPI configuration is as follows:

SPI-1

SPI1_SCK: PA5

SPI1_MISO: PA6

SPI2_MOSI: PA7

Mode: Full-Duplex Master

Prescaler (for Baud Rate): 8 (tried different values)

Clock Polarity (CPOL): Low

Clock Phase (CPHA): 2 Edge

GPIO configuration looks like this:

IRQ: PA0 - External Interrupt Mode with Rising edge trigger detection

CS: PA4 - GPIO_OUTPUT (GPIO output level: Low)

I'm using the RFAL library, and I've made some changes. In the rfal_analogConfig_Tbl() function, I modified it like this:

 

MODE_ENTRY_17_REG((RFAL_ANALOG_CONFIG_TECH_CHIP | RFAL_ANALOG_CONFIG_CHIP_INIT), ST25R3916_REG_IO_CONF1, ( ST25R3916_REG_IO_CONF1_single |

ST25R3916_REG_IO_CONF1_rfo2 | ST25R3916_REG_IO_CONF1_out_cl_mask |

ST25R3916_REG_IO_CONF1_lf_clk_off), 0xc7);

Additionally, I made necessary settings in the platform.h file and added the st25r3918Isr() function in the EXTI_IRQHandler function in the stm32fxx_it.c file.

My main.c looks like this:

int main(void) {

HAL_Init();

SystemClock_Config();

MX_GPIO_Init();

MX_SPI1_Init();

spiInit(&hspi1);

rfalAnalogConfigInitialize();

rfalInitialize();

 ... 

While debugging in the #ifdef ST25_SELFTIMER_TIMER condition, after if (st25r3916WaitForInterruptsTimed(ST25R3916_IRQ_MASK_GPE, (ST25R3916_TEST_TMR_TOUT - ST25R3916_TEST_TMR_TOUT_DELTA)) != 0U), it goes to platformErrorHandle(). The st25r3916WaitForInterruptsTimed function is returning the value 0x2000.

I suspect it might be a clock configuration issue, but I can't seem to solve it. Any thoughts?

Best regards,

ZD

Hi, 

if the returned value is 0x200 (=I_cat) then there is a serious problem in SPI. The expected values is 0x2000 (I_gpe).

BR, Ulysses

Hi, 
I wrong wrote that I am sorry. The returned value is 0x2000
BR, ZD

I propose to look into the findings from Brian: The value written into GPT registers is incorrect. Where does it come from?

ST25R3916_TEST_TMR_TOUT should be 20ms, ST25R3916_TEST_TMR_TOUT_8FC should then be 33900/0x846c.

BR, Ulysses

I didn't modify on library Capture.PNG

Hi again,
I bought a NUCLEO-L476RG. I am using this board.

Now I noticed that when I'm debugging step by step, it goes to the same errorHandler. However, when I added a breakpoint after this errorHandler, the debug process continues successfully, and it finishes initializing.

Hi,

debugging the selftest step by step will likely cause an error as the debugger only halts the MCU but not the ST25R device. 

If you still have an issue during initialization and selftest, I may be caused by a buffer or stack overflow in your application. Check the stack size. You can as well enable the stack protection (e.g. -fstack-protector with keil or gcc compiler).

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi @Brian TIDAL  @Ulysses HERNIOSUS 

I figured out. I am so grateful your helps. Thank you so much :folded_hands: