This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CAN - trying to receive, get Resource temporarily unavailable error

Other Parts Discussed in Thread: SN65HVD233

Hi,

I'm using a Phytec board with a CAN interface (using SN65HVD233 chip).  

The Phytec board sends a command (or list of various commands) to another module using a Stellaris, which takes samples and sends the data back over the CAN lines.  

The Phytec board is totally fine sending a command to the Stellaris, and the Stellaris takes a sample and sends it back.  

I might be wrong, but i assume that the Stellaris is working fine and can send its data correctly.

But on the Phytec board side, it had problems receiving all the data. 

I have run various tests where the CAN rate is 1,000,000; 500,000; and 100,000.

Each time I expect 2014 frames to come back from the stellaris chip.  

For the 1,000,000 CAN rate and 500,000 CAN rate I got only 467 frames back.

For the 100,000 CAN rate I got 2013 frames back.  

I also run this various times (command for the Phytec is from a LabWindows program), and the time it fails is always very random (like after the 10th time, 7th time, first time, etc).  

I have recorded the errno variable after using recv() and it returns the error "Resource temporarily unavailable."

Has anyone ever gotten this error when using CAN (and socket programming)?  I've been looking around and it possibly do with a timeout issue?

edit: it is timing out, but I don't know why it doesnt get all of its data back?  Did it miss some?

Thank you in advance

  • Have you properly terminated the bus?  At both ends of the transmission line should be terminated with 120 ohm.  If you do not terminate you will not be able to raise the data rate.  Also what is the lenght of you network, CAN must be derated we lenght (due to the 2x loop delay on the bus for arbitration to work (so ~2x 5ns per meter)).   Do you have scope shots of the TXD, RXD, and differentail pair of CANH / CANL, it would help identify if it is the PHY and bus side or s/w.  Especially shots around the ACK bit would be helpful, plus a network description to determine where the issue is.   If it is s/w and the MCU you will need to work with the E2E forum for the MCUs.

    -- Scott

  • Yeah, there is a 120 ohm resistor at the end of the bus.  The length we are testing at is fairly short, 2.5 feet.  Also we have narrowed it down to a CAN problem with the Stellaris. For some reason, when the data rate is increased or the number of samples increased, it looks like the Stellaris still takes the samples, it just doesn't send any files over the CAN to the Phytec