2016-12-15 11:48 AM
One of the unique things about ARM mbed-enabled boards (such as my 32F746GDISCOVERY) is that they have a small storage area that is shows up in Windows or Linux when the board is connected by USB. An executable can be flashed to the board by dropping in onto the USB device.
This storage area is also accessible from the device itself using ARM semi-hosting, with the mbed 'LocalFileSystem' (
https://developer.mbed.org/handbook/LocalFileSystem
). I'm using FreeRTOS--not ARM mbed OS--but I want to use this semi-hosting file system for testing purposes.I have used code from the files
https://github.com/ARMmbed/mbed-os/blob/master/platform/semihost_api.h
andhttps://github.com/ARMmbed/mbed-os/blob/master/platform/mbed_semihost_api.c
to make this happen. It compiles fine and runs fine until it hits the semi-host breakpoint (assembly 'bkpt 0xAB'), as which point it hangs. I assume it is waiting for something else, maybe even the host PC, to fulfill the semi-host request, and maybe it hangs because I haven't set up the board to handle it correctly...? I have read posts that describe how to enable semi-hosting to communicate with GDB, but I'm not sure if/how those apply here.Am I on a wild goose chase? Does ARM mbed OS do something special to enable its LocalFileSystem that isn't available on other RTOS's? Or does anyone know of a step I could be missing here?
#semihosting #stm32f7 #mbed2016-12-15 12:28 PM
I found out that the semi-hosting calls are part of an
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0040d/Bcedijji.html
, which means it should be usable outside of mbed OS, but I don't understand yet how to use it.2016-12-22 09:04 AM
Campbell.Aaron
, semihosting is only usable with a debugger.In fact any semihosting operation will :
after thatthe debugger capture this bkpt and :
That's why semihosting is only functional while debugging, and blocks at run-time execution (because of the software bkpt)
Note : not all debuggers support semihosting
Note : to debug some application with semihosting you can use openocd (as example)
Note : writing files into device storage, is not a good idea (because ST-Link Firmware will try to program the created file)
Regards,
Tarek