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

    Ulysses HERNIOSUS
    ST Technical Moderator
    November 19, 2018

    usbd_desc.c

    DAbba
    DAbbaAuthor
    Associate II
    November 20, 2018

    Dear Ulysses

    I have compared mu usbd_desc.c in my project to ST25R3911B_DISCO_FW_v1_2_00 , it seems the same !

    Ulysses HERNIOSUS
    ST Technical Moderator
    November 20, 2018

    Hi Dariush,

    with your changes I expect that the GUI has slightly changed its behavior - it should now detect a board. If not the please check VID and PID as they appear in the DeviceManager -> Hardware Ids.

    Probably communication will then break. Getting a USB communication to work is somewhat tedious work. You will also need to review usbd_customhid.c inside STM32_USB_Device_Library.

    It may also be necessary for you to get a USB tool to analyze on the PC side any differences in the USB descriptors which the PC sees.

    Regards, Ulysses.

    DAbba
    DAbbaAuthor
    Associate II
    November 20, 2018

    Thanks a lot for your attention .

    I have done everything , but still I have problem :0690X000006CP9QQAW.jpg0690X000006CP9LQAW.jpg0690X000006CP9GQAW.jpg

    could you please help me more to fix it ?

    I have tried it by another PC also

    Ulysses HERNIOSUS
    ST Technical Moderator
    November 21, 2018

    Hi Dariush,

    porting USB is effort. You will need to debug using various techniques (USB traces, debugger on the firmware, maybe debugger on the PC) the communication. What the firmware tries to send, what ends up on the PC, if the descriptors are similar/the same, etc.

    I gave you all the tips I have.

    Regards, Ulysses

    DAbba
    DAbbaAuthor
    Associate II
    November 21, 2018

    I really appreciate you for your attention ,Ulysses

    I decided to not try to it more .

    but can I check the st25r3911b directly (without usb) in my code ?

    I mean read an iso1443a card or ..

    It seems difficult to do it directly in ST25R3911B_DISCO_FW_v1_2_00 functions and I could not find out a solution for it.

      Best Regards, Dariush

    Ulysses HERNIOSUS
    ST Technical Moderator
    November 21, 2018

    Hi Dariush,

    for actually developing your own firmware you should have a look at xnucleo-nfc05a1 and X-CUBE-NFC5. This firmware is limited to NFC communication only and should give you all necessary hints.

    Also in the firmware package you got you should find and rfal.chm with some explanations.

    Ulysses

    DAbba
    DAbbaAuthor
    Associate II
    November 24, 2018

    Dear Ulysses

    Thank you again ,

    In stm8_nfc05 I have a problem :

    it can not pass the loop :

     ReturnCode ret;
     
     do{
     rfalWorker();
     }
     while( ((ret = rfalGetTransceiveStatus() ) == ERR_BUSY) && rfalIsTransceiveInTx() );

    and gRFAL.state is all the time RFAL_STATE_TXRX

    if you have an idea that can help me , I will appreciate you.

    I think for me iso1443a will be esaier to start ( I am a newer in this issue)

    is there any simple code to find out that a card (for example a Mifare ) is in the antenna vicinity or not at the moment?

    Ulysses HERNIOSUS
    ST Technical Moderator
    November 26, 2018

    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

    DAbba
    DAbbaAuthor
    Associate II
    December 1, 2018

    Finally I did it, I have communication by USB to ST25R3911B Discovery GUI now.

    0690X000006CZ2ZQAW.jpgnow I have a new problem .

    despite the fact that I am sure that there is noting in the antenna field , I always see this message when I use calibrate antenna button.

    what is wrong in my antenna and how I can fix it ?

    I have made my own antenna circuit similar to st25r3911_dico_mb1325 .

    Ulysses HERNIOSUS
    ST Technical Moderator
    December 3, 2018

    Hi Dariush,

    the chip-interal antenna tuning algorithm requires to be able to find a phase close to the target phase of 90deg. It seems your antenna is off in this respect. Please have a look at the proper app notes: AN4974 and AN4914.

    Regards, Ulysses

    Travis Palmer
    ST Employee
    December 6, 2018

    ​Hi Dariush,

    This means, that you are trying to use AAT, but the algorithm was not sucessfull.

    This can either mean, that you try using AAT but the lines are not connected (if you opened J406 and/or J407) or that your antenna is too much detuned and AAT cannot optimize your tuning further.

    If you have disconnected AAT via J406 and J407 simply do not execute Calibrate antenna.

    In the other case if the tuning seems not to be at the right spot. I recommend you to remove any metal from the suronding and try again. If this does not help, measure the matching network using a VNA.

    Please keep in mind, if you are attaching a VNA to the board that the board should be either not powered or the driver has been put to high-Z state by setting Register 27h to 0xFF. Otherwise your VNA could be damaged.

    Guidance about finding the right matching impedance can be found in the antenna design appnote on st.com.

    BR Travis