cancel
Showing results for 
Search instead for 
Did you mean: 

I want to send the ST25R3916B nfc tag readings to CAN bus.

NAkku.1
Associate III

I have program for CAN bus and NFC08a1 but when i combine i get several errors. All i want to do is get the reading from the nfc reader and send them on can. does anyone know how to do that?

35 REPLIES 35

I did put the analyzer and nothing on it. Only enable disable for spi.

int main(void)
{
  /* USER CODE BEGIN 1 */
//	char uart_buf[50];
//	int uart_buf_len;
//	char spi_buf[20];
  /* 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_DMA_Init();
//  MX_I2C1_Init();
  MX_SPI1_Init();
  /* USER CODE BEGIN 2 */
  NFC08A1_LED_Init();
  BSP_PB_Init(BUTTON_USER, BUTTON_MODE_GPIO);
  MX_SPI1_Init();
  MX_USART2_UART_Init();
 
 
  /* USER CODE END 2 */
 
  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
 
 
	  demoCycle();
 
  }
}

Brian TIDAL
ST Employee

Hi,

obviously, demoIni in missing in your main.c in  /* USER CODE BEGIN 2 */, as well as logUsartInit. MX_SPI1_Init() is called twice.

As it seems you have regenerated the project from STM32CubeMX, I would suggest you follow the tutorial from https://community.st.com/s/question/0D53W00001Px5sKSAR/how-to-create-a-project-with-x-cube-nfc06, in particular make sure to add  st25r3916Isr() in EXTI0_IRQHandler

Once demoIni has been added, put a breakpoint in st25r3916Initialize and check the return code.

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.

I followed everything on the link but now i am getting these errors.

In file included from ../Drivers/library files/BSP/Components/ST25R3916/st25r3916.h:28,

         from ../Drivers/library files/BSP/Components/ST25R3916/st25r3916.c:25:

../Drivers/library files/BSP/Components/ST25R3916/st25r3916.c: In function 'st25r3916Initialize':

../Core/Inc/platform.h:131:54: warning: statement with no effect [-Wunused-value]

 131 | #define platformErrorHandle()            Error_Handler      /*!< Global error handler or trap        */

   |                           ^~~~~~~~~~~~~

../Drivers/library files/BSP/Components/ST25R3916/st25r3916.c:140:9: note: in expansion of macro 'platformErrorHandle'

 140 |     platformErrorHandle();

   |     ^~~~~~~~~~~~~~~~~~~

../Core/Inc/platform.h:131:54: warning: statement with no effect [-Wunused-value]

 131 | #define platformErrorHandle()            Error_Handler      /*!< Global error handler or trap        */

   |                           ^~~~~~~~~~~~~

../Drivers/library files/BSP/Components/ST25R3916/st25r3916.c:200:9: note: in expansion of macro 'platformErrorHandle'

 200 |     platformErrorHandle();

   |     ^~~~~~~~~~~~~~~~~~~

../Drivers/library files/BSP/Components/ST25R3916/st25r3916.c:207:42: error: 'ST25R3916_CMD_RC_CAL' undeclared (first use in this function); did you mean 'ST25R3916_CMD_STOP'?

 207 |   st25r3916ExecuteCommandAndGetResult( ST25R3916_CMD_RC_CAL, ST25R3916_REG_AWS_RC_CAL, ST25R3916_TOUT_CALIBRATE_AWS_RC, NULL );

   |                     ^~~~~~~~~~~~~~~~~~~~

   |                     ST25R3916_CMD_STOP

../Drivers/library files/BSP/Components/ST25R3916/st25r3916.c:207:42: note: each undeclared identifier is reported only once for each function it appears in

../Drivers/library files/BSP/Components/ST25R3916/st25r3916.c:207:65: error: 'ST25R3916_REG_AWS_RC_CAL' undeclared (first use in this function); did you mean 'ST25R3916_REG_P2P_RX_CONF'?

 207 |   st25r3916ExecuteCommandAndGetResult( ST25R3916_CMD_RC_CAL, ST25R3916_REG_AWS_RC_CAL, ST25R3916_TOUT_CALIBRATE_AWS_RC, NULL );

   |                                 ^~~~~~~~~~~~~~~~~~~~~~~~

   |                                 ST25R3916_REG_P2P_RX_CONF

