semihosting and initialise_monitor_handles()

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
asv
Posts: 5
Joined: Tue Feb 11, 2014 2:37 pm

semihosting and initialise_monitor_handles()

Post by asv »

Hello, I'm trying to use semihosting feature of OpenOCD, but executing initialise_monitor_handles() just hangs the debugging process.
The problem is here:
void main() {
initialise_monitor_handles();
// The debugger does not return here...
}

I'm using STM32F0DISCOVERY board with ChibiStudio. That semihosting was added just to the demonstration project for that board.

Linker options in the makefile are:
LD = $(TRGT)gcc --specs=rdimon.specs -lrdimon
DLIBS = "C:\ChibiStudio\tools\GNU Tools ARM Embedded\4.7 2013q2\arm-none-eabi\lib\librdimon.a"

I set the following Initialization Commands were set for the GDB debugger in the ChibiStudio:
set remotetimeout 20
monitor reset init
monitor sleep 50
mon arm semihosting enable

So, I'm able to successfully debug the application in Eclipse of ChibiStudio, but execution of initialise_monitor_handles() does not return to the debugger. And even OpenOCD says that "semihosting is enabled" in the console.

BTW, I tried to just manually run OpenOCD and GDB from the command line. The result is the same.

So, could you help with this problem? May be there are some issues with crt0.c from the port? Or with the linker script?
Thanks in advance!
asv
Posts: 5
Joined: Tue Feb 11, 2014 2:37 pm

Re: semihosting and initialise_monitor_handles()

Post by asv »

Is it possible to get some small workable demo of using semihosting together with ChibiOS?

It looks I get stuck on some trivial issue, but it is not easy to find it out for newcomers...
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: semihosting and initialise_monitor_handles()

Post by Giovanni »

Hi,

I don't have any example and no idea of what the problem could be. I never felt the need for such feature.

It most likely depends on what that initialise_monitor_handles() tries to do. If it defines exception handlers I would look in differences between vector names in ChibiOS (vectors.c) and the equivalent in CMSIS.

Giovanni
User avatar
DeusExMachina
Posts: 223
Joined: Tue Apr 03, 2012 5:08 am
Has thanked: 3 times
Been thanked: 3 times

Re: semihosting and initialise_monitor_handles()

Post by DeusExMachina »

Semi-hosting is very interesting debugging feature that can be used in debugging (no need of dedicated UART). This feature supports many commercial and open source toolchains\IDE.
Post Reply