2009-02-16 13:31:48     Question about SPORT

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

2009-02-16 13:31:48     Question about SPORT

marat gafarov (RUSSIAN FEDERATION)

Message: 69485   

 

When you try to run the test sport_test.c, the program hangs about opening SPORT0:

 

sport = open (SPORT, omode, 0);

 

 

and does not respond to Ctrl + C

 

 

How do I solve this problem?

 

sport_test.c

QuoteReplyEditDelete

 

 

2009-02-19 00:54:04     Re: Question about SPORT

marat gafarov (RUSSIAN FEDERATION)

Message: 69600   

 

Somebody had such problem, please respond!

QuoteReplyEditDelete

 

 

2009-02-19 06:54:40     Re: Question about SPORT

Robin Getz (UNITED STATES)

Message: 69633   

 

Marat:

 

Which release are you using?

 

 

QuoteReplyEditDelete

 

 

2009-02-19 10:38:43     Re: Question about SPORT

marat gafarov (RUSSIAN FEDERATION)

Message: 69642   

 

uClinux-dist-2008R1.5-RC3

QuoteReplyEditDelete

 

 

2009-02-19 11:48:49     Re: Question about SPORT

marat gafarov (RUSSIAN FEDERATION)

Message: 69644   

 

I use bf537-stamp

QuoteReplyEditDelete

 

 

2009-02-20 23:43:37     Re: Question about SPORT

marat gafarov (RUSSIAN FEDERATION)

Message: 69711   

 

...

QuoteReplyEditDelete

 

 

2009-02-23 16:45:10     Re: Question about SPORT

Robin Getz (UNITED STATES)

Message: 69774   

 

Can you try on trunk - it should work.

 

-Robin

QuoteReplyEditDelete

 

 

2009-02-24 10:51:52     Re: Question about SPORT

marat gafarov (RUSSIAN FEDERATION)

Message: 69823   

 

I tried   uImage-SVN-r7745-bf537-stamp.

 

similar

 

 

 

#include <stdio.h>

#include <malloc.h>

#include <unistd.h>

#include <stdlib.h>

#include <fcntl.h>

#include <getopt.h>

#include <string.h>

#include <sys/ioctl.h>

#include <sys/types.h>

 

#include "bfin_sport.h"

#include "ad73311.h"

 

#define SPORT "/dev/sport0"

 

int transmit = 1;

int omode = O_RDWR;

int sport = 0;

int count = 10 * 2 * 8000; /* Only record 10 second */

 

#define BUF_LEN 0x1000

 

int main (int argc, char *argv[])

{

int fd;

char *filename, c;

unsigned short ctrl_regs[6];

struct sport_config config;

unsigned char *buffer = NULL;

 

printf("opening SPORT0\n");

 

sport = open (SPORT, omode, 0);

if (sport < 0) {

  fprintf (stderr, "Failed to open " SPORT);

  exit (-1);

} else printf("SPORT0 is open\n");

 

memset(&config, 0, sizeof (struct sport_config));

config.fsync = 1;

config.word_len = 16;

config.dma_enabled = 1;

 

/* Configure sport controller by ioctl */

if (ioctl (sport, SPORT_IOC_CONFIG, &config) < 0) {

  fprintf(stderr, "failed to config sport\n");

  free(buffer);

  close(sport);

  close(fd);

  return -1;

} else printf("SPORT0 configured\n");

 

/* Write data into sport device through write operation */

printf("transmitting\n");

if (write (sport, "1", 1) != 1) {

  perror (SPORT);

  close(sport);

  return -1;

}

printf("end transmitting\n");

close (sport);

return 0;

}

 

 

results:

 

root: /> tftp -g 192.168.0.112 -r sport_test

root: /> chmod a+x sport_test

root: /> modprobe bfin_sport

root: /> ./sport_test

opening SPORT0

SPORT0 is open

SPORT0 configured

transmitting

^Croot: />

root: />

 

now hangs in the entry in sport0

 

 

the same results I got when using 2008R1.5-rc3

 

I do not understand why this is happening. Even the error messages are not displayed

 

 

 

 

 

sport_test

ad73311.h

bfin_sport.h

sport_test.c

QuoteReplyEditDelete

 

 

2009-02-26 09:55:20     Re: Question about SPORT

marat gafarov (RUSSIAN FEDERATION)

Message: 70006   

 

...

QuoteReplyEditDelete

 

 

2009-02-26 11:17:27     Re: Question about SPORT

marat gafarov (RUSSIAN FEDERATION)

Message: 70015   

 

I can something not so I do?

QuoteReplyEditDelete

 

 

2009-02-28 06:11:46     Re: Question about SPORT

marat gafarov (RUSSIAN FEDERATION)

Message: 70152   

 

...

QuoteReplyEditDelete

 

 

2009-02-28 07:53:20     Re: Question about SPORT

Phil Wilshire (UNITED STATES)

Message: 70154   

 

Try writing more than one data byte to the sport.

 

try 16 or 32.

 

If that fails you will have to look at the sport driver and add some debug there.

 

I assume that you are using internal frame syncs and clocks for the sport.

 

If not and you have no external syncs or clocks you will wait quite a long time for data to arrive !

 

regards

 

  Phil Wilshire

 

 

 

 

QuoteReplyEditDelete

 

 

2009-02-28 07:55:22     Re: Question about SPORT

marat gafarov (RUSSIAN FEDERATION)

Message: 70155   

 

2008r1.5rc3 log: 

 

 

 

Jan 1 01:55:18 blackfin user.debug kernel: sport_open enter

Jan 1 01:55:18 blackfin user.debug kernel: sport_ioctl: enter, arg:0x215e5c

Jan 1 01:55:18 blackfin user.err kernel: config

Jan 1 01:55:18 blackfin user.debug kernel: tcr1:0x400, tcr2:0xf, rcr1:0x400, rcr2:0xf

Jan 1 01:55:18 blackfin user.warn kernel: mcmc1:0x0, mcmc2:0x0

Jan 1 01:55:18 blackfin user.debug kernel: sport_write count:1 dma_tx_chan:4

Jan 1 01:55:18 blackfin user.debug kernel: DMA mode

Jan 1 01:55:18 blackfin user.debug kernel: dump_dma_regs config:0x00a5, x_count:0x0000, x_modify:0x0002

Jan 1 01:55:18 blackfin user.debug kernel: wait for transfer finished

Jan 1 01:55:46 blackfin user.debug kernel: Receive a signal to interrupt

Jan 1 01:55:46 blackfin user.debug kernel: sport_release enter

 

stops on sport_release

 

have any suggestions?

QuoteReplyEditDelete

 

 

2009-02-28 07:59:50     Re: Question about SPORT

marat gafarov (RUSSIAN FEDERATION)

Message: 70157   

 

I will try

QuoteReplyEditDelete

Outcomes