AnsweredAssumed Answered

Anyone using CAN on TWR-MPC8309 and MQX EAR3 or EAR4?

Question asked by Douglas Triman on Apr 1, 2013
Latest reply on Apr 4, 2013 by Martin Latal

On TWR-MPC8309,  I’ve put together an MQX app that provides a socket server on each of the two Enet ports, receiving (and transmitting) CAN, converting to a text stream on the sockets.

 

Program works okay as “Ext-RAM debug” via USB tap.  Also works okay as “U-boot Debug” if I download via USB-tap.  However, if I take “Uboot_d.bin” loaded from USB memory stick via Uboot, the CAN portion doesn’t work.  The Enet side works correctly, as well as serial comms on RS232 port, just the CAN is broken.  Appears to be putting out signal on CAN, but is clearly broken at the interface level.

 

I was using the MQX 3.8 EAR3 that comes on DVD with the TWR-MPC8309 board.  Decided to try the EAR4 version from Compass Extranet site.  Both EAR3/EAR4 libraries compile fine by themselves, and link with my project as expected.  However the MQX3.8 EAR4 version has a link error when I build my project (there are four similar errors listed):

 

Link Error:  undefined ‘_MPC83xx_FCAN_int_init’

Referenced from ‘FLEXCAN_Error_int_enable’ in twrmpc8309_d.a

 

The mpc83xx_fcan.h source in MQX 3.8 EAR4 contains:

#define _flexcan_int_init                     _MPC83xx_FCAN_int_init

 

While the MQX3.8 EAR3 contains:

#define _flexcan_int_init                     _bsp_flexcan_int_init

 

And the func itself appears to be kind of a stub:

 

/*FUNCTION****************************************************************

*

* Function Name    : _bsp_flexcan_int_init

* Returned Value   : FLEXCAN_OK

* Comments         :

*    This function does nothing for PPC.

*

*END*********************************************************************/

uint_32 _bsp_flexcan_int_init

(

   /* [IN] FlexCAN interrupt vector index */

    uint_32 vector_index,

 

   /* [IN] FlexCAN interrupt priority level */

    uint_32 level,

 

   /* [IN} Unmask the interrupt now? */

    boolean unmask

)

{  

    return FLEXCAN_OK;

 

}

 

 

Fixing MQX 3.8 EAR4 by using the same ‘_bsp_flexcan_int_init’ stub gets rid of the link error in my project, but upon inspecting other MQX versions (i.e., 3.7) for other platforms (i.e., M5329) it appears that more should be going on in that function than just a return.  Makes me think there’s some missing source code in MQX EAR4.

 

So I have two problems:  CAN not working correctly when attempting to load app from within U_boot, and then there's the link error on MQX3.8 EAR4.

 

 

Outcomes