Skip to main content
DAbba
Associate II
November 3, 2018
Solved

ST25R3911B SPI and ST25R3911B Discovery GUI has no commincatin

  • November 3, 2018
  • 23 replies
  • 4264 views

Hi everybody 

I am using st25r3911 in my own pcb and I still have a problem in the first step :

rfalInitialize() does not return ERR_NONE

in fact I see the MOSI and CLK and CS signal but there is not anything in MISO !!

pin28 in st25r3911b (mcu_clk) is ok so i think the chip is working .

    This topic has been closed for replies.
    Best answer by Ulysses HERNIOSUS

    Hi Dariush,

    can you measure the IRQ pin, if it is high when this condition occurs.

    Reading the STM8 reference manual I suspect that our code should be changed to:

    diff --git a/Firmware/nucleo/X-NUCLEO-NFC05A1/STM8/Project/stm8s_it.c b/Firmware/nucleo/X-NUCLEO-NFC05A1/STM8/Project/stm8s_it.c

    index 2a87cda..ddb5575 100644

    --- a/STM8/Project/stm8s_it.c

    +++ b/STM8/Project/stm8s_it.c

    @@ -129,7 +129,7 @@ INTERRUPT_HANDLER(EXTI_PORTA_IRQHandler, 3)

      */

     @svlreg INTERRUPT_HANDLER(EXTI_PORTB_IRQHandler, 4)

     {

    - if( (GPIO_ReadInputData(GPIOB) & GPIO_PIN_5) )

    + while( (GPIO_ReadInputData(GPIOB) & GPIO_PIN_5) )^M

        {

            st25r3911Isr();

        }

    @@ -513,4 +513,4 @@ INTERRUPT_HANDLER(EEPROM_EEC_IRQHandler, 24)

      */

    Please try and tell me the results of your investigation. Also I think it makes sense you start a new thread with a proper topic.

    Regards, Ulysses

    23 replies

    DAbba
    DAbbaAuthor
    Associate II
    November 4, 2018

    I think I have a problem in Setting up yet .

    I use ST25R3911B_DISCO_FW_v1_2_00 frimware as a sample code but my ST mcu is STM32F215 64PIN .

    i am not sure even my spi setting is ok or not :

     hspi2.Instance = SPI2;

     hspi2.Init.Mode = SPI_MODE_MASTER;

     hspi2.Init.Direction = SPI_DIRECTION_2LINES;

     hspi2.Init.DataSize = SPI_DATASIZE_8BIT;

     hspi2.Init.CLKPolarity = SPI_POLARITY_LOW;

     hspi2.Init.CLKPhase = SPI_PHASE_2EDGE;

     hspi2.Init.NSS = SPI_NSS_SOFT;

     hspi2.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_128;

     hspi2.Init.FirstBit = SPI_FIRSTBIT_MSB;

     hspi2.Init.TIMode = SPI_TIMODE_DISABLE;

     hspi2.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;

     hspi2.Init.CRCPolynomial = 7;

    by the above spi setting i have signlas in mosi and sck pins .

    but I am not sure they are ok .

    is there anyone to help me in my step now?

    DAbba
    DAbbaAuthor
    Associate II
    November 5, 2018

    now I find out that /cs pin is connected to Gnd in my pcb and I can not find its point .

    by the way be gnd for spi_cs is donot care and it has to work. am I right?

    or I have to fixed it at first ?

    Travis Palmer
    ST Employee
    November 5, 2018

    Dear Dariush,

    The !CS line is crucial for the SPI interface to work.

    Please crosscheck the schematic shown in UM2042 page 11, 12 (Usermanual of the ST25R3911B-DISCO available on www.st.com) with your schematic.

    The !CS line should be driven by the MCU and not tied to one potential.

    BR Travis

    DAbba
    DAbbaAuthor
    Associate II
    November 14, 2018

    My problem solved and now I have a SPI communication by st25r3911b .

    my new problems are :

    1- External interrupt pin does not changed at all , I think when i close a mifare card in its antenna is should change , am I right ?

    2- The ST25R3911B Discovery GUI program has no communication to it, I make a usb device for it and I am not sure in windows Device Manager what driver should add when ever I connect it to PC.0690X000006CN1KQAW.jpg

    any help would be welcome

    Travis Palmer
    ST Employee
    November 14, 2018

    ​Dear Dariush,

    1.)

    When enabeling the en and tx_en bit, do you see a signal on the RFO pins?

    When sending a direct command D3 (measure amplitude) to the ST25R3911B, an interrupt will be generated by the ST25R3911B afterwards. If you do not see any interrupt, i would recommend to check the following items:

    A.) Check resistance of IRQ line against VDD, VDD_IO, GND. (board disconnected, should be higher than 100k)

    B.) Probe with a scope the IRQ line during sending a D3 command.

    C.) Check voltage level of VDD_IO supply

    D.) Probe with a scope, if the OSC is working propperly when bit "en" is set.

    2.) When the ST25R3911B-DISCO board is connected you should be able to find a HID Device with HID\VID_0483&PID_3721&REV_0200&MI_00 .

    The driver is delivered by Microsoft / Windows. No additional installation needed.

    BR Travis

    DAbba
    DAbbaAuthor
    Associate II
    November 14, 2018

    Dear Travis,

    thanks for your reply

    during sending a direct command D3 I see an interrupt and it is OK , but is it possible to have an interrupt when ever I close a Mifare Tag to its antenna that now it dose not have an interrupt .

    Ulysses HERNIOSUS
    ST Technical Moderator
    November 14, 2018

    Hi Dariush,

    not sure I understand what you actually do to get an interrupt from ST25R3911B. Without communicating to ST25R3911B it will not do anything autonomously. You do have here two options:

    1. Normal operation mode: You enable oscillator, enable the field, and call proper methods (e.g. from our RFAL layer to send frames and receive response frames from the card - or
    2. you configure the ST25R3911B in wake-up mode where it autonomously runs a low power cycle in which it sends out short field pulses and senses detuning of the antenna. Please refer to AN4985.

    Regards, Ulysses

    DAbba
    DAbbaAuthor
    Associate II
    November 17, 2018

    Thank you

    about ST25R3911B Discovery GUI program , now I have hid device in my control panel and I am sure that driver is OK .

    but still I have no communication in usb :

    0690X000006CN1KQAW.jpg

     */
    int main(void)
    {
     /* USER CODE BEGIN 1 */
     
     /* USER CODE END 1 */
     
     /* MCU Configuration----------------------------------------------------------*/
     
     /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
     HAL_Init();
     
     /* USER CODE BEGIN Init */
     
     /* USER CODE END Init */
     
     /* Configure the system clock */
     SystemClock_Config();
     
     /* USER CODE BEGIN SysInit */
     
     /* USER CODE END SysInit */
     
     /* Initialize all configured peripherals */
     MX_GPIO_Init();
     MX_USART2_UART_Init();
     MX_USB_DEVICE_Init();
     MX_SPI2_Init();
     
     spiInit(&hspi2);
     /* USER CODE BEGIN 2 */
     logUsartInit(&huart2);
     logUsart("Welcome to DISCO-STM32L4x6\r\n");
     
     rfalAnalogConfigInitialize();
     logUsart("DARIUSH\r\n");
     if( rfalInitialize() == ERR_NONE )logUsart("rfalInitialize ok\r\n");
     
     else 	logUsart(" rfalInitialize error\r\n");
     /* USER CODE END 2 */
     StreamDispatcherInit();
     /* Infinite loop */
     /* USER CODE BEGIN WHILE */
     while (1)
     {
    	 rfalWorker();
    	 dispatcherInterruptHandler();
    	 ProcessIO();
    //aa++;
     
     /* USER CODE END WHILE */
     
     /* USER CODE BEGIN 3 */
     
     }
     /* USER CODE END 3 */
     
    }
     
    /**
     * @brief System Clock Configuration
     * @retval None
     */

    DAbba
    DAbbaAuthor
    Associate II
    November 17, 2018

    0690X000006COSqQAO.jpg0690X000006COSlQAO.jpgcould you please simply help me about it ?

    I am using stm32f4 discovery board and I made my own board in SPI connection to this board.

    can I send commands to it directly and select an is1443a card (for example)?

    I have also the same problem in ST25PC-NFC program0690X000006COTPQA4.jpg

    Ulysses HERNIOSUS
    ST Technical Moderator
    November 19, 2018

    Hi Dariush,

    The GUI uses USB VID and PID to identify the boards. Please carefully review the USB descriptors.

    Ulysses

    DAbba
    DAbbaAuthor
    Associate II
    November 19, 2018

    Dear Ulysses

    Thank you for your reply

    Would you please tell me more about that ?

    What I have to do in my own project ?