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.

TMS320F280039C-Q1: Offloading SDFM data to DMA

Part Number: TMS320F280039C-Q1
Other Parts Discussed in Thread: SYSCONFIG

Hello,

 

I have a functioning SDFM module which is receiving a voltage and outputting a value. I want to send this value to a variable I have defined in my program using the DMA

 

See below, the value from SDFM is currently being stored in test1 (in the mainloop of the program). That value is being held in ((int32_t *)(SDFM1_BASE + SDFM_O_SDDATA1 + 1)) which corresponds to the 32-bit value in 0x5E16 and 0x5E17.

image.png 

But this value is not being transferred to the variable I have designated. I am unsure if my DMA settings are incorrect or if this issue lies elsewhere.

See DMA setting below:
image.png

image.png

I initialized the variable voltageCountsPtr based on another inquiry like this:

uint32_t voltageCounts[1];
const void * voltageCountsPtr = voltageCounts;
 
Can TI confirm if the DMA settings are setup to achieve the desired affect?
 
Thank you,
Randy Hirmiz
  • Hi Randy,

    A few things to check:

    1. Make sure you have continuous refresh on in the variable view window
    2. Try enabling the end of transfer interrupt from the DMA, adding a breakpoint, and seeing if it is ever hit. This tells us if the DMA thinks it is completing the transfer or not.
    3. Try manually forcing the DMA trigger in the register viewer of CCS - You can do this by setting CONTROL.PERINTFRC register field

    Other than this, I will check through your settings. Please allow me 2-3 days for this.

    Best Regards,

    Delaney

  • Hello Delaney,

    Thank you for the tips!

    1. Confirmed continuous refresh is on. I have a counter for main loops and it is incrementing.

    2. Confirmed the end of transfer interrupt from the DMA is constantly being hit.

    3. Setting CONTROL.PERINTFRC to 1 in the register field does not appear to produce any results, and it immediately switches back to 0.

    Thank you,

    Randy Hirmiz

  • A related question, is the DMA interrupt separate from the CPU? It does not appear to be stalling my main code from executing. I previously attempted to use the SDFM interrupt to interpret it's samples, but it stopped my main code from excuting. The DMA interrupt does not seem to be causing this same issue.

    Thank you,

    Randy Hirmiz

  • Hi Randy,

    Thank you for trying those tests. I will get back to you when I've had a chance to review your settings. Yes, the DMA is completely separate from the CPU so it is uneffected by debugger halts of the CPU program. However, you can change the DMA emulation mode to have it halt on debugger pauses too. It looks like you have the free run emulation mode set in Sysconfig though (where it says 'Continue DMA operation regardless of emulation suspend...") so DMA will continue running even during a debugger halt.

    Best Regards,

    Delaney 

  • Hi Randy,

    My apologies for the delay. I think I see your issue. The voltageCounts variable is being placed at address 0xA8B8, which is LSRAM5 on this device. 

    The DMA only has access to GSRAM memories. Can you add the below line of code to designate to the compiler that you want to place the voltageCounts variable in GSRAM0?

    #pragma DATA_SECTION(voltageCounts, "ramgs0");

    Depending on the linker cmd file you are using, you may have to add the below line to that file in SECTIONS{} to create the ramgs0 user defined section. 

       ramgs0 : > RAMGS0, type=NOINIT
    

    Best Regards,

    Delaney

  • That was exactly the issue! Thank you so much Delaney!