This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[C6748] Interrupt handling without DSPBIOS -- what documentation should I read?

Other Parts Discussed in Thread: OMAP-L138, CCSTUDIO

Hello,

I want to set up an interrupt service routine for the C6748 (OMAP-L138 EVM board) without using dspbios.

I am starting with a simple test: triggering and catching the TMR1 interrupt. Even this is proving too difficult without help.

 

I have read the relevant hardware documentation and I think I now have a clear-ish picture of what to put in which register . What I don't know is how to do that from C.

 

Specifically, I need to know:

* How to globally enable and disable interrupts. E.g. how do I access the CSR register, etc.

* How to access registers like EVTMASK or INTMUX without using a raw pointer.

* How to register an ISR without having to put the pointer myself in the vector table.

...

These are all simple steps but there are too many of them to do this by trial and error or brute force.

I have read the manual of the compiler but it didn't help. I have read the sources of the bsl for my board ( C:\CCStudio_v3.3\boards\evmc6748_v1) but could not find the information I need.

I don't even know where to start looking for the relevant include files in the CCS install folder, so I can't get a clue by looking at them.

The examples that came with the bsl don't use interrupts and I could not find anything in the forum or the wiki that does not use dspbios.

 

Righ now, I am able to trigger a TMR1 interrupt and see it appear on the EVTFLAG register. But I don't know how to enable interrupts globally from C, or how to access said EVTFLAG register without using a pointer, and much less how to properly put the address of my ISR in the vector table (short of actually writing the address there myself ). There's a long way from 'event raised' to 'ISR entered' and every step of the way is uncertain to some extent. It will take me days of trial and error to get this right unless someone points me in the right direction (i.e. documents or ready made example).

Somebody must have passed through this before, there must be some documentation somewhere. I must be missing something.

 

Thank you!

 

  • (redundant post removed)

  • Jose,

    There is an example similar to what you are looking for available as part of the PRU Software Development package. It shows the PRU interrupting the DSP, using only register level CSL (included in the package) and C and assembly code (no DSP/BIOS, no BSL, etc.)

    You can get the installer package here: http://focus.ti.com/docs/toolsw/folders/print/sprc940.html

    The example I'm speaking of can be found in <INSTALL_DIRECTORY>\examples\PRU_PRUtoDSP_Interrupt.  For your purposes, you can ignore all the PRU related items (loading, running, halting the PRU subsystem) and just look at the code to setup and receive an interrupt on the DSP.  Note that the vector table setup is in the assembly file intvecs.asm.

    Regards, Daniel

  • I know this is an old post - but it matches well with my current problem...

    The example referenced is "wrong"

     

    From Main

      // Check to see if the example produced desired result
      if ( LOCAL_examplePassed(PRU_NUM) )
      {
        printf("Example executed succesfully.\n");
      }
      else
      {
        printf("Example failed.\n");
      }

     

     

    Looks good so far... but

     

     

     

    static Bool LOCAL_examplePassed()
    {
      Uint32 *memPtr;

      memPtr = (Uint32 *)EXTERNAL_RAM_START;
     
      // Wait for PRUSS_EVTOUT0 interrupt.
      while ( !PRU_IntReceived );
      if (memPtr[1] == 0x0B)
      {
        printf("\tINFO: PRU interrupt received!\n");
      }
      else
      {
        printf("\tINFO: PRU interrupt received!\n");
      }
      
      return TRUE;
    }


    Always returns TRUE - and always prints the same thing.... so you do not know if your own example works because you botched the testcase.

     

     

     

     

     

     

  • Ken,

       It's best if you start a new thread and then supply a link back to the original. This why we can better track which forums have been answered and which ones are still open. Reposting on threads that are verified also confuses the community as well.

  • Ken Dougherty said:

    static Bool LOCAL_examplePassed()

    {
      Uint32 *memPtr;

      memPtr = (Uint32 *)EXTERNAL_RAM_START;
     
      // Wait for PRUSS_EVTOUT0 interrupt.
      while ( !PRU_IntReceived );
      if (memPtr[1] == 0x0B)
      {
        printf("\tINFO: PRU interrupt received!\n");
      }
      else
      {
        printf("\tINFO: PRU interrupt received!\n");
      }
      
      return TRUE;
    }


    Ken,

    It's not really wrong, as the test case is intended to detect whether the DSP received the interrupt from the PRU.  The LOCAL_examplePassed() function will hang at the "while (!PRU_IntReceived);" statement until the interrupt is actually received and the ISR sets the PRU_IntReceived flag. So, always returning TRUE does make sense since returning at all means the interrupt was received. I'll grant you that the check for the value 0x0B is unnecessary and we could have just had a single print saying that the interrupt was received.  That was probably a cut and paste error.

    Thanks for pointing this out.

    Regards, Daniel