Hello again, I'm really getting stuck with not being able to find out basic stuff. Sorry if I've missed something obvious but I've been trying to do something simple all day and still getting nowhere.
I want to be able to communicate between the fpga and the bbb so I thought an easy way to get started would be to use the shared pins. For example fpga pin 105 is connected to bbb p8.13.
My fpga program just connects a button (also couldn't find this documented anywhere) to the led and pin 105. I can see the pin changing with my multimeter.
Previously on a bbb, I'd export the gpio with :
root@arm:~# echo 23 > /sys/class/gpio/export
then be able to inspect the value. Which doesn't work. Neither does the Adafruit python library.
So maybe the overlay isn't setup to handle these pins. I can't find in any of the source where the overlay is defined. I've searched /lib/firmware for the overlay (which seems to be loaded when I look at the slots:
cat /sys/devices/bone_capemgr.9/slots
0: 54:P---L BB-BONE-LOGIBONE,00R1,VALENTFX,BB-BONE-LOGIBONE
There is an "old" dts file in the repo ./old/beaglebone_old/logibone.dts but that file isn't in /lib/firmware.
So where is the overlay defined?
How can I access the GPIOs from userspace on the beaglebone?
Am I missing a whole trove of documentation somewhere?
Sorry for all the questions,
Matt
Comments
https://github.com/fpga-logi/logi-projects/blob/master/logi-wishbone/hw/logibone/hdl/logibone_wishbone.vhd#L244
which looks a bit like using a component with the port map (I'm a total beginner to this). I can't work out what's doing the work - are there other files I need to look at?
Thanks for the help,
Matt
http://valentfx.com/skeleton/arch_editor.html?board=logibone
In this demo we have the Beaglebone external memory interface (GPMC bus) connected to a component that converts it to the wishbone bus (open source bus specification). A PWM component is then mapped on this bus, and the software can configure the different properties of the PWM by wirting to its registers. On the beaglebone, this external memory space is accessed through /dev/logibone and is wrapped in a library that provides easy to use read/write functions in C and Python. In the example, python code controls the PWM properties by using the provided library functions to write the PWM component registers:
https://github.com/fpga-logi/logi-apps/blob/logibone/wishbone/test_wishbone.py
On the device-tree aspect, the dts files are located in the official kernel sources and can be seen in the logibone patchset :
https://github.com/RobertCNelson/bb-kernel/tree/am33x-v3.8/patches/logibone
Matt
https://github.com/fpga-logi/logi-hard.git
not
https://github.com/fpga-logi-dev/logi-hard.git
From what I understand from this page on the wiki http://valentfx.com/wiki/index.php?title=LOGI_-_Wishbone_-_HW#Wishbone_addressing_in_the_HDL
each wishbone slave peripheral gets its own base address. But I don't know where that will be. I can see this being used: Intercon_0_wbm_adc_reg_wbs_0.address but no idea where it's mapped to.
Also there is lots of big blue writing on that page that says 'out of date' - I don't want to waste my time on old docs!
And how would I go about writing to the register on the FPGA? Can I use Intercon_0_wbm_adc_reg_wbs_0.address as a register?
Does anyone have a simple example of reading and writing to a register via the wishbone interface?
I've tried wishbone_write 0x0000 0x1234
but wishbone_read 0x0000
results in nothing.
If I use the default test example, I can read and write to this address.
If I connect the in and out with a std_logic_vector I get this error when trying to synthesize:
Line 55: Illegal identifier : adcreg_reg_out_0__adcreg_reg_in_0__0
Are there any working examples of using a register? That would be a great starting point!
WARNING:ProjectMgmt - File /home/mattvenn/work/fpga/logi-projects/logi-wishbone/hw/logibone/ise/ipcore_dir/clock_gen/example_design/clock_gen_exdes.ucf is missing.
WARNING:ProjectMgmt - File /home/mattvenn/work/fpga/logi-projects/logi-wishbone/hw/logibone/ise/ipcore_dir/clock_gen/example_design/clock_gen_exdes.vhd is missing.
WARNING:ProjectMgmt - File /home/mattvenn/work/fpga/logi-projects/logi-wishbone/hw/logibone/ise/ipcore_dir/clock_gen/example_design/clock_gen_exdes.ucf is missing.
WARNING:ProjectMgmt - File /home/mattvenn/work/fpga/logi-projects/logi-wishbone/hw/logibone/ise/ipcore_dir/clock_gen/example_design/clock_gen_exdes.vhd is missing.
If I try and add the logibone_ra3.ucf constraints file to the project, I get an error that tells me it's already added, though I can't see it in the file browser.
I used the working pwm example (the preprogrammed example in the skeleton editor). I removed the pwm functionality and just used the configured registers.
I'm still interested if anyone can help me with a simpler setup that just uses a single register.
Matt
a = logi_hal.readRegister(REG_0, 0)
print a
It doesn't look like an illegal name (starting with number of _) to me, so maybe it's to do with something else?
Also last couple of errors about types not matching is confusing. I started changing the design.json to use std_logic instead of std_logic_vect but then thought it probably wouldn't work as it needs to be a 16bit wide bus.
ERROR:HDLCompiler:488 - "/home/mattvenn/work/fpga/adc_reg/adc_reg.vhd" Line 55: Illegal identifier : REG_0_reg_out_0__REG_0_reg_in_0__0
ERROR:HDLCompiler:488 - "/home/mattvenn/work/fpga/adc_reg/adc_reg.vhd" Line 131: Illegal identifier : REG_0_reg_out_0__REG_0_reg_in_0__0
ERROR:HDLCompiler:488 - "/home/mattvenn/work/fpga/adc_reg/adc_reg.vhd" Line 133: Illegal identifier : REG_0_reg_out_0__REG_0_reg_in_0__0
ERROR:HDLCompiler:488 - "/home/mattvenn/work/fpga/adc_reg/adc_reg.vhd" Line 55: Illegal identifier : REG_0_reg_out_0__REG_0_reg_in_0__0
ERROR:HDLCompiler:488 - "/home/mattvenn/work/fpga/adc_reg/adc_reg.vhd" Line 131: Illegal identifier : REG_0_reg_out_0__REG_0_reg_in_0__0
ERROR:HDLCompiler:488 - "/home/mattvenn/work/fpga/adc_reg/adc_reg.vhd" Line 133: Illegal identifier : REG_0_reg_out_0__REG_0_reg_in_0__0
ERROR:HDLCompiler:1728 - "/home/mattvenn/work/fpga/adc_reg/adc_reg.vhd" Line 131: Type error near reg_0_reg_out_0__reg_0_reg_in_0__0 ; current type std_logic_vector; expected type std_ulogic
ERROR:HDLCompiler:1728 - "/home/mattvenn/work/fpga/adc_reg/adc_reg.vhd" Line 133: Type error near reg_0_reg_out_0__reg_0_reg_in_0__0 ; current type std_logic_vector; expected type std_ulogic
ERROR:HDLCompiler:854 - "/home/mattvenn/work/fpga/adc_reg/adc_reg.vhd" Line 32: Unit <structural> ignored due to previous errors.
You said:
https://github.com/RobertCNelson/bb-kernel/tree/am33x-v3.8/patches/logibone
Looks out of date, the setup_device-tree_R1.sh
file installs a dts file to /lib/firmware which doesn't exist in my /lib/firmware.
To change the DTS what do I do, are there any instructions?
http://valentfx.com/wiki/index.php?title=Develop_new_driver_for_LOGI-Bone
http://valentfx.com/vanilla/post/quote/71/Comment_244
Is there a reason I can't use a runtime inserted dts?
good news, with your latest remarks, i built a new image based on 4.4 kernel that enables dynamic loading of overlays. The new image is not on the server yet, but pm me and i'll send a link for you to download and test. The image contains the device-tree overlay that you can modify and load at run-time. (its a 16.04 Ubuntu image).
8.7
2017-03-19
4GB SD
LXQT) and doing this:
can i have also the new image?
I want to use PRU with logibone. I have kernel 3.8.13. I created a new .dts file but i get a prussdrv_open() failed.
Thank you,
George
by any chance, is the image "based on 4.4 kernel that enables dynamic loading of overlays" mentioned by JPIAT available somewhere for download?
Thank you,