Forum Discussion
Altera_Forum
Honored Contributor
8 years agoRavi,
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.