Hi all,
I'm looking for some advice or any technique I can use to debug this problem:
We have a 5505 pulling data from codec into RAM across I2S0 using channels 0 and 1. The testing of this took place primarily when debugging the target with an XDS100 emulator connected to the board (i.e. running from RAM). When the code is written into EEPROM and the built-in bootloader loads the code, the image runs but DMA does not behave in the same way - we never get our DMA interrupt. In my reading of the documentation it states that SPI transfers do not (can not) use the DMA controller, so it's not the bootloader somehow leaving the DMA in a bad state. In any case, we are re-initializing the DMA subsystem with the appropriate CSL_DMA calls (DMA_init).
Thanks in advance,
Rich
Well, another good hypothesis shot down:
I noticed that the Digital Spectrum aic3204 example code calls BSL function USBSTK5515_I2C_init( ) before configuring the codec via the I2C peripheral, so I did so also, but it made no difference.
Breaking in and re-executing the codec configuration after the code has loaded from Flash and is running still works, with or without USBSTK5515_I2C_init( ).
BRUTE FORCE TO THE RESCUE!
In my main DSP/BIOS task, I added code to count out enough iterations of my processing loop for 2 seconds to pass, then I re-execute configuration of the AIC3204 codec (via I2C).
Voila! When I plug in the 'C5515 ezDSP, I hear
It would seem that the DSP's LDO's are powering up its core and starting it up several seconds before the AIC3204 is ready to deal with instructions from it.
Dan
I'm glad to see you're narrowing down the issue!
D E UngarIt would seem that the DSP's LDO's are powering up its core and starting it up several seconds before the AIC3204 is ready to deal with instructions from it.
In that case I expect an equivalent workaound would be to simply add a 2 second delay loop to the start of your program. Does that also work?
---------------------------------------------------------------------------------------------------------
Please click the Verify Answer button on this post if it answers your question.---------------------------------------------------------------------------------------------------------
Brad Griffis In that case I expect an equivalent workaound would be to simply add a 2 second delay loop to the start of your program. Does that also work?
Thanks for offering your help.
Dear Dan, I am again!!!!
Thanks for help, you are correct about my entry point, in my case the Build Properties… -> CCS Build -> Dependencies was cslV5505 project where my vectors.asm was. I did a copy of vectors.asm to my project folder and disable the dependence with cslV5505 and the error disappears.
http://e2e.ti.com/support/dsp/tms320c5000_power-efficient_dsps/f/109/p/53200/372229.aspx#372229
I succeed record my big .bin file to nor_flash, thanks again but I still with problems.
My application is an audio recorder where sound comes from Codec via I2S that trigger a DMA with ping/pong mode. When ping/pong interrupt occur I storage the ping or pong array (1024 bytes each) in a big array of 16384 bytes (auto-reload). When 16384 bytes are available I record these data to SD card and so on. To start and finish the last part of process (record to SD) I am using the leds and switches found at C5515 ezDSP.
Similar you, I am using the example called aic3204 from Spectrum Digital to initialize and configure the Codec and I think that this part is neither working when I put the code on nor flash. According your post, a delay solves this question. I put a wait of 5 seconds according bellow but the signal still strange.
void main(void)
{
InitSystem(); // configura PLL, habilita todos os
// clock´s e reseta periféricos
ConfigPort(); // Configura barramento
SYS_GlobalIntEnable(); // Habilita as interrupções
IER0 = 0x0000; // Habilita interrupções específicas
IER1 = 0x0000; // Habilita interrupções específicas
Init_SAR(); // Inicializa ADC
gpio_output_pin_test(); // Inicializa GPIO
USBSTK5515_ULED_init(); // Inicializa Leds
USBSTK5515_wait(5000); // Espera 5 segundos
USBSTK5515_I2C_init(); // Inicializa I2C
aic3204_test(); // Inicializa Codec
config_DMA_I2S(); // Configura DMA
mmcFileTest(); // Configura SD
}
Other thing, my ping/pong interrupt is happing because I put GPIO12 high and low on DMA interruption to watch signals with a digital oscilloscope. The signal is very similar when I run via .gel file.
If ping/pong is happing, could I suppose that my DMA configuration after boot-loader is correct? It is because when I run after boot the elapsed SD writes increase more than 3 times (GPIO13 with oscilloscope) and continues to grow until it stops. I put the idle delay to DMA at vectors.asm according Rafael’s post.
Thanks for help!!!
Andrea,
I wrote a wiki page to give tips related to debugging these sorts of boot issues:
http://processors.wiki.ti.com/index.php/Debugging_Boot_Issues
Please use the techniques discussed there as a starting point. Let us know what you find. I suspect something being configured in your gel file needs to be moved into your code.
Brad
Hi Andrea,
I am glad you are making progress. I am currently working on other aspects of my project and on other projects, so my new DSP development skills are already getting a bit rusty. I have been teaching myself by trial and error, so this forum is helpful for both learning and sharing what I have learned.
Your information about Build Properties… -> CCS Build -> Dependencies is interesting - I didn't know there was such a setting. When I examine my own projects, it appears that the entries under this tab reflect whichever projects I have checked under Project -> Properties -> Project References. In fact, clicking the Add.. button under Dependencies brings up the same checklist as under Project References (but in a different order). (I don't know why they have the same setting appear in two different places.) I have observed that if I completely rebuild a project that has another project checked under Project References - usually a library - then the referenced project also seems to get rebuilt. I am guessing that that is the purpose of those entries - to ensure that the referenced project's build is up to date.
The Dependencies entries do not appear to cause any files in the referenced project to be included when building (compiling and linking) the currently active project, however. Actually including specific header files and compiled objects from other projects is controlled by the setting Properties -> C/C++ Build -> C5500 Compiler -> Include Options (direct the compiler where to search for header files) and C5500 Linker -> File Search Path (direct the linker which object and library files to include and where to search for them).
Of course, if you are modifying a source file for your own use, it is best to copy it into your project directory, as you did.
Hi Dan, unfortunatelly the configuration of projects is not trivial :(
Please let me know, where exactly did you put the USBSTK5515_wait() function? where before the audio codec? My attempts
are not working (last post).
Thank you,
Andrea
I don't actually use a USBSTK5515_WAIT( ) function. My code is a bit complicated because I use DSP/BIOS to coordinate different parts of my code with interrupts.
My code first calls aic3204_config() from main( ), but that by itself was not sufficient because it seems that the aic3204 is not yet ready to be configured at this time.
After main( ) completes, DSP/BIOS performs some further initialization, then runs my background task audio_proc( ). audio_proc( ) contains a repeating loop that waits for a semaphore to be set by an interrupt service routine after DMA from the aic3204 has filled half of my input ping-pong buffer. Each time a ping-pong buffer bank has been filled (one frame of 1024 samples), this loop performs some audio processing for me. It also counts how many times the loop has executed. After a certain number of iterations, I call aic3204_config( ) a second time - just once. After that, I seem to get good audio from the aic3204. This extra delay amounts to about two seconds plus whatever time DSP/BIOS intialization takes after main( ) has finished.
So, I am timing the delay to the second time I call aic3204_config() by counting the number of times DMA has filled half the input ping-pong buffer. This was just done as an experiment. Before I tryed using the loop counting approach I just described, I used USBSTK5515_waitusec( 2000000 ) before aic3204_config( ) in main( ) and it was not enough delay. Because I was diverted to other projects, I have not had the time to try longer delays in main( ), but I suspect that lengthening that delay to 4 or 5 seconds might work.
Good luck,
To all of you who are experiencing this problem, I have also done a brute force fix that works for me. I initialize the AIC3204, wait 2 seconds, the re-initialize the AIC3204. This works! For some reason the AIC is not getting properly initialized on the first pass. I hope someone comes up with the actual problem instead of having to resort to brute force.
Thx,
MikeH