2023-09-28 04:53 AM
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?
Solved! Go to Solution.
2023-10-09 02:10 AM
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.
2023-10-09 02:51 AM
Hi;
the General Purpose Timer is started with a value of 2C38h i.e. 6.68 ms
Therefore the GPT expires 6.68 ms after the E0h direct command:
So, compared to the original code, the ST25R3916_TEST_TMR_TOUT has been modified.
Rgds
BT
2023-10-30 03:35 AM - edited 2023-10-30 07:38 AM
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
2023-10-30 07:10 AM
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
2023-10-30 07:35 AM - edited 2023-10-30 07:38 AM
Hi,
I wrong wrote that I am sorry. The returned value is 0x2000
BR, ZD
2023-10-30 09:21 AM
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
2023-11-01 11:23 PM
I didn't modify on library
2023-11-02 12:52 AM
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.
2023-11-02 09:58 AM
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
2023-11-03 04:50 AM
Hi @Brian TIDAL @Ulysses HERNIOSUS
I figured out. I am so grateful your helps. Thank you so much :folded_hands: