AnsweredAssumed Answered

FlexCan on MQX 3.5.1

Question asked by Elco Elettronica on Feb 4, 2011
Latest reply on Feb 14, 2011 by Petr MacHala

Hi everybody, I've a problem with the flexcan driver in mqx3.5.1.


I use an MCF52259 on my own designed board, and the codewarrior V7.1.2.


Now I've to develop a can bus communication, so I'm trying to use the flexcan driver, but I get some errors.


I've copied the flexcan example from the folder "mqx/examples/can/flexcan" and I've compiled it for my board, the code is the same of the example the only thing changing is the rom start address, because I've develop a bootloader for my board.

Another difference between my code and the example is that I'm trying to communicate at 1Mbit/s, and that I've changed the prescaler,PSEG1,PSEG2,and PROPSEG initializations because the frequency of my system in 48Mhz.



Theese are my settings:

                 can_reg_ptr->CANCTRL |= (0 | FLEXCAN_CANCTRL_PROPSEG(6) | FLEXCAN_CANCTRL_RJW(1)
                                             | FLEXCAN_CANCTRL_PSEG1(7) | FLEXCAN_CANCTRL_PSEG2(7)
                                             | FLEXCAN_CANCTRL_PRESDIV(0) | FLEXCAN_CANCTRL_SAMP);


Are they correct?


First I've tryed if I'm able to send. So I've commented out the creation of the RX_task and I've used only the TX_task; all the functions calls return no error, and all the registers seems at the correct values, but I don't see nothing out from the pins.



A strange thing I've noticed is that the "end of trasmission ISR" is never generated, instead is generated at each transmission an error ISR that report strange error, like ACK error or bit stuffing error... it's possible that theese errors are generated by the absence of other nodes on the net?


Thanks in advance.


Best regards.