2009-12-18 00:35:52     STAMP SPORT isnt working

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

2009-12-18 00:35:52     STAMP SPORT isnt working

Muhammad Ali (PAKISTAN)

Message: 83661   






I am having problems accessing SPORT through uClinux on a fresh STAMP board. By fresh i mean, i havent changed anything. its just out of the box.




I have also tried the sport_test.c by putting in some printf statements for debugging. But it also stucks when i call IOCTL for SPORT configuration.




whereas my code gets  stuck at "write" statement for SPORT.




attached is my code. please guide as where am i doing wrong.






2009-12-18 01:45:40     Re: STAMP SPORT isnt working


Message: 83663   




Please tell us the type of board, kernel version and anything that would help us to reproduce your issue when you ask questions. Or you can simply do a "make bugreport" in uclinux-dist/ and attach bugreport.tgz here.


Also please use latest 2009R1-RC6 release and toolchain.






2009-12-18 08:30:01     Re: STAMP SPORT isnt working

Muhammad Ali (PAKISTAN)

Message: 83696   


This is what i get on version command.


Linux release, build #1 Mon Aug 20 16:34:38 CST 2007

release 2007R1, build #1 Mon Aug 20 16:45:54 CST 2007


I did not change any thing in the STAMP. No change in distro either.


I tested the same code on the other sport and found out that the clocks are working, data is being transmitted (checked with oscilloscope) but cant get TFS.


I cant really say why my SPORT0(/dev/sport0) isnt working with the same code that works on SPORT1 (/dev/sport1)


So the problem now is


1 - sport0 not working whereas sport1 is working on the same code (i did take care of dev/sportx)


2 - absense of TFS


3 - since no TFS, no loopback of DTO and DTI




any ideas ???




2009-12-18 09:02:39     Re: STAMP SPORT isnt working

Muhammad Ali (PAKISTAN)

Message: 83697   


Ok, i have good news and bad news


I am now able to transmit data, have TFS , TSCLK.


Clock frequencies are stable as programmed .


the problem now is.




1 - SPORT0 still not working


2 - Cant loopback the data 


I have tied RFS1 to TFS1 , RSCLK1 to TSCLK1 and DR1 to DT1.


but cant get anything after "read" function.




attached is my code






2009-12-18 09:43:56     Re: STAMP SPORT isnt working


Message: 83698   


2007R1 is too old and it is not supported now. Could you try latest 2009R1-RC6 release (download from this website).






2009-12-19 07:48:22     Re: STAMP SPORT isnt working

Muhammad Ali (PAKISTAN)

Message: 83746   


ok i've upgraded  to new release 2009R1-RC6 release. I had to load it into RAM on every boot because the flash memory in STAMP is only 4 MB anyhow, i am running the new distro now.




The cases are the same.


I am running in NORM_MODE


This is my progress so far.


- I have been able to generate 2 MHz TCLK1 and 8KHz TFS1


- I have been able to transmit data on DT1




here is what i havent been able to do .


- cant receive the sent data , --- i tried this by looping back DT1 to DR1 , TCLK1 to RCLK1 and TFS1 to RFS1



please guide what am i doing wrong ???




-cant program the SPORT into TDM_MODE--     if i run a program with mode = TDM_MODE, it halts right after configratio


(IOCTL call) which follows a write instruction in normal flow, so i have to perform a CTRL+C to return to console. but if i remove the write instruction, the program exits just fine but ofcourse its of no use.


Another strange behavior i am experiencing is, after i CTRL+C bak to console, any application that involves SPORT halts at write instruction. so i have to restart the STAMP.




attached is my code.


Please guide.


bf.c is the one that writes but does not receive


bf_TDM.c is the one which just has TDM mode enabled and rest of the code is same. but it halts as described above.







2009-12-20 23:10:42     Re: STAMP SPORT isnt working


Message: 83770   




It is good that you can reproduce your issue on 2009R1-RC6. However, the information your provided is still not enough for us to reproduce your issue, e.g, what is the blackfin chip your are using, 537 or 533? Toolchain? How to build & run your test case?


Please read:   docs.blackfin.uclinux.org/doku.php?id=processes#reporting_a_bug






2009-12-22 07:09:37     Re: STAMP SPORT isnt working

Muhammad Ali (PAKISTAN)

Message: 83841   


I added some printk statements to bfin_sport.c , the default driver for SPORT . and found out that if i configure sport in TDM mode, it gets stuck at  if (wait_event_interruptible(dev->waitq, dev->wait_con ) < 0)i can say so because it never shows my next printk message after showng waiting for transfer to finsih. any clues why is this happening ???




I have tried with both, DMA and non DMA.



dev->regs->tcr1 |= TSPEN;

printk(KERN_ALERT "TSPEN enabled\n"); //m-ali



pr_debug("wait for transfer finished\n");

printk(KERN_ALERT "waiting for transfer to finish\n"); //m-ali

if (wait_event_interruptible(dev->waitq, dev->wait_con ) < 0) {

pr_debug("Receive a signal to interrupt\n");

dev->wait_con = 0;





also, i was wondering if i can write a driver of my own using the built in write / read functions to access registers.. but couldnt find where the headers were for that. please guide .