This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
Fix can loopback tests.
- From: Andrew Lunn <andrew at lunn dot ch>
- To: eCos Patches <ecos-patches at ecos dot sourceware dot org>
- Date: Tue, 28 Aug 2007 17:57:02 +0200
- Subject: Fix can loopback tests.
Hi Folks
This patch allows the CAN loopback tests pass on synth.
Andrew
Index: devs/can/loop/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/can/loop/current/ChangeLog,v
retrieving revision 1.5
diff -u -r1.5 ChangeLog
--- devs/can/loop/current/ChangeLog 24 Aug 2007 13:44:56 -0000 1.5
+++ devs/can/loop/current/ChangeLog 28 Aug 2007 15:55:44 -0000
@@ -1,3 +1,14 @@
+2007-08-28 Andrew Lunn <andrew.lunn@ascom.ch>
+
+ * tests/can_overrun1.c (can0_thread): Fix the length of the data
+ in the message. Add a delay to allow the CAN device to process
+ the packets.
+ * test/can_txcevent.c: (can0_thread): Add a delay to allow the CAN device
+ to process the packet.s
+ * src/loop_can.c (FIFO_SIZE): Changed to one more than the TX
+ queue size. If it is less, the loopback tests don't pass because
+ packets don't get transmitted.
+
2007-08-24 Andrew Lunn <andrew.lunn>
* doc/synth_test.ecm: Import file for running the tests on synth.
Index: devs/can/loop/current/src/loop_can.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/can/loop/current/src/loop_can.c,v
retrieving revision 1.4
diff -u -r1.4 loop_can.c
--- devs/can/loop/current/src/loop_can.c 10 Aug 2007 14:08:12 -0000 1.4
+++ devs/can/loop/current/src/loop_can.c 28 Aug 2007 15:55:44 -0000
@@ -100,7 +100,7 @@
//-------------------------------------------------------------------------
// Transfer FIFOs
-#define FIFO_SIZE 16
+#define FIFO_SIZE 33
struct fifo
{
Index: devs/can/loop/current/tests/can_overrun1.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/can/loop/current/tests/can_overrun1.c,v
retrieving revision 1.2
diff -u -r1.2 can_overrun1.c
--- devs/can/loop/current/tests/can_overrun1.c 26 Mar 2007 10:38:05 -0000 1.2
+++ devs/can/loop/current/tests/can_overrun1.c 28 Aug 2007 15:55:44 -0000
@@ -116,7 +116,7 @@
},
CYGNUM_CAN_ID_STD, // standard frame
CYGNUM_CAN_FRAME_DATA, // data frame
- 0, // data length code
+ 1, // data length code
};
if (ENOERR != cyg_io_lookup("/dev/can0", &hCAN0))
@@ -156,6 +156,11 @@
print_can_msg(&tx_msg, "");
}
}
+
+ //
+ // Give the loop back driver time to process all those messages.
+ //
+ cyg_thread_delay(10);
//
// now check if receive queue is completely filled - that means number of rx events should
Index: devs/can/loop/current/tests/can_txevent.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/can/loop/current/tests/can_txevent.c,v
retrieving revision 1.2
diff -u -r1.2 can_txevent.c
--- devs/can/loop/current/tests/can_txevent.c 26 Mar 2007 10:38:05 -0000 1.2
+++ devs/can/loop/current/tests/can_txevent.c 28 Aug 2007 15:55:44 -0000
@@ -164,6 +164,11 @@
}
//
+ // Give the loop back driver time to process all those messages.
+ //
+ cyg_thread_delay(10);
+
+ //
// now we read the buffer info - we expect a completely filled recieve queue
//
len = sizeof(buf_info);