• 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 » Embedded Software » BIOS » BIOS forum » Interrupt does not occur
Share
BIOS
  • Forum
  • Announcements
Options
  • Subscribe via RSS

Forums

Interrupt does not occur

This question is answered
Max Forster
Posted by Max Forster
on Apr 05 2012 06:56 AM
Prodigy245 points
c6713.txt

Hey everybody,

I am working on evaluating CCSV4, because I change my system to Win7. Therefore I am trying to import my CCSV2.2 projects (with CSL, and Bios 4.9) to CCSV4 and that works now quite fine (see also here and here). Now I tried to debug my old project file on my hardware (C6713), which worked on CCSV2.2 very well.

Unfortunately I have now the problem that it looks like the device does not perform the interrupts. I already checked the registers of the MUXH and the global interrupt flag, which both are set. I added as example my 'Timer1.c' file which use a hardware interrupt as well as a software interrupt afterward, but all other hardware/software interrupts (see picture below) didn't occur as well.

After start of program the dsp runs in the idle functions of bios. So far the CSL settings seems for me to work, because the registers getting set correctly. Did I forgot something else?

Here is the code of the 'Timer1.c':

// Include files ===============================================================
#include <csl.h>                                                                                        //Include Chip Support Library
#include <csl_timer.h>                                                                             //Include Timer chip support

#include "timer.h"
#include "flash.h"
#include "gpio.h"

#include "c6713cfg.h"                                                                                //Generated by DSP/BIOS

// Global Variables ============================================================
// Define Timer handle
TIMER_Handle hTimer1;                                                                          //Handle for Timer1 device


    // Configuration Structure for Timer registers -----------------------------
    TIMER_Config timerCfg1 = {
   
        // Timer Control Register (CTL)
        TIMER_FMKS(CTL, TSTAT, 0)                |                                         //Timer status bit
        TIMER_FMKS(CTL, INVINP, NO)                |                                    //TINP inverter control bit
        TIMER_FMKS(CTL, CLKSRC, CPUOVR4)        |                           //Timer clock source
        TIMER_FMKS(CTL, CP, CLOCK)                |                                    //Set timer to Clock- or Pulse-Mode
        TIMER_FMKS(CTL, HLD, YES)                |                                       //Counter hold bit
        TIMER_FMKS(CTL, GO, NO)                    |                                       //Timer GO Bit. Resets and starts counter
        TIMER_FMKS(CTL, PWID, ONE)                |                                    //Pulse width bit
        TIMER_FMKS(CTL, DATIN, 1)                |                                          //Define TINP to be logic high or low
        TIMER_FMKS(CTL, DATOUT, 1)                |                                      //Data output bit
        TIMER_FMKS(CTL, INVOUT, NO)                |                                    //TOUT inverter control bit
        TIMER_FMKS(CTL, FUNC, TOUT),                                                  //Define function of TOUT
   
        // Timer Period Register (PRD)
        TIMER_FMKS(PRD, PRD, OF(0)),                                                   //Define timer period
   
        // Timer Count Register (CNT)
        TIMER_FMKS(CNT, CNT, OF(0))                                                     //Holds current counter value
    };
   

    // initTimer1() ============================================================
    void initTimer1(void){
        hTimer1 = TIMER_open(TIMER_DEV1, 0);                                    //Open Timer1 device
        TIMER_config(hTimer1, &timerCfg1);                                             //Load configuration structure into Timer1
        TIMER_setPeriod(hTimer1, TIMER_PRD);                                    //Load PRD register with period time
        TIMER_start(hTimer1);                                                                      //Kick off Timer1
    }

    // HWI_Timer1() ============================================================
    void HWI_Timer1(void){
        TIMER_pause(hTimer1);                                                                    //Pause Timer1
        SWI_post(&processTimer1Swi);                                                      //Call software interrupt
        TIMER_start(hTimer1);                                                                       //Reset and restart timer
    }

    /****************************************************************************************************************
     *                                                                                                                *
     *  ========= processTimer1() ==========                                                                        *
     *                                                                                                                *
     *    Processing function that gets called out of HWI_Timer1() in Timer1.c, which is called every 125ms             *
     *    after Timer1 generated a hardware interrupt.                                                                 *
     *                                                                                                                *
     *    Furthermore, every 5 seconds the function will check the save2flash flag, that                                *
     *    indicates if an important setting that should be saved for next startup has bee changed. If yes, all recent *
     *    variables needed for audio processing will be stored on flashposition 0x90020000 of the 29LV400 memory.     *
     *  On the next bootup, the DSP will restore these settings by reading out the FLASH at beginning of main().    *            *
     *                                                                                                              *
     ***************************************************************************************************************/
    void processTimer1(void){
   
        static Uint8 pin_toggle = FALSE;
        static Uint16 count1      = 0;
        static Uint16 count2      = 0;
       
        if (++count1>LED_TIME) {                                                              //Toggle 'Still Alive'-LED
            count1 = 0;
            if (pin_toggle) {
                GPIO_pinWrite(hGPIO, GPIO_PIN15, 0);
                pin_toggle = FALSE;}
            else {
                GPIO_pinWrite(hGPIO, GPIO_PIN15, 1);
                pin_toggle = TRUE;}
        }
   
        if ((++count2>SAVE_TIME)&(save)) {                                            //Save settings to Flash
            count2 = 0; save = FALSE;
            save_settings();
        }
    }