../Drivers/library files/BSP/Components/ST25R3916/st25r3916.c: In function 'st25r3916GetRegsDump':

../Drivers/library files/BSP/Components/ST25R3916/st25r3916.c:709:28: error: 'ST25R3916_REG_AWS_CONF1' undeclared (first use in this function); did you mean 'ST25R3916_REG_IO_CONF1'?

 709 |   st25r3916ReadRegister( ST25R3916_REG_AWS_CONF1, &regDump->RsB[regIt++] );

   |              ^~~~~~~~~~~~~~~~~~~~~~~

   |              ST25R3916_REG_IO_CONF1

../Drivers/library files/BSP/Components/ST25R3916/st25r3916.c:710:28: error: 'ST25R3916_REG_AWS_CONF2' undeclared (first use in this function); did you mean 'ST25R3916_REG_RX_CONF2'?

 710 |   st25r3916ReadRegister( ST25R3916_REG_AWS_CONF2, &regDump->RsB[regIt++] );

   |              ^~~~~~~~~~~~~~~~~~~~~~~

   |              ST25R3916_REG_RX_CONF2

../Drivers/library files/BSP/Components/ST25R3916/st25r3916.c:719:28: error: 'ST25R3916_REG_AWS_TIME1' undeclared (first use in this function); did you mean 'ST25R3916_REG_AUX_MOD'?

 719 |   st25r3916ReadRegister( ST25R3916_REG_AWS_TIME1,  &regDump->RsB[regIt++] );

   |              ^~~~~~~~~~~~~~~~~~~~~~~

   |              ST25R3916_REG_AUX_MOD

../Drivers/library files/BSP/Components/ST25R3916/st25r3916.c:720:28: error: 'ST25R3916_REG_AWS_TIME2' undeclared (first use in this function); did you mean 'ST25R3916_REG_AUX_MOD'?

 720 |   st25r3916ReadRegister( ST25R3916_REG_AWS_TIME2,  &regDump->RsB[regIt++] );

   |              ^~~~~~~~~~~~~~~~~~~~~~~

   |              ST25R3916_REG_AUX_MOD

../Drivers/library files/BSP/Components/ST25R3916/st25r3916.c:721:28: error: 'ST25R3916_REG_AWS_TIME3' undeclared (first use in this function); did you mean 'ST25R3916_REG_AUX_MOD'?

 721 |   st25r3916ReadRegister( ST25R3916_REG_AWS_TIME3,  &regDump->RsB[regIt++] );

   |              ^~~~~~~~~~~~~~~~~~~~~~~

   |              ST25R3916_REG_AUX_MOD

../Drivers/library files/BSP/Components/ST25R3916/st25r3916.c:722:28: error: 'ST25R3916_REG_AWS_TIME4' undeclared (first use in this function); did you mean 'ST25R3916_REG_AUX_MOD'?

 722 |   st25r3916ReadRegister( ST25R3916_REG_AWS_TIME4,  &regDump->RsB[regIt++] );

   |              ^~~~~~~~~~~~~~~~~~~~~~~

   |              ST25R3916_REG_AUX_MOD

../Drivers/library files/BSP/Components/ST25R3916/st25r3916.c:723:28: error: 'ST25R3916_REG_AWS_TIME5' undeclared (first use in this function); did you mean 'ST25R3916_REG_AUX_MOD'?

 723 |   st25r3916ReadRegister( ST25R3916_REG_AWS_TIME5,  &regDump->RsB[regIt++] );

   |              ^~~~~~~~~~~~~~~~~~~~~~~

   |              ST25R3916_REG_AUX_MOD

../Drivers/library files/BSP/Components/ST25R3916/st25r3916.c:724:28: error: 'ST25R3916_REG_AWS_RC_CAL' undeclared (first use in this function); did you mean 'ST25R3916_REG_P2P_RX_CONF'?

 724 |   st25r3916ReadRegister( ST25R3916_REG_AWS_RC_CAL, &regDump->RsB[regIt++] );

   |              ^~~~~~~~~~~~~~~~~~~~~~~~

   |              ST25R3916_REG_P2P_RX_CONF

../Drivers/library files/BSP/Components/ST25R3916/st25r3916.c: In function 'st25r3916IsCmdValid':

