2008-07-15 04:09:37     testing the ppi driver

Document created by Aaronwu Employee on Aug 8, 2013
Version 1Show Document
  • View in full screen mode

2008-07-15 04:09:37     testing the ppi driver

edward jiang (CHINA)

Message: 58813   

 

hi all:

 

   i have met a problem with the ppi driver.i compiled it into the kernel,and i can find the

 

interface in "/dev/ppi".

   then, i write a test program to send an array out through the ppi(an FPGA is giving the

 

ppi_clk signal all the time),using 2-D transfer , 2syncs(CFG_PPI_PORT_CFG_SYNC23) and non-itu656

 

(CFG_PPI_XFR_TYPE_SYNC).

 

 

the test code is followed:

 

 

#include <stdio.h>

#include <unistd.h>

#include <sys/types.h>

#include <sys/ioctl.h>

#include <fcntl.h>

#include "bfin_ppi.h"

#define ppi_dev "/dev/ppi"

static int fd = -1;

 

static int init_device(void)

{

if ((fd = open(ppi_dev,O_RDWR)) <0)

{

  printf("error occured in openning\n");

  return -1;

}

  printf("fd = %d\n",fd);

return 0;

}

 

 

static int device_control(void)

{

        ioctl(fd,CMD_PPI_PORT_DIRECTION,CFG_PPI_PORT_DIR_TX);

ioctl(fd,CMD_PPI_XFR_TYPE,CFG_PPI_XFR_TYPE_SYNC);

ioctl(fd,CMD_PPI_PORT_CFG,CFG_PPI_PORT_CFG_SYNC23);

ioctl(fd,CMD_PPI_PACKING,CFG_PPI_PACK_DISABLE);

ioctl(fd,CMD_PPI_SKIPPING,CFG_PPI_SKIP_DISABLE);

ioctl(fd,CMD_PPI_SKIP_ODDEVEN,CFG_PPI_SKIP_ODD);

ioctl(fd,CMD_PPI_DATALEN,CFG_PPI_DATALEN_8);

ioctl(fd,CMD_PPI_PACKING, CFG_PPI_PACK_DISABLE);

ioctl(fd,CMD_PPI_CLK_EDGE,CFG_PPI_CLK_EDGE_RISE);

ioctl(fd,CMD_PPI_TRIG_EDGE,CFG_PPI_TRIG_EDGE_RISE);

ioctl(fd,CMD_PPI_LINELEN,256);

ioctl(fd,CMD_PPI_NUMLINES,1);

ioctl(fd,CMD_PPI_SET_WRITECONTINUOUS,1);

ioctl(fd,CMD_PPI_SET_DIMS,CFG_PPI_DIMS_2D);

ioctl(fd,CMD_PPI_DELAY,0);

}

 

int main(void)

{

int i,m;

char data[255];

if (init_device()<0)

  return -1;

 

 

device_control();

for (i=0;i<256;i++)

   {

    data[i]=i;

   }

 

  while(1)

  {

  printf("before write\n"); 

  m = write(fd,data,256); 

  printf("m = %d\n",m);

  }

close(fd);

return 0;

}

 

when runs the program,the signal displayed in the terminal is all right ,m is 256, but i can't

 

get the frame signal FS1 and FS2 through oscilloscope.

 

when i use ctrl +c to finish the program ,and run it again , but error shows up: "Kernel panic -

 

not syncing: Unable to attach BlackFin PPI Error Interrupt."

 

i don't konw what is wrong with my program or the ppi driver, is anyone tested the driver(both

 

write and read) before?

 

please give me some help,thanks all.

QuoteReplyEditDelete

 

 

2008-07-15 05:11:18     Re: testing the ppi driver

edward jiang (CHINA)

Message: 58841   

 

by the way, is it neccessary to offer the ppi_clk from outside when output or input the data?

QuoteReplyEditDelete

 

 

2008-11-20 06:19:34     Re: testing the ppi driver

Aleksey Anufrikov (UKRAINE)

Message: 65588   

 

About kernel panic try to look here: blackfin.uclinux.org/gf/project/uclinux-dist/forum/

 

The same problem still exist in 2008R1.5-RC3 kernel.

 

About ppi_clk : PPI clock is always external for blackfin

Attachments

    Outcomes