cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
zitopbit808
Visitor
Visitor
220 Views
Registered: ‎07-06-2021

petalinux - Unable to talk to GPIO

Hi,

i can not acheive to talk to GPIO  from Petalinux.

Here is a snapshot of the design :

zitopbit808_0-1626874480035.png

It consist of 3 GPIO IP connected to leds buttons and switchs.

I have tested the design with a baremetal application from wish i can make all GPIO works so my PL design is validated. The probleme resid in talking with GPIOs from Petalinux. 

The way i test leds from linux is , exporting the pin, setting the direction, than setting value to them. But leds dont light up doing this. My idea was that logic should be not progamed so ive tried to flash the PL from Vivado while petalinux run but nothing change, probleme remain the same. 

Something i find a bit suspect is the in the boot log, XGpio never show up... is it something normal if .xsa file used to build petalinux contain GPIO IPs ?

i have tried a littlebit everything but i can not acheive to interface logic and linux

 

 

 

0 Kudos
3 Replies
aravindb
Moderator
Moderator
139 Views
Registered: ‎02-07-2018

HI @zitopbit808 

Can you please load the system.bit file first, before booting the Linux either from u-boot or from fsbl.

I doubt system.bit file is not programmed & you are trying t access it.

Please follow below steps to program the fpga from u-boot:

U-Boot> fatload mmc 0 0x4000000 bitstream.bit
U-Boot> fpga loadb 0 0x4000000 <bitstream file size>

 

Thanks & Regards

Aravind

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
------------------------------------------------------------------------------------------

 

0 Kudos
patocarr
Teacher
Teacher
123 Views
Registered: ‎01-28-2008

Hi @zitopbit808 

  To verify the PL is loaded properly, you can peek a register in one of the GPIO IPs to verify they are there. If the peek command hangs or throws an error, then the PL image may not be loaded.

  For instance:

# peek 0xa0000000

  The GPIO IP address might be different in your design. You'll see these addresses in the block design address editor tab. You can write directly to these registers to turn on/off the LEDs for instance. The pg144 AXI GPIO document page 10 has details.

  Also add more details on how you are attempting to access the GPIO from Linux, the actual commands as typed.

Thanks,

-Pat

 

Give kudos if helpful. Accept as solution if it solves your problem.
https://tuxengineering.com/blog

0 Kudos
zitopbit808
Visitor
Visitor
100 Views
Registered: ‎07-06-2021

Hello @patocarr @aravindb ,

my probleme was Petalinux configuaration as by default 
CONFIG_SUBSYSTEM_FPGA_MANAGER enable
aswell as CONFIG_SUBSYSTEM_REMOVE_PL_DTB. So disabling these two made things better working. 

Anyway that will help to be able to talk to IPs directly. 

Tanks

 

0 Kudos