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.

TMS320F280025C: Can't run Delay_us function on RAM

Part Number: TMS320F280025C

Dear expert, 

 

We are trying to run Delay_us() on RAM. 

As I know this function is required to run on RAM. 

After adding below pragma code, I saw that when I called DELAY_US() inside ISR running from Flash. 

DELAY_US() still run on flash. 

I have to also move ISR to run on RAM to make DELAY_US() run on RAM. 

Is this a requirement moving ISR from Flash to RAM when calling RAM function inside?

May I grant your help for this? 

 

# pragma CODE_SECTION (SysCtl_delay ,".TI.ramfunc")

#define DEVICE_DELAY_US(x) SysCtl_delay(((((long double)(x)) / (1000000.0L /  \
                              (long double)DEVICE_SYSCLK_FREQ)) - 9.0L) / 5.0L)

 

ISR run on Flash => But Delay_us can't run on RAM

image.png

Move ISR to RAM => Delay_us can run on RAM

image.png

.mapimage.png

 

Best Regards,

Eric Chen

  • Hi Eric,

    Can you step into DEVICE_DELAY_US function and then check the PC in both case.

    Regards,

    Vivek Singh

  • Dear Vivek, 

    From my screenshot, I have already stepped into this function. 

    As you see this function is only math calculation without any otherelse. 

    # pragma CODE_SECTION (SysCtl_delay ,".TI.ramfunc")
    
    #define DEVICE_DELAY_US(x) SysCtl_delay(((((long double)(x)) / (1000000.0L /  \
                                  (long double)DEVICE_SYSCLK_FREQ)) - 9.0L) / 5.0L)

    Below statement, DEVICE_DELAY_US function is already copied to RAM by pragma. 

    Case1. Step into one by one with ISR on RAM

    Case 2. Step into one by one with ISR on Flash

    Best Regards,

    Eric Chen

  • I mean, step into SysCtl_delay

    Vivek Singh 

  • Hi Eric, any further update or query ?

  • Dear Vivek, 

    I already stepped into SysCtl_delay.

    Please see the video, also packed the whole project over here for you. 

    0336.epwm_ex13_up_aq.zip

    Best Regards,

    Eric Chen