We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Started this morning on something. Then needed to add printf in simulator mode. So I added putchar() and printf. But then I found that the program didn't run. When I hit RST it is always sitting on line #252 SWI_Handler B Undef_Handler in startup.s
To double check I eventually ran the demo hello.c in program files\keil\arm\examples\hello\hello.c - this works fine.
But when I copy hello.c + serial.c to a new folder and start a new project it compiles fine - but does not run, again it stops on line #252 as above. When I check I find that the Realview compiler is selected and the Configure flash tools shows a tab with C/C++. The startup.s file mentions 2006-2006
On the original hello example it is using the CARM compiler and the configure flash tools shows a tab with just a C on it. The startup file mentions 2002-2004
So there are differences. The c files are identical but the startup.s files are not, the old examples work but compiling new versions with the newer startup.s and Realview don't.
Has anyone had similiar problems, can someone explain what is going on please.
I have discovered the problem. The Hello.c version in Program Files\Keil\ARM\RV30\Examples\Hello works.
This project does use the latest startup.s 2005-2006. But in addition I see two new files are included in the project these are RETARGET.C which iself includes RT_MISC.H
So this is the solution. Does someone know why these files are now required to be included.
It appears that I should rebuild older projects with this new profile, and maybe delete the earlier examples. But I would like to know the advantages / reasons for adding the RETARGET.C file. Maybe this is described somewhere?
This cost me quite a few hours.... I hope this helps others.
I do miss the linker line Program Size: data=xxx const=xxxx code=xxx, Realview does not provide this and I dont know how to enable it.
Please read C:\Keil\ARM\HLP\RVI.CHM. It explains it from an overview perspective.