Argument is passing incorrect address

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

cross mob
Anonymous
Not applicable
        Hello   
To pass constant char address is bad.   
It seems a random data or random address was passing through   
On 8C21434, that have 512Byte SRAM (Large memory model)   
Enable paging option and   
Treat const as RAM option not for help   
Do you think what is wrong?   
   
///////////////////////////////////////////////////////   
static char buf[32];   
void SubTest( const char* str )   
{   
//..cstrcpy( buf, "Test2" ); <--- this is good   
... cstrcpy( buf, str ); <--- this is BAD   
... UART_Send( buf ); <--- think like as LCD_PrString();   
}   
///////////////////////////////////////////////////////   
void main()   
{   
... SubTest(" Test1 "); <--- call from here   
}   
///////////////////////////////////////////////////////   
   
This was not occur on another device, ever   
C24223 (small memory model)   
0 Likes
1 Solution
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

I compiled this in both Imagecraft and HiTech, both compiled

   

without any errors.

   

 

   

I think you just needed the additional #includes.

   

 

   

Regards, Dana.

View solution in original post

0 Likes
3 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

I compiled this in both Imagecraft and HiTech, both compiled

   

without any errors.

   

 

   

I think you just needed the additional #includes.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable
        Oh sorry, I am quite forgot this my post   
I have been reporting to older article, here   
http://www.cypress.com/?app=forum&id=1573&rID=86388   
   
Thank you Dana-san   
I have learn..   
1) Don't miss        (this is not missed in my case)    
2) Don't overlooking any WARNINGs    
Especially missing function prototype is cause of Fatal.    
That is it.   
0 Likes
Anonymous
Not applicable
        1) Don't miss [ string.h ] (this is not missed in my case)   
0 Likes