Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Wear behavior in the memory

Altera_Forum
Honored Contributor II
934 Views

Hello! 

I have a very very wear behavior in my orogram. I have this code: 

 

//message is a char array const unsigned int* command =((unsigned int*)(message+2));When I observe the debugger 'Variables' tab I can see: 

command 0x02ffcf0a  

*command 1  

 

'1' is the expected value, it's a command that I'm sending to the Nios from my PC. The wear is the next code: 

 

printf("*command = %d", *command); if( (*command) == 1U){ TCPSSReport("Never enters here!!!!!!!!\n"); } The test it's always false. The output is this: 

 

*command = 66684 //The actual value seems to be random 

 

So, the program behavior is very very wrong!. I have no optimization enable. My memory map is the following: 

 

.bss : onchip_mem 

.entry : reset 

.exceptions : onchip_mem 

.heap : sram1 

.rodata : sram2 

.rwdata : onchip_mem 

.stack : sram2 

.data :sram2 

 

the instruction (in the disassambly tab)used to load the variable is 'ldw'. 

 

any ideas what is causing this?
0 Kudos
0 Replies
Reply