Multi-OS usage on jetson tx2 with Ubuntu, Erika and Jailhouse hypervisor

Forum related to ERIKA Enterprise and RT-Druid version 3

Moderator: paolo.gai

Post Reply
paoloc
Newbie
Posts: 2
Joined: Wed Jun 12, 2019 3:22 pm

Multi-OS usage on jetson tx2 with Ubuntu, Erika and Jailhouse hypervisor

Post by paoloc » Thu Jun 13, 2019 8:03 am

Hi,

I'm working on an automotive R&D project and I'm in charge of developing the main ECU OS.

I would like to control a CAN device using Erika OS and Jailhouse hypervisor, but I can't get the CAN bus to work under Erika. I tried to use GPIOs to control a sample device (as in this video : https://www.youtube.com/watch?v=skIcAkXfNWQ ) but it doesn't work. Only demonstrations codes given in the Erika v3 Virtual machines work (thus, only serial console outputs). Any modifications of .cell files aren't working, for example when I try to give access to the said bus or to GPIOs to Erika.

Has anyone a sample code or an explanation of how to make this CAN bus work ?

Thanks in advance :1smiley:
Best regards

l.cuomo
Newbie
Posts: 4
Joined: Wed Aug 29, 2018 8:46 am

Re: Multi-OS usage on jetson tx2 with Ubuntu, Erika and Jailhouse hypervisor

Post by l.cuomo » Thu Jun 13, 2019 2:15 pm

Hi,
what kind of error are encountering while adding the GPIO memregions to your application?

in order to access GPIOs without removing them from Linux, you should add the control register and the PINMUX to the inmate configuration using the following flags:
.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
JAILHOUSE_MEM_IO | JAILHOUSE_MEM_ROOTSHARED,

You could take the regions addresses from the default Jetson TX2 root cell.

Furthermore you should add these regions to your application's memory space using "map_range" with MAP_UNCACHED flag.

Regards,

paoloc
Newbie
Posts: 2
Joined: Wed Jun 12, 2019 3:22 pm

Re: Multi-OS usage on jetson tx2 with Ubuntu, Erika and Jailhouse hypervisor

Post by paoloc » Mon Jun 17, 2019 10:43 am

Hi, I had no error on the serial output, only a board crash.

Thanks for your answer, I'll try your solution and tell you whether I am able to use GPIOs and CAN or not :1smiley:

Best regards

EDIT : Can you please tell me how to add these regions to the application's memory ? I don't really know where and how to add this "map_range" and its flag :1huh:

l.cuomo
Newbie
Posts: 4
Joined: Wed Aug 29, 2018 8:46 am

Re: Multi-OS usage on jetson tx2 with Ubuntu, Erika and Jailhouse hypervisor

Post by l.cuomo » Tue Jun 18, 2019 3:28 pm

Hi Paolo,

you need to call this function before accessing any memory area located outside of your inmate's RAM.
You can find the declaration of map_range in inmates/lib/inmate_common.h.
The map flag depends on the cacheabilty of the new area you want to map in your space address (MAP_UNCACHED fo memory mapped device, MAP_CACHED for normal memory).
Take a look at the code of Jailhouse's demos for the usage.

Anyway this is not the reason for the board hang. The misuse of map_range affects only the inmates.

I had a similar experience with a NVIDIA-UART of the board. I had board hanging while trying to access register with no clock gate enable for this peripheral. I had to enable it by the proper node exported on the debugfs.

Best regards

Post Reply