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.

Can not create periodic function with PRD?

Hi all,

I'm using DM6446, I want to create periodic function (using CLK module and PRD module). Here is the configuration

 

bios.PRD.create("myPRD");

bios.PRD.instance("myPRD").order = 1;

bios.PRD.instance("myPRD").period = 1000;

bios.PRD.instance("myPRD").fxn = prog.extern("myPRDfxn", "asm");

bios.PRD.instance("myPRD").fxn = prog.extern("myPRDfxn");

...

bios.SWI.instance("PRD_swi").priority = 14;

 

"Use CLK manager to drive PRD" is checked

 

I create function, that was named "void myPRDfxn(void)". CLK module is created automatically with parameter (input_frequency=27MHz. Microseconds/Int = 1000). But the myPRDfxn function is never called. I try to change many parameters, but haven't yet been successful. 

 

I will high appreciate if someone can help me to solve this problem

 

TungDH

  • Tung,

    The PRD is continuous, and not set up as a one-shot, correct?

    Are you able to successfully run a DSP/BIOS example that uses PRD, such as the stairstep example?

     

  • Hi David,

     

    Yes, I set in the continuous mode.

    I don't have any example, that uses PRD for DM6446. Where do I find it?

     

    Thank you very much

    Regards,

    Tung

  • The location of the examples depends a bit on which version of DSP/BIOS you are using (and you didn't specify a version).  If you have DSP/BIOS 5.41 installed under CCS 4.x in the default location, then you would find the examples at :

    C:\Program Files\Texas Instruments\bios_5_41_03_17\packages\ti\bios\examples

  • Hi David,

     

    It works fine for me now. I don't know what exactly problem, but when I remove printf() function in the myPRDfxn(), it works. Do you know the reason?

    Another problem, When I test with your suggested example, I recognize that my platform support run-time analysis mode (The LOG_printf updates the LOG immediately, and I don't need to Halt the program). But I don't know how can I set up the BIOS into the run-time analysis mode, I often must use the Halt function to show the LOG. Could you help me to configure my platform into the run-time analysis mode?

     

    Thank you very much

    Best regards,

    TungDH

  • Check this post

    http://e2e.ti.com/support/embedded/f/355/p/68883/255342.aspx#255342

    I bet you have the same issue.  You cannot call printf() from HWI or SWI context.  PRD functions run in SWI context.

    If you look at System log details, you should see similar error (*** cannot call ...).

  • Thank David,

    How about the question for enabling run-time analysis mode (The LOG system is updated automatically without halting the program)?

    Thank you very much

    TungDH

  • If you are using an older version of DSP/BIOS, then you need to use RTDX as a means of sending LOG data from the target to the host while the target is executing.  I don't know which version of DSP/BIOS you are using, but be aware that RTDX is getting phased out in favor of using real time analysis tools over physical transports provided by the UART and EMAC peripherals.

    If stop-mode debugging is sufficient for you, I would go with that for now.  If not, there is additional information about RTDX on the web and you can of course always post further questions in the E2E Forum.

     

  • Hi David and friends,

    I have n't yet been successful, the LOG data still does not updates until I halt the program, even though DM6446 was set in real-time mode (In run-time, I saw warning "Warning during: Register, Processor has stoppped in non-interruptible code space! Select Ok and then switch to stop mode until interrupt is allowed; Select Ignore to continue debugging in Real-Time mode.")

    I'm using CCS v3.3.82.13, BIOS 5_31_02, and XDS560R from SpectrumDigital

    In Bios setup, I also set up:
    - Enable RTDX, RTDX Mode JTAG (and both HSRTDX)
    - In Global setting:checked "Enable Real Time Analysis, Use Instrumented BIOS library, Enable All TRC Trace Event Classes"
    On Debug menu, select Real-Time mode

    Do I miss any special configuration? I sure that BIOS and DM6446 supports the above feature (I run the stairstep example, and the LOG data is updated in the run-time)

    Thank you very much for your help
    TungDH
  • Tung,

    From your description it *seems* like you have configured your application correctly for RTA to function.  If that's true, then you need to see if the RTA data is actually being pushed out from the target.  This is done in the Idle Loop (via LNK_dataPump).  Are you using TSK?  If so, then the idle loop will run as the lowest priority task.  You can verify that the idle loop is not getting totally starved by setting a breakpoint on IDL_F_loop to see if it ever executes.

    If you are not using tasks in your application and don't have TSK enabled, or if you set up your system with time-slicing or some other scheme that will not allow the idle loop to run, you can explicitly invoke execution of the idle loop by a call to IDL_run(), which you will need to make sure happens on some kind of periodic basis.

     

  • Hi David,<br>

    By calling IDL_run(), it works fine for me now. Thank you very much.<br>

    TungDH