Forum Discussion
Altera_Forum
Honored Contributor
8 years agoHi kyle,
thanks for your reply.I tried the way you told using the Linux but this did not work.The GPIO was not accessible.so from linux itself I am not able to control.if we solve this then user space code will work. My Assignment editor looks like this the 2 rows for each pin original To:GPIO_1[1] Assignment name-> Location PIN_Name(value) Enabled(yes) GPIO_1[1] Assignment name-> I/O standard 3.3V LVTTL(value) Enabled(yes) My changed version To:GPIO_1[1] Assignment name-> HPS_IO ON(value) Enabled(yes) GPIO_1[1] Assignment name-> I/O standard 3.3V LVTTL(value) Enabled(yes) Is this correct ??.. Like this I need to enable for all other pins.Is there any thing I missed assigning here???..Let me know.Any configuration changes. In the device option also I have chooseb UNUSED pin as INPUT state TRIGERRED. created the .SOF and programmed and ran the linux command but did not work..Kindly let me know if you see any errors here thanks in advance --Ravi --- Quote Start --- Ravi, The Assignment editor needs to be set to Assignment Name [I/O Standard] this is a must is shouldn't be a "location" on the FPGA as there is no location it goes through into the preloader and is linked there. The Value is instead set to the Voltage level [3.3-V LVCMOS] your maybe less depending on the hps powered IO's it could be 2.5V or lower please check this. Enabled is yes too so that would be correct. Please try the linux commands from the HPS command line first (before memory mapping) to make sure that the GPIO's can be set... follow this tutorial for setting the GPIO's If there are LED's then you should be just write a active low or high signal to them from the command line.... Follow this tutorial and see if the LED's light on the gpio then you can start to progress into the memory mapping application code.. http://falsinsoft.blogspot.co.uk/2012/11/access-gpio-from-linux-user-space.html It looks like your code is correct but you need to just make sure that the GPIO is controllable from the drivers in linux the following echo commands will help you enable an GPIO output (number is significant please find out the number of the GPIO from linux and cyclone V handbook for specifying the correct GPIO) here 192 is used as this is from the GPIO controller 2 and is the 1st one your number will be different please check for your correct one. echo 192 > /sys/class/gpio/export echo "out" > /sys/class/gpio/gpio192/direction echo 1 > /sys/class/gpio/gpio192/value echo 0 > /sys/class/gpio/gpio192/value The first echo line enables the gpio.... if you get problems here the gpio is already attached to a linux driver and will need removing (look into removing a driver) The second enables that channel to become an output as all gpio's are either in or output the default is always input so this enables you send the gpio as high or low...etc The next 2 lines will write a high or low value to that gpio you should see the light move on and off if it is correctly enabled. Best of luck Kyle Without finding problems you never learn. --- Quote End ---