2011-10-17 14:37:33 Problems with write operation on sport_test application
Rômulo Mendes (BRAZIL)
Message: 103904
We are trying to use the sport_test application on a board with ADSP-BF518 and AD73311 audio codec. Running command "version" on uClinux returns
kernel: Linux release 2.6.34.7-ADI-2010R1, build #254 Fri Oct 14 19:35:34 BRT 2011
toolchain: bfin-uclinux-gcc release gcc version 4.3.5 (ADI-2010R1-RC4)
user-dist: release 2010R1, build #122 Fri Oct 14 19:35:21 BRT 2011
To support this hardware we had to edit some files and enable some options in configuration menu.
We made the following changes:
# sport_test.c
1) The SPORT_ENABLE pin of AD73311 is connected to PG4. According to gpio.h, pin PG4 is defined as 20. That is why we used this value as parameter on function ad73311_enable.
2) The SPORT connected to audio codec is SPORT1, so we changed the DEFAULT_SPORT to /dev/sport1.
# Configuration menu - kernel settings
1) Enabled "Blackfin SPORT driver for direct raw access" on path "Device Drivers > Character Devices".
2) Enabled "OSS Mixer API" and "OSS PCM (digital audio) API" on path "Device Drivers > Character Devices > Sound card support > Advanced Linux Sound Architecture".
3) Enabled "SoC AD73311/AD74111 Audio support for Blackfin" on path "Device Drivers > Character Devices > Sound card support > Advanced Linux Sound Architecture > ALSA for SoC audio support" and selected AD73311.
4) Selected SPORT1 in field "Set a SPORT for Sound chip" on path "Device Drivers > Character Devices > Sound card support > Advanced Linux Sound Architecture > ALSA for SoC audio support"
# Configuration menu - application settings
1) Enabled "common sport test" on path "Blackfin test programs"
After make these changes there was an error on kernel compilation. After running the command "make single" we verified that there was an error in function bfin_write_SPORT1_TX16, defined at cdefBF51x_base.h, on path "linux-2.6.x/arch/blackfin/mach-bf518/include/mach". Here is the compilation error:
sound/soc/blackfin/bf5xx-ad73311.c: In function ‘snd_ad73311_configure’:
sound/soc/blackfin/bf5xx-ad73311.c:127: error: ‘SPORT1_TX16’ undeclared (first use in this function)
sound/soc/blackfin/bf5xx-ad73311.c:127: error: (Each undeclared identifier is reported only once
sound/soc/blackfin/bf5xx-ad73311.c:127: error: for each function it appears in.)
make[6]: *** [sound/soc/blackfin/bf5xx-ad73311.o] Error 1
make[5]: *** [sound/soc/blackfin] Error 2
make[4]: *** [sound/soc] Error 2
make[3]: *** [sound] Error 2
make[3]: Leaving directory `/home/romulo/Desktop/blackfin-linux-dist/linux-2.6.x'
make[2]: *** [linux] Error 1
make[2]: Leaving directory `/home/romulo/Desktop/blackfin-linux-dist'
make[1]: *** [single_] Error 2
make[1]: Leaving directory `/home/romulo/Desktop/blackfin-linux-dist'
make: *** [single] Error 2
In file cdefBF51x_base.h we changed the line
#define bfin_write_SPORT1_TX16(val) bfin_write16(SPORT1_TX16, val)
to
#define bfin_write_SPORT1_TX16(val) bfin_write16(SPORT1_TX, val)
After this change, kernel compiled successfully.
After some debugging, we verified that, in application code sport_test.c, there is a problem on writing control data to control registers by write operation, on function write. After this funtion is called the system reboots. Not even the error message "setting up sport ctrl regs failed" is printed before system reboots. Nothing is printed. The system just reboots, about 10 seconds after execution of this function.
QUESTIONS:
1) The change we made on cdefBF51x_base.h is correct? Without this change we were not able to compile kernel successfully. We grep SPORT1_TX16 and verified that it is not defined. Is it a bug?
2) As you can see in this description, the error occurs right after we try to write something for the first time in AD73311. Please, help us to resolve this problem.
We looked in older posts, but none solved our problem. Please, let us know if you need more information to help us.
Thank you very much!
Rômulo Mendes
QuoteReplyEditDelete
2011-10-18 00:09:48 Re: Problems with write operation on sport_test application
Sonic Zhang (CHINA)
Message: 103910
If want to run sport_test against ad73311, you should not enable "SoC AD73311/AD74111 Audio support for Blackfin". sport_test is a raw sport driver, which may conflict with the ad73311 sound driver.
In addition, please check if the SWs on your bf518-ezbrd is configured properly for SPORT1 PINs.
Your change to SPORT1_TX16 is correct. It was fixed in our SVN trunk.
QuoteReplyEditDelete
2011-10-18 09:39:06 Re: Problems with write operation on sport_test application
Rômulo Mendes (BRAZIL)
Message: 103960
Sonic,
We are not using BF518-EZBRD. The board schematic is attached. Note: in this board schematic SPORT_ENABLE is routed to PH7, but we changed the hardware and now the SPORT_ENABLE signal is routed to PG4.
We disabled "SoC AD73311/AD74111 Audio support for Blackfin", but the error persists. After this, we disabled the option "Sound card support" on path "Kernel Settings > Device Drivers", but the error still persists.
As you can see in the board schematic (sheet 4) there is a non-populated resistor short circuiting SPORT_TX_FSYNC and SPORT_RX_FSYNC. Do we keep it non-populated?
Pins RSCLK1 and TSCLK1 are short circuited (sheet 2). Is there any problem on this?
blackfin_sch.pdf
QuoteReplyEditDelete
2011-10-18 23:42:39 Re: Problems with write operation on sport_test application
Sonic Zhang (CHINA)
Message: 103970
Please attach a gnICE or ICE100B JTAG debugger to locate the crash code line in the driver.
Can you play audio properly via the AD73311 sound driver ?