../Drivers/library files/BSP/Components/ST25R3916/st25r3916.c:740:17: error: 'ST25R3916_CMD_RC_CAL' undeclared (first use in this function); did you mean 'ST25R3916_CMD_STOP'?

 740 |     (cmd != ST25R3916_CMD_RC_CAL)                                      &&

   |         ^~~~~~~~~~~~~~~~~~~~

   |         ST25R3916_CMD_STOP

make: *** [Drivers/library files/BSP/Components/ST25R3916/subdir.mk:39: Drivers/library files/BSP/Components/ST25R3916/st25r3916.o] Error 1

"make -j20 all" terminated with exit code 2. Build might be incomplete

Brian TIDAL
ST Employee

Hi,

you have probably mixed up some packages. Make sure to use the proper st25r3916_com.h with the proper definition of ST25R3916B registers (i.e. with #ifdef ST25R3916B to define the registers specific to ST25R3616B in another words: use the .c/.h files from the latest X-CUBE-NFC6 package).

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.

okay. I will report in few. Thank you so much for helping me i really appreciate it.

according to the instructions in this

In platform.h:

a) replace _Error_handler by Error_handler

but when i replace it i get this error.

../Core/Inc/platform.h:131:54: error: 'Error_handler' undeclared (first use in this function); did you mean 'Error_Handler'?

 131 | #define platformErrorHandle()            Error_handler      /*!< Global error handler or trap        */

   |                           ^~~~~~~~~~~~~

../Drivers/library files/src/demo_ce.c:268:7: note: in expansion of macro 'platformErrorHandle'

 268 |    platformErrorHandle(); /* Must ensure appropriate buffer */

   |    ^~~~~~~~~~~~~~~~~~~

../Core/Inc/platform.h:131:54: note: each undeclared identifier is reported only once for each function it appears in

 131 | #define platformErrorHandle()            Error_handler      /*!< Global error handler or trap        */

   |                           ^~~~~~~~~~~~~

../Drivers/library files/src/demo_ce.c:268:7: note: in expansion of macro 'platformErrorHandle'

 268 |    platformErrorHandle(); /* Must ensure appropriate buffer */

   |    ^~~~~~~~~~~~~~~~~~~

../Drivers/library files/src/demo_ce.c: In function 'demoCeT3TCheck':

../Core/Inc/platform.h:131:54: error: 'Error_handler' undeclared (first use in this function); did you mean 'Error_Handler'?

 131 | #define platformErrorHandle()            Error_handler      /*!< Global error handler or trap        */

   |                           ^~~~~~~~~~~~~

../Drivers/library files/src/demo_ce.c:395:5: note: in expansion of macro 'platformErrorHandle'

 395 |   platformErrorHandle(); /* Must ensure appropriate buffer */

   |   ^~~~~~~~~~~~~~~~~~~

../Drivers/library files/src/demo_ce.c: In function 'demoCeT4T':

../Core/Inc/platform.h:131:54: error: 'Error_handler' undeclared (first use in this function); did you mean 'Error_Handler'?

 131 | #define platformErrorHandle()            Error_handler      /*!< Global error handler or trap        */

   |                           ^~~~~~~~~~~~~

../Drivers/library files/src/demo_ce.c:614:5: note: in expansion of macro 'platformErrorHandle'

 614 |   platformErrorHandle(); /* Must ensure appropriate buffer */

   |   ^~~~~~~~~~~~~~~~~~~

../Drivers/library files/src/demo_ce.c: In function 'demoCeT3T':

../Core/Inc/platform.h:131:54: error: 'Error_handler' undeclared (first use in this function); did you mean 'Error_Handler'?

 131 | #define platformErrorHandle()            Error_handler      /*!< Global error handler or trap        */

   |                           ^~~~~~~~~~~~~

../Drivers/library files/src/demo_ce.c:664:9: note: in expansion of macro 'platformErrorHandle'

 664 |     platformErrorHandle(); /* Must ensure appropriate buffer */

   |     ^~~~~~~~~~~~~~~~~~~

make: *** [Drivers/library files/src/subdir.mk:33: Drivers/library files/src/demo_ce.o] Error 1

make: *** Waiting for unfinished jobs....

I got it to compile but none of the leds on st25r3916b turns on. I triple checked everything

would you be able to look if i send you the entire project in a folder?

logic analyzer says the initial idle state of the clk line does not match the settings.

here is my ioc file