Hi,
I have the same problem, program stuck at bkpt 0xab, but I do not use serial wire interface (SWI). The Ulink2 is configured JTAG and SWJ checkbox is noch marked. My program runs before I added C++ code (a mix of c and cpp files - main() is in a standerd c file), sprintf() is used now - but not printf(). Any ideas?
Hi Marcus,
o.k. this works. I got the following linker errors now: __use_no_semihosting was requested, but _sys_exit was referenced __use_no_semihosting was requested, but _sys_open was referenced __use_no_semihosting was requested, but _ttywrch was referenced
Questions: If've seen the example SWI with modified startup.s and additional function retarget.c What do I have to change?
Edi
> What do I have to change?
Perhaps having a look at the tool documentation. C'mon, you've been given enough keywords now to be able to do some research on your own.
-- Marcus
I have used the file retarget.c in my project, and have tried to add some code for _sys_open:
------------------------------------------------- #include "rt_misc.h"
#pragma import(__use_no_semihosting_swi)
int _sys_open(const char *name,int return_code) { label: goto label; // endless loop }
void _sys_exit(int return_code) { label: goto label; // endless loop }
void _ttywrch(int ch) { // Not used (No Output) } ------------------------------------------------- Now I have only linker error left: Symbol _sys_open multiply defined (by sys_io.o and retarget.o)
I NEED MORE HELP. Which tool documentation? Believe me I've searched for days before using the forum. The problem is that there are so much documentations the most of them absolutly useless.
A good starting point would be the ARM tool documentation: infocenter.arm.com/.../armlib_ciheeaja.htm
Go to http://infocenter.arm.com, select "Keil embedded development tools > ARM product manuals", and set the search option to "Current set of documents". Enter the search term "semihosting" and have a look at the results.
Have a good weekend -- Marcus
This stupid forum software corrupted my link. Long live USENET. http://infocenter.arm.com
you are right this forum software is not worth the name.
Marcus, I've read in http://infocenter.arm.com already. This is one of the useless documentation, because there are no examples. I've found the following there: " ... However, you cannot reimplement the _sys_ prefixed functions (for example, _sys_read()) when using the standalone C library because they require library initialization. ..." I could replace _sys_exit and _ttywrch but not _sys_open. Is it really not possible to replace _sys_open()?
In an IAR environment you can handle this all with one single linker option. Sooner or later (I think sooner) I'll get crazy with this KEIL *** ...
I do not have more time wasting with that.
may I solve the problem using another device instead of ULINK2? Or is there a much better library?
This issue is specific to the ARM RVCT C library. Agreed, ARM should spend more time providing hands on examples in the documentation. But meanwhile you should have found some examples yourself. Like for instance "%PROGRAMFILES%\Keil\ARM\Examples\Hello\Retarget.c". Hopefully this will give you some more information.
When supported by the tool chain, semihosting is a very useful mechanism in certain situations. If you care, read some background information here: infocenter.arm.com/.../Bgbjjgij.html
last questions, otherwise I use an other development system: 1) Is it possible to get _sys_open handled like _sys_exit? 2) Can I link the softinterrupt bkpt 0xab to an (empty) function of mine? 3) Could 2) help?