USB FX3 CyU3PSysCacheIRegion() problem

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hello,

I have a some problem with undestanding of how CyU3PSysCacheIRegion() function works at my Ez-USB FX3 DVK board.
I want to place a simple assembly function that generates impulses on the GPIO[0] pin into the I-Cache for fast implementation. At first call of my function I see on the logic analyzer's screen that NOP operations are implemented at frequency 100 MHZ. At second call of my function NOPs are implemented at 200 Mhz. What can I do for the correct ipmplementation of NOPs at 200 Mhz in my function at first call?

The peace of C code is:
//----------------------------------------------------------
    CyU3PSysEnableICache();
    CyU3PSysFlushICache();
    CyU3PSysCacheIRegion((uint32_t*)0x40009ba0, 0x0800);

    CyFX3GpioSetValN();
    CyFX3GpioSetValN();
    CyFX3GpioSetValN();
    CyFX3GpioSetValN();
    CyFX3GpioSetValN();
    CyFX3GpioSetValN();
    CyFX3GpioSetValN();
    CyFX3GpioSetValN();
//----------------------------------------------------------

The 0x40009ba0 is address of first operation in my function into SRAM.

Assembly code of my function is:
//------------------------------------------------------------------
.global CyFX3GpioSetValN
CyFX3GpioSetValN:
push    {r4, r5, r6, lr}
    //ldr r5,  [r4,]            // # 0xe0001100
    mov r5, # 0xe0000000
    mov r6, # 0x00001100
    add r5, r5, r6                //Address of GPIO[0]
    mov r4, # 0x80000030//-2147483600   
    mov r6, # 0x80000031           
    str r4, [r5]                //Set gpio to  LOW
    str r6, [r5]                //SET gpio to HIGH
    NOP
    NOP
    NOP
    NOP
    NOP
    str r4, [r5]                //Set gpio to LOW       
    NOP
    NOP
    NOP
    NOP
    NOP
    pop        {r4, r5, r6, r7, pc}

.end
//------------------------------------------------------------------

Also, I have interested of minimal Length of code region that I can put into I-cahce with the help of CyU3PSysCacheIRegion() function.

Regards,
-EugeneR

0 Likes
3 Replies
Anonymous
Not applicable

 Hi,

   

I will try to recreate this on my side and let you know.

   

Regards,

   

- Madhu Sudhan

0 Likes
Anonymous
Not applicable

 Hi Eugene,

   

Can you please share your whole project here?

   

Regards,

   

- Madhu Sudhan

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi,

   

This is the project

   

Regards

   

-Eugene

0 Likes