2018-11-03 07:09 AM
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 .
Solved! Go to Solution.
2018-11-26 04:37 AM
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
2018-11-04 06:21 AM
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?
2018-11-05 02:56 AM
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 ?
2018-11-05 04:51 AM
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
2018-11-13 10:49 PM
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.
any help would be welcome
2018-11-14 12:25 AM
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
2018-11-14 03:56 AM
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 .
2018-11-14 07:22 AM
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:
Regards, Ulysses
2018-11-16 11:34 PM
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 :
*/
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
*/
2018-11-17 12:12 AM