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.

DMA Transfers to CRC Module in 64-bit Mode Timing Measurement

Other Parts Discussed in Thread: TMS570LS20216, TMS570LS3137, HALCOGEN

Hi there,

I'm using the TMS570LS3037 RTI module compare block 1, fed with a frequency of 30 MHz, to measure the time taken by the DMA to transfer all 2 MB of Flash to the CRC module, every 10 seconds. The RTI is configured with both DMA and INT enabled for compare block 1. The CRC module is configured to generate interrupt when the compression is complete.

I set breakpoints in both the RTI Compare Block 1 ISR and the CRC Compression Complete ISR. Sometime the breakpoints of both ISRs are reached correctly, so I can calculate the elapsed time between them using the recorded RTIFRC1 values, but most of the time, only breakpoint in the CRC Compression Complete ISR is reached.

Is there any explanation on this? Am I allowed to enable both DMA and INT for a given RTI compare block?

Also, I've measured a time of 41 ms for the 2 MB transfer, is this something that makes sense for this MCU clocked at 120 MHz?

I'm using the IAR compiler tools chain.

Thanks!

  • Sorry and never mind! The interrupt configuration has not been performed correctly.

    And yes, it is possible to enable both RTI DMA and INT for a given compare block simultaneously.

    Regards.

  • Glad you were able to resolve this.

    Happy coding.

  • Yeah, there has been a subtle "improvement" in the latest Hercules MCU TMS570LS3137, in which when an INT is generated, the VIM defaults to bypass the address 0x18 and go directly in the designated ISR. With the previous TMS570LS20216, the call to ISR is routed to address 0x18 then to the ISR.

    Therefore, my ISR was called once then got lost for good (never come back for the next INT).

    Regards.

  • Chuck,

    Ok.  The Cortex R4 does have a significant improvement in that you can vector directly to your ISR through the VIC port instead of routing all interrupts through 0x18 and having to dispatch from there.   If you think about this in the context of a very fast processor - one that runs faster than the flash memory system it especially makes sense since not only does the extra step at 0x18 take cycles but it's also another discontinuity in the instruction fetch sequence which introduces it's own penalty.

    But to be clear, you have control of whether or not to turn this feature on.  So if you don't like it you can disable it.  And that also applies for the TMS570LS20216.  The control is through the CPU's System Control Register in the System Control Coprocessor;   the bit name is "VE" and it defaults to '0' meaning IRQs vector to 0x18.  So the init code is actually changing this to a '1' to make use of the VIC.  

    Through HalCoGen you can control how this bit is initialized here:


    If you run into anything else like this please keep posting your quesitons.... In this case I wouldn't say the feature is subtle but it's more like an important feature in a sea of hundreds of other important features;  hence the need for HalCoGen.

     

  • Hey Anthony,

    I read the TRM and also have found that VE=0 is default, however if you look at the following screen capture of the IAR workbench, The CP15 SCTLR.VE bit is '1' before __iar_program_start is executed, so somewhere there must be an undocumented feature being executed.

    I'll ask IAR to explain on what has actually happened.

    Thanks again!

  • For some reasons the reset of the MCU was not completely performed on my previous screen capture, the last state of VE was retained.

    After re-downloading the code, VE=0 by default. This VE bit has been set to '1' by IAR startup code later during initialization.

    So this is solved.

    Thanks.