I am working on a sensor based project using STM32 in which I do the following things,
- Receive data from sensor
- Transmit that data on the CAN bus.
The sensor will send data twice every minute and there is approx 250ms delay between those two data from the sensor. When a data is received from the sensor it is transmitted as a frame on the CAN bus. I also have a MCP2515 attached to a raspberry pi which logs all the data on the CAN bus. There is no other node on the CAN bus except the STM32 CAN and MCP2515. I also checked the termination resistors and they are ok. Initially I has the following settings
hcan.Init.TTCM = DISABLE; hcan.Init.ABOM = DISABLE; hcan.Init.AWUM = DISABLE; hcan.Init.NART = ENABLE; hcan.Init.RFLM = DISABLE; hcan.Init.TXFP = DISABLE;
When I used the above settings, my data log showed a lot of data missed in the CAN bus. So I changed the NART to DISABLE and tried again.
hcan.Init.TTCM = DISABLE; hcan.Init.ABOM = DISABLE; hcan.Init.AWUM = DISABLE; hcan.Init.NART = DISABLE; hcan.Init.RFLM = DISABLE; hcan.Init.TXFP = DISABLE;
This time I received many additional data in the CAN log. Why is this NART bit causing additional data on the CAN bus. As per my project, I need an exact data count from the sensor. I am pretty sure that the sensor is transmitting the data on regular interval using a oscilloscope.
Please help me out on this.