I added my *.tcf file as well, maybe there is something I must now activate compared to the old *.cdb file but is not imported correct?

I am happy about any idea regarding that issue. Thanks...

Regards,

Max

P.S: Please rename the *.txt to *.tcf.

C6713 CSL CCSv4.1
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Steven Connell
    Posted by Steven Connell
    on Apr 09 2012 13:06 PM
    Mastermind20600 points

    Max,

    Are you using the DSK 6713 board?

    One thing I noticed in your *.tcf file is that you are loading the generic platform instead of the standard DSK 6713 platform.  I see that your clock rate is different than the rate that's set in the DSK6713 platform file, which sets it to 225MHz.

    It also configures the following function to be called, which is missing from the generic platform setup code.

    /* Plug user init function to program PLL */
    bios.GBL.CALLUSERINITFXN = 1;
    bios.GBL.USERINITFXN = prog.extern("GBL_setPLLto225MHz");

    If you are using the DSK 6713, can you try loading the standard platform file for your board?  Just add the following to your *tcf file:

    utils.loadPlatform("ti.platforms.dsk6713");

    Steve

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Max Forster
    Posted by Max Forster
    on Apr 16 2012 04:24 AM
    Prodigy245 points
    mcwd20_init.c

    Hi Steve,

    sorry for my late answer, but I was traveling last week.

    No, I am not using the DSK6713, our project is/was based on some of the examples for the DSK6713, but now we have our own hardware. Which is for example set to 200MHz instead of 225MHz, therefore I set the PLL in the init function, which should be called out of the bios (it is set correctly in the *.tcf file, it is called "SYS_init", please see also attached file 'mcwd20_init.c').

    Also I can see the timer running (CNT1 register) in the debug session, but my breakpoint in:

    // HWI_Timer1() ============================================================
    void HWI_Timer1(void){
        TIMER_pause(hTimer1);                                                    //Pause Timer1
         SWI_post(&processTimer1Swi);                                     //Call software interrupt
         TIMER_start(hTimer1);                                                      //Reset and restart timer
    }

    is never called. So the interrupt never occurs and it looks like, as if the whole program is running just in the bios (rta.s62).

    Could it be, that the PLL configuration is not accepted or overwritten by the GEL file? I can watch all registers in the debug session, but where are the PLL registers? Would be good if I could check if they are set to the correct values?

    I use the example bootloader to load my application from flash after start-up, but in that the PLL is not set, may that cause the problem (similiar to that example: http://processors.wiki.ti.com/index.php/Flashing_the_C6713_EVM)?

    Thanks in advance for every hint to that issue.

    Regards,

    Max

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Max Forster
    Posted by Max Forster
    on Apr 16 2012 05:15 AM
    Prodigy245 points

    Hello everybody,

    I had a new observation, I got no *.pp file for my bootloader file, does that mean the compiler is not handling it? (I mentioned it in my reply before, the bootloader is similiar to the file TI described here: http://processors.wiki.ti.com/index.php/Flashing_the_C6713_EVM and therefore written in assembler).

    Regards,

    Max

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Alan DeMars
    Posted by Alan DeMars
    on Apr 16 2012 17:32 PM
    Suggested Answer
    Genius14105 points

    Max,

    Have you enabled the timer interrupt?

    I'm pretty sure that configuring the interrupt in the TCF file does not cause it to be enabled at runtime.

    You should use C64_enableIER(0x8000) to set interrupt 15's corresponding bit in the IER register.

    Alan

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Max Forster
    Posted by Max Forster
    on Apr 18 2012 09:53 AM
    Prodigy245 points

    Hey Alan,

    I use the CSL commands:

            //Initialize Hardware Interrputs ==================================
            IRQ_enable(IRQ_EVT_EDMAINT);                                        // Enable EDMA interrupt to CPU (IER)
            IRQ_enable(IRQ_EVT_TINT1);                                              // Enable TIMER1 interrupt to CPU (IER)    
            
            IRQ_globalEnable();                                                                // Turn on global interrupts (GIE)

    to activate the interrupt(s) (in this example also Timer 1).

    In the debug window I saw that either MUXH is set correctly by default to Timer 1 and GIE is set correctly active. My IER register is set to 0x000000A, but I didn't found an clear explanation about that register. Where can I read some information about that register?

    Just for my understanding, in *.cdb the configuration of interrupt and so on was done in bios configuration, in *.tcf it is not? So this phrase

    bios.HWI_INT15.fxn = prog.extern("HWI_Timer1");

    bios.HWI_INT15.useDispatcher = 1;

    in *.tcf does not mean that the interrupt dispatcher is configured? I will have a look at the CSL description of IRQ handling maybe that will help. Maybe some of you guys have a good described document where handling of interrupt is explained if using CSL and CCSV4 -.-

    Regards,

    Max

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Max Forster
    Posted by Max Forster
    on Apr 18 2012 09:55 AM
    Prodigy245 points

    It's me again. There is definitv something different in using the interrupts, because I now use the function to debug a little bit more and my program hangs up:

    while (!IRQ_test(IRQ_EVT_TINT1));

    Regards,

    Max

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Max Forster
    Posted by Max Forster
    on Apr 19 2012 02:50 AM
    Prodigy245 points

    Hi everybody,

    one more question where can I get some information regarding the bits of CPU IER register? I searched the datasheets and user guides but I can not find a description of that register!

    Regards,

    Max

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Steven Connell
    Posted by Steven Connell
    on Apr 20 2012 12:33 PM
    Mastermind20600 points

    Max,

    Max Forster
    therefore I set the PLL in the init function, which should be called out of the bios (it is set correctly in the *.tcf file, it is called "SYS_init", please see also attached file 'mcwd20_init.c').

    Are you positive that this is being done? Can you verify that this PLL initialization code is running?

    Max Forster
    Could it be, that the PLL configuration is not accepted or overwritten by the GEL file?

    Yes, this could be possible.  However, since the GEL file functions are run when the code is being loaded onto the target, I expect your run-time settings to win in this case (the run time settings overwriting the GEL settings).

    Max Forster
    where are the PLL registers? Would be good if I could check if they are set to the correct values?

    I found PLLCSR register addresses and information in a table in the guide "http://www.ti.com/lit/ds/sprs186l/sprs186l.pdf"

    Steve

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Steven Connell
    Posted by Steven Connell
    on Apr 20 2012 13:02 PM
    Mastermind20600 points

    Max,

    The IER register is the "interrupt enable register."  It is a bit mask that tells you which interrupts are enabled or disabled.  The bit numbers correspond to interrupt numbers.

    For example, in the following screen shot, I see that interrupt number 5, 6 and 14 are enabled:

    Steve

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Max Forster
    Posted by Max Forster
    on Apr 24 2012 00:16 AM
    Prodigy245 points

    Hi Steve,

    thank you for your response. I checked the PLL by watching the function calls in debug session, but I can not see the PLL registers you described in my 'Registers' window (also I am not able to "open" the IER field like you have done in your screenprint). But I think the whole problem is much more simple, but I was not aware of it: http://processors.wiki.ti.com/index.php/CSL_and_DSP_BIOS

    It looks like my problem is because I used the CSL libary to enable, init and configure my interrupts. I will try the recommondations which are described there to convert my old project style to the new one which uses the API commands.

    Regards,

    Max

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Max Forster
    Posted by Max Forster
    on Apr 26 2012 03:12 AM
    Verified Answer
    Verified by Max Forster
    Prodigy245 points

    Hey everybody,

    finally it is working, my old CCSV2.2 project, with Bios4.9 and CSL is running in CCSV4 with Bios5.x (and under Windows7)! Alan was somehow right in his post long time ago.

    As I wrote it in my last post, it is not possible to use old fashion of using interrupts (CSL and Bios4.9) in new Bios5.x or greater (see also the links I posted before). So you have to replace the IRQ_enable() functions with C62_enableIER(1 << IRQ_BIT_POSITION) (I use C6713 dsp, which works fine with C62_enableIER() function if you are using C64 derivat you must use C64_enalbeIER() as Alan wrote it in his post) to set the corresponding IER bits of the interrupts! Additional you must delete the #include csl_irq.h out of your project and also the IRQ_globalEnable().

    I just have now one small issue (which is not really a problem, but I would feel better if it would disappear) after I include the C62_enableIER() functions I now have a "function declared implicity" warning if I compile, which header I have to include to fix that?

    Thanks everybody again for the hints and tricks!

    Best regards,

    Max

    P.S: Here is the whole process to convert CCSV2.2 project (CSL, Bios4.9, XDS510USB) to CCSV4:

    Convert Bios

    1) Go to CCSV4\bios_5_41_10_36\packages\ti\bios\config\cdb folder and make a backup of c6x1x.cdb file (or the corresponding seed file to your plattform)

    2) Start gconf tool which is located in CCSV4\bios_5_41_10_36\packages\ti\bios\config\gconf\bin

    3) Open your old *.cdb file, it will be converted

    4) Go back to CCSV4\bios_5_41_10_36\packages\ti\bios\config\cdb folder, the seed file is deleted (whatever reason) rescue the file out of your backup

    5) Open the *.tcf file, which should now be in your project folder with the gconf tool, if you can open it that was the first step :)

    6) Download CSL (http://www.ti.com/tool/sprc090) from ti homepage, unzip/install it in your CCSV4 installationfolder

    7) Start CCSV4 and use the 'Project>Import Legacy CCsV3.3 Project Option' on your project

    8) Add your new *.tcf file to the project (I think you can delete the *.cdb file out of the project tree)

    9) Go to Project>Properties and add your CSL\Include folder to "Include Options" in Compiler options and to "File Search Path" in Linker options

    10) Copy the c6713cfg.cmd file from the „new“ location, which is created from CCSV4 in your project folder (e.g.: ‘projectlocation/projectname/Debug/’), to your project folder! (If you don’t do your changes of *.tcf file will be ignored)

    11) Compile!

    Add CSL support

    Add CSL6713.lib directly to the linker (Project Settings>C/C++ Build>C6000 Linker>File Search Path -> Include libary file or command file as input) additional you may have to add folder of the libary to the search path.

    Replace interrupt processing of CSL by API

    Like described here.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
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