I'm having difficulty still during boot of my STR71x board. Trying to get inherited software running on this board. I chased a sort-of red herring for a while (see my other thread) and have discovered that my problem occurs long before the kernel is even initialized. My problem is with the standard library. During stdio init, (__rt_lib_init -> __initio->freopen -> sys_open) an SWI instruction gets hit. I've gotten this information from stepping through the dissassembly and cross referencing the mapfile with branch instructions- basic grunt work. Now this may be proper, and I have to link in some handler for this specific SWI (which registers would have any parameters?) or it may be a problem with something else. I have some basic questions: - Anyone know what the problem is and a fix? (Sorry, gotta try...) - Who provides the standard library that is used with the realview ARM tools? Is there some support/source? Can the source be debugged within uVision? Is Keil the wrong place to be looking for this support (is it ST? someone else?) Thanks for any help. Steve
Excuse my ignorance, but can you elaborate on this semi-hosting? Also, the 0x123456, I assume is a parameter for the SWI? Which register should I see this in? (I assumed that the parameter would be in R0, as just before the SWI, the disassembly shows it storing the value 1 in R0 and the SP in R1.) 0x4000F9DC 2001 MOV R0,#0x01 0x4000F9DE 4669 MOV R1,SP 0x4000F9E0 DFAB SWI 0xAB So, SWI 1 is one of the RTL handled software interrupts, when I step into the disassembly of that handler, it does go to the area identified in the mapfile: 0x400119b0 0x000000d4 Code RO 3605 SWI_RTX SWI_RTX.o(RTLRTX.lib) So, I believe that the RTL SWI handler is properly linked and mapped. It just decides (for whatever reason) to go away forever: 0x40011A78 EAFFFFFE B 0x40011A78 Thoughts? Thanks, Steve
You need to use a configuration file RETRAGET.C. Example: C:\Keil\ARM\RV30\Boards\Hitex\STR7\Hello Descprition: C:\Keil\ARM\HLP\RVI.CHM - Embedded Programs - Library Retarget Files. Reinhard
Further information on semihosting in chapter 7 of this ARM document. http://www.arm.com/pdfs/DUI0205E_rvct_compiler_and_libraries_guide.pdf Also interesting is Section 2.3.2 Avoiding C library semihosting in the following ARM document. http://www.arm.com/pdfs/DUI0203E_rvct_developer_guide.pdf It will be clear to you then why retarget.c is needed. BTW SWI 0xAB is used in thumb code whereas SWI 0x123456 is used in ARM code to generate the semihosting call.
Thanks both for the helpful responses. I have some reading/further debugging to do. Steve