renode / renode

Renode - Antmicro's open source simulation and virtual development framework for complex embedded systems
https://renode.io
Other
1.64k stars 295 forks source link

CanHub - connect to host CAN network? #502

Open akohlsmith opened 1 year ago

akohlsmith commented 1 year ago

I could have sworn I saw this in the documentation, but after scouring it several times I must have been dreaming it.

I know that I can attach an emulated device to a host ethernet network, but I'm wondering if the same can be done with CAN; I'd like to use Linux or OSX as a CanOpen controller and develop CanOpen peripheral code on an emulated STM32 using the fdcan peripheral.

Is this possible and, if so, is it documented anywhere?

akohlsmith commented 1 year ago

Looking at an issue in the zephyr repo, it sounds like renode can in fact connect the emulated device to the host's CAN network, but I don't see any information nor fragments of a renode config which might allow this. I also don't seem to be able to find better documentation than this page on CanHUB, but it doesn't mention anything about interacting the host bus.

Could one of the renode developers give some insight in how to do this?

yassinedevop commented 7 months ago

I think this might help : https://github.com/antmicro/renode/blob/master/tests/peripherals/UT32_CAN.robot https://github.com/antmicro/renode/blob/master/tests/peripherals/MCAN.robot

Edit : Sorry after checking again, these robot tests show only communication through renode, Idk if renode can forward the canHub like it does with the UARTHub : expose a virtual UART device

yassinedevop commented 6 months ago

There is a solution to this here #598

PiotrZierhoffer commented 6 months ago

Hi @yassinedevop Correct, CreateSocketCANBridge is the solution we have just released.

We are going to publish a chapter on this in our docs very soon.