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

cross mob
LukeCY_Wei
Level 2
Level 2
25 sign-ins First like received 10 replies posted

Hi,

    My math model had many global variables in dsam, and ADS will auto extend and put these variables to psram, but these variables of psram always abnormal, for example as below code section, in this model I must get "1", but I always get "0", when I debugging this scetion, I found Test_Memory become 1 to 0, it's incorrect.

But when I move this variable from psram to other dsram, I will get correct result of "1", have any advices?

Thanks

uint8 Test_Memory=1;  //Psram

if(Test_Memory)
    return 1;
else
    return 0;  // Always return 0, incorrect and Test_Memory abnormal
///////////////////////////////////////
uint8 Test_Memory=1;  //Move to Dsram

if(Test_Memory)
    return 1;  // return correct value
else
    return 0;  

 

0 Likes
2 Replies
LukeCY_Wei
Level 2
Level 2
25 sign-ins First like received 10 replies posted

Please see as below figures, this procedure just reset and stop, not execute, Figure-2 show the incorrect variables.

Figure-1:

correct.png

Figure-2:incorrect.png

0 Likes
Di_W
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 100 likes received

PSPR is for code, you can try DSPR and DLMU.

dw_0-1700821820273.png

 

 

// Force the compiler to put the following global variable into the DSPR0 memory
BEGIN_DATA_SECTION(lmubss_cpu0)
uint32 rdnumdlmu0[BUFFERSIZE];
END_DATA_SECTION

BEGIN_DATA_SECTION(lmubss_cpu1)
uint32 rdnumdlmu1[BUFFERSIZE];
END_DATA_SECTION

BEGIN_DATA_SECTION(lmubss_cpu2)
uint32 rdnumdlmu2[BUFFERSIZE];
END_DATA_SECTION

BEGIN_DATA_SECTION(lmubss_cpu3)
uint32 rdnumdlmu3[BUFFERSIZE];
END_DATA_SECTION

BEGIN_DATA_SECTION(lmubss_cpu4)
uint32 rdnumdlmu4[BUFFERSIZE];
END_DATA_SECTION

BEGIN_DATA_SECTION(lmubss_cpu5)
uint32 rdnumdlmu5[BUFFERSIZE];
END_DATA_SECTION


BEGIN_DATA_SECTION(bss_cpu0)
 uint32 rdnum0[256];
END_DATA_SECTION

BEGIN_DATA_SECTION(bss_cpu1)
 uint32 rdnum1[256];
END_DATA_SECTION

BEGIN_DATA_SECTION(bss_cpu2)
 uint32 rdnum2[256];
END_DATA_SECTION

BEGIN_DATA_SECTION(bss_cpu3)
 uint32 rdnum3[256];
END_DATA_SECTION

BEGIN_DATA_SECTION(bss_cpu4)
 uint32 rdnum4[256];
END_DATA_SECTION

BEGIN_DATA_SECTION(bss_cpu5)
 uint32 rdnum5[256];
END_DATA_SECTION

 

0 Likes