cancel
Showing results for 
Search instead for 
Did you mean: 

declaration of BSP_SPI1_IRQ_Callback() in FreeRTOS_polling

DSai.1
Associate III

about declaration of BSP_SPI1_IRQ_Callback() in ST25NFC_Embedded_Lib_ST25R3916_1.4.0\Projects\STM32L476RG-Nucleo\Applications\X-NUCLEO-NFC06A1\FreeRTOS_polling

Dear Sir,

I am check the process flow of sample program which use FreeTROS.

I found that the function BSP_SPI1_IRQ_Callback() is declared in two place,

one is in nucleo_l476rg_bus.c, another is in plf_adaptation.c .

Could you tell me which one is used in this demo sample?

Also, in this sample code, st25r3916Isr() is called in two different place.

one is in

----------------------------------------

void nfcIsrTaskRunner(void *argument)

{

 /* Infinite loop */

 for(;;)

 {

   ulTaskNotifyTake( pdTRUE, portMAX_DELAY );       /* Check if IRQ happen execute immediately, otherwise other execute Task meanwhile */

   st25r3916Isr();                     /* ISR called from main task avoid calling vTaskSuspendAll from ISR (SPI) - NFC IRQ pin is anyhow checked */

   xSemaphoreGive(platformSem);

 }

}

-------------------------------------------------------

another is in

--------------------------------------

__weak void BSP_SPI1_IRQ_Callback(void)

{

 /* Prevent unused argument(s) compilation warning */

  

 /* This function should be implemented by the user application.

  * It is called into this driver when an event from ST25R3916 is triggered. 

  */

 st25r3916Isr();

}

---------------------------------------

Are there two manners used in this demo? What are the main differences for them?

Best regards

Dai Sai

22 REPLIES 22
DSai.1
Associate III

Dear Brian,

After a sunny weekend holiday in beach, I tried to solve the problem on this week.

Here is a good news! The demo program can read UID and single block correctly.

It is a great step for these porting days. Thank you so much for your great help!.

There is a issue I found this morning.

There is no problem to read one block with

err = rfalNfcvPollerReadSingleBlock(reqFlag, uid, blockNum, rxBuf, sizeof(rxBuf), &rcvLen);

and err is NON_ERROR(0).

But, when I try to read multiple blocks (2 blocks for test ) with

err = rfalNfcvPollerReadMultipleBlocks(reqFlag, uid, 0, blockNum, rxBuf, sizeof(rxBuf), &rcvLen);

and err is ERR_CRC(21).

In debug mode, I found the two blocks data in buffer rxBuf are correct, but return code is 21,

meaning CRC error.

Based on RFAL code, the above two function call the following function in RFAL driver.

rfalNfcvPollerTransceiveReq()

and

ret = rfalTransceiveBlockingTxRx( (uint8_t*)&req, (RFAL_NFCV_CMD_LEN + RFAL_NFCV_FLAG_LEN +(uint16_t)msgIt), rxBuf, rxBufLen, rcvLen, RFAL_TXRX_FLAGS_DEFAULT, (specialFrame ? RFAL_NFCV_FDT_EOF : RFAL_NFCV_FDT_MAX) );

Would you like to give me any hint for this CRC error issue?

Best regards

Dai Sai

Brian TIDAL
ST Employee

Hi,

As the initial issue described in this post is fully solved, I would suggest to create a new post dedicated to the CRC issue on Read Multiple Block. I would recommend as well to share information about the tag manufacturer and tag model. Make sure to define a big enough rxBuf (should 1 byte for response flag + 2 bytes for CRC + blockSize * number of requested blocks). Note that the CRC is present in the buffer after the data. Also, blockNum should be 1 when requesting to read 2 blocks.

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.
DSai.1
Associate III

Dear Brian,

I modified blockNum value based on your suggestion, and CRC error disappeared.

up to 20 blocks reading succeed. I am so glad to get the goal.

thank you very much for your great help.

Next stage, we will port driver for VL53L1X, in our project, we use double VL53L1X.

best regards

Dai Sai