cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
anibal.portero
Participant
Participant
8,684 Views
Registered: ‎01-12-2015

Sharing devices on petalinux-FreeRTOS AMP

Hi guys,

 

I want to share pl and ps devices on 2014.4 petalinux-FreeRTOS AMP. What is the right way of doing this?

I suppose that you cannot simply disable a device in the Linux device tree because that way it won't be able to initialize the device.

 

For example, I have tried to use SD in FreeRTOS. This seems to be correctly working. Although I get this when I poweroff Linux:

 

Unmounting local filesystems...
mmc0: Timeout waiting for hardware interrupt.
mmc0: Timeout waiting for hardware interrupt.
mmc0: Timeout waiting for hardware interrupt.
mmc0: Timeout waiting for hardware interrupt.
mmc0: error -110 during shutdown

 

I didn't paid much attention to this error. However, when I tried to do the same with a GPIO I found an issue, as the GPIO wouldn't work.

 

Please, does anybody knows what is the right way of sharing devices between petalinux and FreeRTOS?

If I want to use a GPIO in FreeRTOS, is it enough I just don't use that GPIO in Linux?

0 Kudos
5 Replies
linnj
Xilinx Employee
Xilinx Employee
8,683 Views
Registered: ‎09-10-2008

Ideally I think you should not share devices as that's going to open up the possibility of corruption issues unless you design for it. Ideally you should use a peripheral on one CPU or the other or have some mechanism to ensure there are no sharing issues.

There may still be an outstanding issue with later kernels as the Linux kernel disables clocks for devices that are not used such that you might have to deal with that. There is another post related to that issue (I was thinking for SPI maybe).

Thanks,
John
anibal.portero
Participant
Participant
8,678 Views
Registered: ‎01-12-2015

Thanks for your answer John, I'll take a look on the SPI, as I wanted to use it on the FreeRTOS core too.

 

About the GPIO problem, I suppose that is not related with any clock. Could the origin be the same as in this post?

 

http://forums.xilinx.com/t5/Embedded-Linux/GPIO-issues-with-Linux-version-3-17-0-xilinx/td-p/560245

 

It seems the GPIO numeration in Linux starts with 138 (I have tested it and it works). But, on FreeRTOS I cannot use the GPIO neither using the old numeration nor the new one. I am way too lost and I'm not reallly sure about how to debug this problem.

 

Thanks again!

 

0 Kudos
linnj
Xilinx Employee
Xilinx Employee
8,672 Views
Registered: ‎09-10-2008

It almost sounds like you need to better understand GPIO without Linux (or I'm not following you). Without Linux GPIO should be somewhat easier to understand as there's less abstraction. Have you done some GPIO testing with the standalone driver (without Linux and AMP)?

It's not clear to me how you are using the GPIO from FreeRTOS but I would think it's typically using the standalone driver.

Thanks,
John
0 Kudos
anibal.portero
Participant
Participant
8,663 Views
Registered: ‎01-12-2015

The driver I'm using is xgpiops.h.

 

I've tested the same FreeRTOS application with and without AMP. Without AMP (using JTAG and SDK debug), it just works. I can make the led blink using gpio 10. Now, if I use the same application along with the rest of the system (when the hardware initialization is done by Linux), it won't work.

 

Thank you for yout fast responses

0 Kudos
anibal.portero
Participant
Participant
8,657 Views
Registered: ‎01-12-2015

Ok, I was able to use it with the old numeration. I hust had to export the GPIO on Linux first to use it on FreeRTOS.

 

Thanks anyway for your help :)

0 Kudos