• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Digital Signal Processors (DSP) » C5000 Ultra Low Power DSP » C5000 Ultra Low Power DSP Forum » DMA not working when booting from SPI EEPROM, works when running from debugger
Share
C5000 Ultra Low Power DSP
  • Forum
  • Announcements
Options
  • Subscribe via RSS
Top 6 Wiki Links
  • C5000 Main Wiki
  • C5000 Software
  • C5515 Boot-Image Programmer
  • CSL (including CSL 3.00)
  • C5000 Connected Audio Framework
  • Porting C5000 Teaching ROM to C5535 eZdsp
  • Forums

    DMA not working when booting from SPI EEPROM, works when running from debugger

    This question is answered
    Richard von Lehe58975
    Posted by Richard von Lehe58975
    on Oct 22 2010 10:46 AM
    Prodigy200 points

    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

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • D E Ungar
      Posted by D E Ungar
      on Oct 28 2010 11:47 AM
      Intellectual580 points

      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( ).

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • D E Ungar
      Posted by D E Ungar
      on Oct 29 2010 08:40 AM
      Intellectual580 points

      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

      • 1.0 second of silence (board power-up + some of my initialization code), then a
      • 1.8 second burst of scratching and hiss that fades away (probably in response to the first time I configure the codec), followed by
      • 0.6 second of near silence (while my loop counter continues to run), then
      • good sound!

      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

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Brad Griffis
      Posted by Brad Griffis
      on Oct 29 2010 09:09 AM
      Guru57350 points

      I'm glad to see you're narrowing down the issue!

      D E Ungar
      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.

      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.
      --------------------------------------------------------------------------------------------------------- 

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • D E Ungar
      Posted by D E Ungar
      on Oct 29 2010 10:26 AM
      Intellectual580 points

      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?

       

       

      It didn't work when I tried it yesterday, but I am hearing noise out of the codec 2.45 seconds after I plug in the board, so maybe a 3 second delay at the beginning would hit the spot.  I'll try it later.

      Thanks for offering your help.

      Dan

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Andrea Cruz
      Posted by Andrea Cruz
      on Apr 18 2011 18:42 PM
      Intellectual650 points

      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!!!

      bootloader C5515 eZdsp
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Brad Griffis
      Posted by Brad Griffis
      on Apr 19 2011 09:19 AM
      Guru57350 points

      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

      ---------------------------------------------------------------------------------------------------------

      Please click the Verify Answer button on this post if it answers your question.
      --------------------------------------------------------------------------------------------------------- 

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • D E Ungar
      Posted by D E Ungar
      on Apr 19 2011 09:55 AM
      Intellectual580 points

      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.

      Dan


      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Andrea Cruz
      Posted by Andrea Cruz
      on Apr 19 2011 19:39 PM
      Intellectual650 points

      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

      bootloader C5515 eZdsp
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • D E Ungar
      Posted by D E Ungar
      on Apr 20 2011 09:30 AM
      Intellectual580 points

      Hi 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,

      Dan

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • MikeH
      Posted by MikeH
      on Jun 25 2012 11:44 AM
      Guru12685 points

      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

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    12
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use