Hi Mark,
Ok, did some more poking around, being careful to not
wiggle too many things at once. I can get a reliable
lockup by doing the following:
1. power ext12v off
2. obdii ecu stop
3. power ext12v on
...wait a few seconds
4. obdii ecu start can3
If I restart obdii too soon, all works. Otherwise, I
can repeatedly disable and re-enable 12v to cycle the
HUD, and it will never connect. The ordering of steps 1
and 2 don't seem to matter. Unfortunately, I don't see
anything in the can status that's uniquely different
between scenarios where its working and not. Will need
some additional diagnostic logging...
Now, for fun, I hook the OBDII Dongle to the module, and
try the same steps, but instead of turning on the HUD, I
try connecting a few times while the OBDII ECU task is
not running (simulating the HUD's attempts to connect),
then start the ecu, then try to connect. It connects!
And this is with the Dongle doing its multi-speed scan
each time. So simply having frames come in while we're
not watching, or frames coming in at the wrong speed
does not cause the hang. Rather, it might be that we've
got a window in the code where incoming traffic
colliding with the opening of the CAN
driver is nailing the chip in some critical region. If
I hit it just right, I can sometimes cause this
collision with the Dongle by stopping the ecu, starting
the connect, then restarting the ecu during the connect
sequence. Not always, but sometimes.
Just a guess... I need to dust off the chip document
and see if there are any interesting bits to look at.
Greg
Mark Webb-Johnson wrote:
When the client (HUD, whatever) is
trying to connect to the ECU, it can try 500K, 250K.
Or it can try 250K, 500K. I suspect yours tries the
first descending sequence, and hence doesn’t have
any issues as it finds the match at 500K first.
Anyway, this MCP2515 can bus lockup is
something we have to fix. The fact it is
reproducible on obd2ecu is good and helpful for
that.