2016-09-20 11:29 AM
During evaluation of this chip, we found thatthe microcontroller apparently sets the ACK bittoo early when receiving messages from other devices.
Bus was 250 KBaud with a sample point of 80% (also tried 75% and 85%). This device used a 3.3V transceiver and connected to devices that had 5.0V transceivers.
While the HAL drivers correctly were able to send and receive messages. The microcontroller would start the ACK bit 2-3 uS early (during the CRC delimiter bit).
I found no errata associated with the behavior and am not aware of any register setting that can be modified to change when the CAN hardware sends the ACK bit.
Could this be an issue with 3.3V and 5 V signals on the same bus?Was 250 KBaud not tested?
/* CAN1 init function */
void
MX_CAN1_Init
(void
){
hcan1.
Instance=
CAN1;/* Prescaler = (Baud Rate Prescaler BRP[9:0] + 1) */
hcan1.
Init.
Prescaler=
10
; hcan1.
Init.
Mode=
CAN_MODE_NORMAL; hcan1.
Init.
SJW=
CAN_SJW_1TQ;/* BS1 = TS1[3:0] + 1 */
hcan1.
Init.
BS1=
CAN_BS1_14TQ;/* BS2 = TS2[2:0] + 1 */
hcan1.
Init.
BS2=
CAN_BS2_5TQ; hcan1.
Init.
TTCM=
DISABLE; hcan1.
Init.
ABOM=
DISABLE; hcan1.
Init.
AWUM=
DISABLE;/* Only attempt one transmission, no retries. */
hcan1.
Init.
NART=
ENABLE;// BSH Disable this before release!!!
hcan1.
Init.
RFLM=
DISABLE; hcan1.
Init.
TXFP=
DISABLE;if
(HAL_CAN_Init
(&hcan1)!=
HAL_OK){
//Error_Handler();
printf
(''Initialization failure \n''
);}
/* CAN Filter initialization must come AFTER CAN initialization. */
vCan1FilterInit
();}
void
vCan1FilterInit
(){
/* Initialize the filter (x = filter bank number). */
sCanRxFilterConfig.
BankNumber=
0
;/* x */
sCanRxFilterConfig.
FilterIdHigh=
0xFFFF
; sCanRxFilterConfig.
FilterIdLow=
0xFFFF
; sCanRxFilterConfig.
FilterMaskIdHigh=
0x0000
; sCanRxFilterConfig.
FilterMaskIdLow=
0x0000
; sCanRxFilterConfig.
FilterMode=
CAN_FILTERMODE_IDMASK;/* (FBMx=0) */
sCanRxFilterConfig.
FilterNumber=
0
; sCanRxFilterConfig.
FilterFIFOAssignment=
CAN_FILTER_FIFO0; sCanRxFilterConfig.
FilterActivation=
ENABLE; sCanRxFilterConfig.
FilterScale=
CAN_FILTERSCALE_32BIT;/* (FSCx=1) */
HAL_CAN_ConfigFilter
(&hcan1, &sCanRxFilterConfig);}
/* vCan1FilterInit() */
For this capture, the STM sends the ACK 2 uS early. The portion highlighted in white should encompass 3 bit fields (of 4 uS) with the last field being the CRC delimiter. Notice the voltage drop associated with the 3.3 V transceiver
Without the STM on the bus, the message is acked by the other receiving device at the correct point.
can-bxcan2016-09-21 10:52 AM
Hi holeman.brad,
Have you tested it for different baudrates and in other hardware. Try to check the transceiver and their supply accurency. I recommend that you replace your transceivers. It will be better then to test with analyser. (Ps: the figures does not appear, try to attach files) -Hannibal-2016-09-21 11:08 AM
Thank you Hannibal for your response. Unfortunately the only baud rate we will ever use is 250K. That is the J1939 standard. Even if it works at a different baud rate, it will be unusable for our purposes. We are just looking for confirmation that the errata does exist for this baud rate so we can move on to a different microcontroller.
How could a transceiver which only translates levels have an impact on only one particular bit in a 100+ bit stream, the same bit by the same amount each time?
One additional note: we are running this with the IAR debugger. I don't think that should have any impact.
I submitted a request to ST support on Monday and they have yet to respond.
I will attempt to re-upload the files.
2016-09-21 11:27 AM
Hi holeman.brad,
There is no such behaviour described in the . I think once they treat your request they will respond you. -Hannibal-2016-09-22 07:31 AM
2016-09-26 08:50 AM
Ok the problem is apparently resolved. The project was set up to use the internal oscillator. ST recommended using the external oscillator. When this was done, the problem was resolved.