2010-12-21 20:56:36     BF533-Stamp Sport Help

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

2010-12-21 20:56:36     BF533-Stamp Sport Help

Gary Barbour (UNITED STATES)

Message: 96932   


I've worked with the ADI SPORTs countless times using VDSP but geting the SPORTs working in uClinux on my BF533 Stamp is turning out to be a new adventure. I've scoured every post and doc resource I could find but can't get it going.


Seems easy enough, include the SPORT driver in the kernal build, run modprobe bfin_sport from the system prompt after boot and then the /dev/sportx devices become available.


From my small test application I can open a SPORT and can call IOCTL without any error reported. I setup the SPORT with the structure set for internal clock. I don't have any hardware attached to the SPORT, I have it connected to a logic analyzer.


However, any data write to the SPORT of greater than 1 byte causes everything to lockup.


I'm sure the problem is a SPORT configuration register not getting set properly but the registers are not reachable through the sport driver.


Have you seen this behavior before or have any ideas of what might get the SPORTs going?






My test app is as follows




#define DEFAULT_SPORT "/dev/sport1"


main() {


  struct sport_config config;

  sport_fd = open(sport_path, O_RDWR, 0);

    if (sport_fd < 0)

        printf("failed to open %s\n", sport_path);


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

    config.mode = 1; //

    config.fsync = 1; // frame sync required

    config.word_len = 16;

    config.data_indep = 1; // Data independed frame syncs

    config.int_clk=1; // internal clock

    config.dma_enabled = 1;


    /* Configure sport controller by ioctl */

    if (ioctl(sport_fd, SPORT_IOC_CONFIG, &config) < 0)

        printf("ioctl('%s', SPORT_IOC_CONFIG) failed", sport_path);


    if(write(sport_fd, "AbCd", 4) != 4);

                printf("writing to sport failed");






2010-12-21 21:05:29     Re: BF533-Stamp Sport Help

Aaron Wu (CHINA)

Message: 96933   


You need to set up config.serial_clk as well.




2010-12-22 09:28:33     Re: BF533-Stamp Sport Help

Gary Barbour (UNITED STATES)

Message: 96955   


PERFECT! The SPORTS are up and running now.  Thank you for the help Aaron. It's amazing how easy it is to miss the obvious detail that a second set of eyes sees so quickly.