MidTerm Evaluation

  • Adding CAN support for BeagleBone Black in RTEMS
    • Added CAN TX support.
    • Added CAN Minimal RX support.
    • Ported DCAN support from AM335x StarterWare.
    • Added CAN Test Applications.

Added CAN TX support

The functions are defined in the cpukit/dev/can/can.c file.

Important Functions

  • can_bus_write
  • can_xmit
  • can_tx_done

can_bus_write:

The application's call to write function comes to the can_bus_write function, where the application buffer is copied to the driver fifo's buffer based on the availability (else goes to sleep). After copying can_xmit is called.

can_xmit:

can_xmit function loops over the driver fifo and calls device tx function, where the CAN message is copied to the device fifo.

can_tx_done:

After the CAN message is sent in the bus, TX interrupt calls can_tx_done which wakes up the applications instance which are sleeping for the buffer avaliability.

Added CAN Minimal RX support

The functions are defined in the cpukit/dev/can/can.c file.

Important Functions

  • can_bus_Read
  • can_receive

can_bus_read:

The application's call to read function comes to the can_bus_read function, where the application waits (rtems_message_queue_receive) for any CAN message to be received.

can_receive:

can_receive is called from the interrupt handler, when a valid CAN message is received. Then the messages in broadcasted (rtems_message_queue_broadcast) to the application instances which are waiting (rtems_message_queue_receive) for the CAN message

Ported DCAN support from AM335x StarterWare

The porting is work in progress. The files are taken from Am335x StaterWare, which has DCAN support.

Added CAN Test Applications

The applications files are in testsuites/cantests/can-tx-rx link.

can-two-threads-tx.c

This file can be configured to create n threads, which sends different length CAN messages followed by read. Note: The file name deos not match the functionality of the file.

Note: All the above files are work in progress, Please give your suggestions and feedbacks.