semihosting and initialise_monitor_handles()

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

Moderators: RoccoMarco, barthess

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

semihosting and initialise_monitor_handles()

Postby asv » Tue Feb 11, 2014 2:54 pm

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()

Postby asv » Thu Feb 13, 2014 3:07 pm

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: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: semihosting and initialise_monitor_handles()

Postby Giovanni » Thu Feb 13, 2014 3:17 pm

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
Location: South Korea
Has thanked: 3 times
Been thanked: 3 times

Re: semihosting and initialise_monitor_handles()

Postby DeusExMachina » Fri Feb 14, 2014 12:59 am

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.


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 9 guests