2023-05-05 02:12 PM
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?
Solved! Go to Solution.
2023-05-12 08:30 AM
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();
}
}
2023-05-14 06:17 AM
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
2023-05-15 09:01 AM
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, ®Dump->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, ®Dump->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, ®Dump->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, ®Dump->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, ®Dump->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, ®Dump->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, ®Dump->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, ®Dump->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
2023-05-15 09:18 AM
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
2023-05-15 09:19 AM
okay. I will report in few. Thank you so much for helping me i really appreciate it.
2023-05-15 09:35 AM
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....
2023-05-15 10:03 AM
I got it to compile but none of the leds on st25r3916b turns on. I triple checked everything
2023-05-15 10:13 AM
2023-05-15 10:28 AM
logic analyzer says the initial idle state of the clk line does not match the settings.
2023-05-15 10:53 AM