Receiving Interrupts on TX2

Forum related to ERIKA Enterprise and RT-Druid version 3

Moderator: paolo.gai

Post Reply
asinglet
Newbie
Posts: 1
Joined: Mon Aug 13, 2018 1:23 am

Receiving Interrupts on TX2

Post by asinglet » Mon Aug 13, 2018 8:09 pm

Hi,

My lab is using ERIKA3 on a Jetson TX2 with the Jailhouse hypervisor as the controller for one of our robots. We have successfully written SPI and GPIO drivers, as well as implemented a QP solver, and we are impressed with the performance.

Now, I am trying to get shared memory working between Linux and the Erika cell. I was able to get the ivshmem-demo (from the jetson-jailhouse github https://github.com/evidence/linux-jailh ... mem-demo.c) running successfully on Jailhouse, but running the code in Erika only sends interrupts, and cannot receive interrupts.

To attempt to remedy this, I am trying to use the SetISR2Source function from the dynamic API. I am using the dynamic api demo, which runs successfully for an ISR source of "OSEE_GTIMER_IRQ", which seems to be a clock. Replacing this source number with (300+32), the IRQ for the ivshmem demo, does not work. The code compiles and runs fine, but does not receive any interrupts.

I also tried defining the ISR object with SOURCE = "(300+32)" instead of the default "27", and then attaching a handler, but this also does not seem to work.

Do you have any advice for getting the interrupts configured? Or how to get shared memory, particularly in the form of the "ivshmem-demo", working with Linux?

Thanks!
Andrew

Matt07
Newbie
Posts: 5
Joined: Fri Feb 21, 2020 9:42 am

Re: Receiving Interrupts on TX2

Post by Matt07 » Wed Apr 22, 2020 5:19 pm

Hello Andrew,

Did you manage to use a shared memory between Linux and the Erika cell ?

I managed to establish a connection between my linux cell and my erika cell but, how can I access to this memory from linux ?

Did you find any example ?

Thank you,

Matthieu

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

Re: Receiving Interrupts on TX2

Post by l.cuomo » Mon Apr 27, 2020 2:37 pm

Hi all,

ENABLING INTERRUPT
In order to send and receive interrupts through the ivshmem mechanism, both root and inmate cell need a reserved IRQ.
First of all select 2 IRQs (one for root and one for inmate). Then enable them by properly setting .vpci_irq_base's value and enabling .irqchips flag.
Pay attention in IRQ numbering. Often the datasheet refers to number without the 32 base interrupts.
In that case, when setting the ISR in Erika's conf.oil, you must add 32.

ACCESSING MEMORY
You can access shared memory of virtual PCI devices using mmap on /dev/mem or /dev/uio%.
To obtain the latter you should build and "insmod" the driver from
https://github.com/henning-schild-work/ ... /jailhouse.
In order to load this module, the kernel needs to have UIO support enabled.

Matt07
Newbie
Posts: 5
Joined: Fri Feb 21, 2020 9:42 am

Re: Receiving Interrupts on TX2

Post by Matt07 » Thu May 14, 2020 5:33 pm

Hi l.cuomo,

Thank you for your help,

I couldn't build the uio_ivshmem driver from https://github.com/henning-schild-work/ ... .jailhouse with the current version of my kernel (4.4.38).

which version should I use to be able to build it ?

Thank you,

Matthieu

Matt07
Newbie
Posts: 5
Joined: Fri Feb 21, 2020 9:42 am

Re: Receiving Interrupts on TX2

Post by Matt07 » Thu May 14, 2020 5:33 pm

Hi l.cuomo,

Thank you for your help,

I couldn't build the uio_ivshmem driver from https://github.com/henning-schild-work/ ... .jailhouse with the current version of my kernel (4.4.38).

which version should I use to be able to build it ?

Thank you,

Matthieu

Post Reply