Bennm
June 30, 2008, 9:43am
1
Hi,
I have a problem with global variables in one of my first ARM7 projects.
I declared a variable upside main()
u16 test;
but the output to my UART-terminal-program of the following c-code is 0x62000908:0
test = 42;
sprintf(buffer,"%p:%i",&test,test);
UART_StringSend(UART0, buffer);
Is there a problem with the ram-address? Where could I find the reason for this error? If I declare test inside main() it works!
I have uploaded the Project on my Server: [Download
It’s a sample-code is from [here ](Loading... )](http://munske.de/Temp/STR711-UART.rar )
denial
June 30, 2008, 10:18am
2
Your linker script puts the variable into bank 1 external memory.
Does this bank exist and is it enabled?
Bennm
June 30, 2008, 2:27pm
3
I have no external memory installed in hardware.
Where do I have to change the linker script to make it work? Could you please post the lines that I should change?
denial
June 30, 2008, 3:14pm
4
In file STR71x-ROM.ld change >XDATA to >DATA for section .data and .bss.
That’s in line 131 and 147.
Bennm
June 30, 2008, 3:44pm
5
Thank you very much!
For beginners it’s very difficult to find the solution for those problems because an ARM7 is much more complex than an avr for example - it seems to take long time to get exposed with this Mikrocontroller, but the sparkfun-community is a big help for me!