• Content Count

  • Joined

  • Last visited

About Victor

  • Rank
    Frequent Visitor

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hello @ zygot >You don't need Linux to use Ethernet. Admittedly, FPGA vendors aren't too interested in making this easy. It seems for me as very strange manner to promote FPGAs. Can you gives some comments about it ? Tnanks.
  2. Hello @ Ciprian I read the document in this link and tied to use one of the command-line tools: [email protected]__my1:/# gpiodetect -sh: gpiodetect: command not found What means this reply from Petalinux ? Thank you Victor.
  3. Dear @ zygot >You don't want to do that in any OS, including a Linux varitety. Where can I find concrete GPIOs (used in my own FPGA design) within the Petalinux ? >Since you are struggling, you might just stick to Xilinx standalone SDK development until you feel confident. Adding the complexity of Linux and the development flow won't make this >easier. I have no problems in the application programs using GPIO within SDK. Petalinux is necessary me for supporting hi-level interfaces on Zibo-Z7-10, for using the programs suporting the Internet and some another useful programs. These interfaces are: - Ethernet (Xilinx driver in the SDK do not supports them on Zibo because of it was writen for another phisical level chip); - USB; Thank you. Best regards, Victor.
  4. Hello @zygot, @Ciprian I had no intend to use direct access to GPIO within Petalinux. Earlier I used ready to use driver in Debian. E.g. for PCIe it was only 2 things for using the registers (that were connected to GPIO and so could be controlled with the processor): 1) within the Debian: root...> insmod xbmd.ko 2) in the user program: #include "xbmd.h" ................. uint32_t XPCIe_ReadReg (int fd,uint32_t dw_offset){ io_struct_VC707 q_reg; q_reg.MemAddr=dw_offset; if(ioctl(fd,WRITE_STRUCT,&q_reg)<0){ printf("Error ioctl WRITE_STRUCT \n"); } if(ioctl(fd,READREG,&q_reg)<0){ printf("Error ioctl READREG \n"); } return q_reg.ValueAddr; } void XPCIe_WriteReg (int fd,uint32_t dw_offset, uint32_t val){ io_struct_VC707 q_reg; q_reg.MemAddr=dw_offset; q_reg.ValueAddr=val; if(ioctl(fd,WRITEREG,&q_reg)<0){ printf("Error ioctl WRITEREG \n"); } } ...................... int main(int argc, char** argv){ int df = open( "/dev/vc707_wo_dma", O_RDWR); uint32_t reg if(df>0){ reg = XPCIe_ReadReg(df,(0x3E)); XPCIe_WriteReg(df,(7),reg); } close(df); } No more. I understand that Petalinux is far from Ubuntu, Debian or Raspbian(embedded Linux), but there is a very much steps to use the HW under one. First of all each of these steps necessary deeply to understand. It will take a lot of time. Of course it is my problem, but hundred FPGA designers are forced to learn oneself the steps that will not necessary for them in the main work. For example in this reference 1) Kernel Configuration To enable GPIO in the kernel, the following configuration options need to be enabled: CONFIG_GPIO_SYSFS=y CONFIG_SYSFS=y CONFIG_GPIO_ZYNQ=y Where I have to use these strings ? In the Petalinux configuration process ? In which step ? What is the "y" ? 2) Devicetree [email protected] { #gpio-cells = <2>; #interrupt-cells = <2>; compatible = "xlnx,zynq-gpio-1.0"; clocks = <&clkc 42>; gpio-controller; interrupt-controller; interrupt-parent = <&intc>; interrupts = <0 20 4>; interrupt-controller; #interrupt-cells = <2>; reg = <0xe000a000 0x1000>; }; Where should I use these strings ? In the application program ? What means the expression "[email protected]" I did not met them in the C earlier. 3) Using the GPIO driver from User Space Figuring out the exact GPIO was not totally obvious when there were multiple GPIOs in the system. One way to do is to go into the gpiochips in /sys/class/gpio and view the label as it should reflect the address of the GPIO in the system. The name of the chip appears to be the 1st GPIO of the controller. > [email protected]_2:~# cd /sys/class/gpio/ /* For ZynqMP */ > [email protected]_2:/sys/class/gpio# ls export gpiochip306 gpiochip322 gpiochip338 unexport ............................................................. > [email protected]_2:/sys/class/gpio# cat gpiochip906/label zynq_gpio The above line indicates that gpio 0th pin starts from 906 and ends at 1023 (GPIO has total 118 pins for Zynq) What is the "gpiochip338" ? 4) Demo Application #include <stdio.h> ..................... #include <linux/input.h> #define LED_BRIGHTNESS "/sys/class/leds/led-ds23/brightness" #define LED_TRIGGER "/sys/class/leds/led-ds23/trigger" #define INPUT_EVENT "/dev/input/event0" #define LED_MAX_SPEED 10 #define PERIOD_COEFF 16000 ............................... I do not understand how to tell for Petalinux phisical addresses of the LEDs and Buttons that in the SDK were described as: #define GPIO_0_out 0x41200000 // 4 LEDs #define GPIO_0_in 0x41200008 // 4 Buttons etc,etc. Excuse me for the extra questions. I searched the step by step instruction how to use HW in Petalinux. Now I have lot of difficulties in this way because I have not enought skills in the embedded SW. Thank you. Best regards, Victor.
  5. Hello Cristian it is enought redundant way for me to use the interrupts. I intend to use only usual polling. Can you suggest me how to resolve this task with the ready to use program example for Petalinux? Thank you
  6. @zygot Thank you. I know that OS (acept similar to DOS may be) isolates HW from end user applications, but it does not help me to resolse simple (as I thought earlier) task: - to setting mode of the GPIO port; - to write data to the GPIO port; - to read data from GPIO port.
  7. Thank you. Best regards, Victor
  8. Victor

    How to add USB

    Hello all, Please suggest me how to add USB into Petalinux? Thank you. Best regards, Victor
  9. As I understand you I should change TeraTemo on the to another one. Is it right? Which terminal emulator is appropriate for this purpose? Thank you.
  10. Hello @lonel I have found only: Filesystems-->misc-->gcc-runtime and Filesystems-->misc-->gcc-sunitizer and include both. But gcc still does not work: -sh: gcc: command not found Can you help me to find appropriate item ? Thank you. Best regards, Victor.
  11. Can you suggest me, how to do it ? Thank you.
  12. Hello @lonel Thank for your quick reply. No, in Debian, Ruspbian, Ubuntu after Ctrl^o I go from mc to the same directory of the terminal, from which I call mc and vice versa. Best regards, Victor.
  13. Hi @ JColvin Can you suggest, how to add more convenient edditor than vi ? Thank you, Best regards, Victor
  14. Hello all, I did access to the GPIOs under SDK with the following program: #include <stdio.h> #include "platform.h" #include "xil_printf.h" #define GPIO_0_out 0x41200000 // GPIO_0 output custom 4bits // 4 LEDs #define GPIO_0_in 0x41200008 // GPIO_0 input custom 4bits // 4 Buttons int main() { unsigned char temp; .................................................. *(unsigned int*)(GPIO_0_out | 0x0004) = 0x00000000; // configure GPIO_0_out as output *(unsigned int*)(GPIO_0_in | 0x0004) = 0xFFFFFFFF; // configure GPIO_0_in as input .................................................. temp = *(unsigned char*)(GPIO_0_in); *(unsigned char*)(GPIO_0_out) = temp; return 0; } But under Petalinux direct access to the phisical address does not works. Please help find the API functions - for setting mode of the GPIO port; - for writing to GPIO port; - for reading from GPIO port. Thank you. Best regards, Victor