Keil Logo

How to use semihosting?

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Read-Only
Author
William Glass
Posted
9-Apr-2010 18:18 GMT
Toolset
ARM
New! How to use semihosting?

I'm developing an application to run on an Atmel SAM7S and I'm currently using an AT91SAM7S-EK board for testing. The final product will have rather simple software that has no need for an operating system and the Micro Library is more than enough for run time support.

But during testing, I thought it would be nice to test my data processing algorithms on data sets that I've recorded in files on my PC. Semihosting sounded like it should do just what I wanted - I could call fopen() from my SAM7S code, read some data with fread(), and then let my normal data processing algorithms run. I added the code to my program and set it to use the standard library instead of MicroLib. But when I tried to run it, the program hangs at SWI_Handler in the SAM7.s startup file.

It looks like during initialization (before main is called), a routine called init_io() is called which then calls freopen() which calls sys_open(). That last routine contains a SWI 0xAB instruction and that's where I die. I even created a simple "Hello World" program and it dies in exactly the same way.

Am I missing something obvious (it wouldn't be the first time)? I thought that the uVision debugger was supposed to catch the SWI instruction and perform the I/O operation on the PC. Or am I trying to do something that can't be done (which would explain why I can't find any sample code or information in the documentation).

Any help to point me in the right direction would be appreciated.

Read-Only
Author
Drew Barbier
Posted
13-Apr-2010 04:13 GMT
Toolset
ARM
New! RE: How to use semihosting?

Keil MDK-ARM does not support semihosting, although I'm having trouble finding a link that clearly says this.

You are free to re-impliment semihosting functions to do as you like (ie read from a uart or flash drive), but for true semihosting RVDS is necessary.

Usefull links:

http://www.keil.com/support/man/docs/gsac/gsac_retargetcortex.htm

http://www.keil.com/support/man/docs/armlib/armlib_ciheeaja.htm

Next Thread | Thread List | Previous Thread Start a Thread | Settings

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.