Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timeout error when writing #4

Open
photon-delight opened this issue Apr 21, 2021 · 8 comments
Open

timeout error when writing #4

photon-delight opened this issue Apr 21, 2021 · 8 comments

Comments

@photon-delight
Copy link

I am experiencing an issue when writing to the device :

root@beaglebone:~/arm# ./canbin.sh
[21:09:03.614] main INFO: Connecting target
[21:09:03.621] stm32 INFO: Bootloader initialized
[21:09:03.642] stm32 INFO: Bootloader version: 2.0
[21:09:03.651] stm32 INFO: Read protection: 0x0000
[21:09:03.665] stm32 INFO: Chip ID: 0x0418 - STM32F105xx/107xx
[21:09:03.667] main INFO: Connected
[21:09:03.955] main INFO: Writing memory at 0x08000000:15940
[21:09:03.958] stm32 INFO: Progress: 0%
[21:09:05.181] main ERROR: Writing error: Receiving timeout

While reading doesn't have any issues :

root@beaglebone:~/arm# ./canread.sh
[21:16:03.951] main INFO: Connecting target
[21:16:03.959] stm32 INFO: Bootloader initialized
[21:16:03.981] stm32 INFO: Bootloader version: 2.0
[21:16:03.990] stm32 INFO: Read protection: 0x0000
[21:16:04.003] stm32 INFO: Chip ID: 0x0418 - STM32F105xx/107xx
[21:16:04.006] main INFO: Connected
[21:16:04.007] main INFO: Reading memory at 0x08000000:512
[21:16:04.009] stm32 INFO: Progress: 0%
[21:16:04.092] stm32 INFO: Progress: 50%
[21:16:04.137] stm32 INFO: Progress: 100%
[21:16:04.140] main INFO: Successful
[21:16:04.164] main INFO: Disconnecting target
[21:16:04.166] main INFO: Disconnected

@photon-delight
Copy link
Author

photon-delight commented May 2, 2021

Could this possibly be due to the socketCAN txqueuelen setting?

@marcinbor85
Copy link
Owner

marcinbor85 commented May 2, 2021 via email

@photon-delight
Copy link
Author

Thank you Marcin,

I have now managed to program small files successfully... 256 bytes and sometimes 512 bytes.. but that seems to be the max. That is why I thought it may be due to a buffer overflow (or something to that effect) on the socketCAN side. Changing txqueuelen didn't have any effect - as you mentioned.

My guess right now is that its an issue with the CAN timing on the beaglebone side...

I'm happy to close this issue if you feel it would appropriate

@tobylindsay1
Copy link

I am currently experiencing the same issue. Was a solution ever found for this? I am using a stm32f412 and a peak adapter as my interface.

@photon-delight
Copy link
Author

I didn't ever solve this issue... please let me know if you ever manage to resolve it.

@CaptainJack42
Copy link

I'm currenctly facing the same issue, from a quick glance it indeed appears to be an issue with the speed at which messages are sent, so i guess this might be an issue with the txqueuelen, adding a short delay after each 8 byte write (i'm currently using 0.1sec but thats just a really quick test) it is working as expected, but it is really slow (obviously).

I'm testing on an L486 with a CANable adabter.

I'll investigate further and report back.

@photon-delight
Copy link
Author

Its great that you at least found a solution which works. Is there any more info from your investigation?

@QuickRecon
Copy link

I found that I had this issue, and it was fixed by increasing the SJW on the socketcan interface to 2 (from the default value of 1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants