SIGTRAP semihosting

Sysprogs forums Forums VisualGDB SIGTRAP semihosting

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6848
    Martijn
    Participant

    I used the BKPT 0xAB instruction to send some data to the debugger console.

    But i get a sigtrap asif it was a breakpoint every time this instruction is reached.

    I see the data in the console as expected, but the processor just stops right after.

    When i step further and push continue the program continues to the next character and displays it fine in the console, but again breaks into sigtrap.

     

    I am using a cortex-m0 processor with a j-link debugger over SWD.

    Any idea where i need to look for?

    • This topic was modified 8 years, 8 months ago by Martijn.
    #6852
    support
    Keymaster

    Are you using OpenOCD or Segger software? Segger software should have their own implementation of semihosting (activated by “monitor semihosting enable” command).

    #6854
    Martijn
    Participant

    I am using segger software. Where do i need to enter that command?

    I also looked into seggers real time transfer solution and got that working. That is actually a better solution for our applications.

    #6870
    support
    Keymaster

    Please add the following commands to the GDB Startup commands (after target selection) in VisualGDB Project Properties:

    mon semihosting enable
    mon semihosting IOClient 2

    Then call the initialise_monitor_handles() function in your main():

    #include <stdio.h>
    
    extern "C" void initialise_monitor_handles();
    
    int main(void)
    {
        initialise_monitor_handles();
        printf("test\n");
    }

    Finally switch the GDB Session window to “All GDB Interaction” to see the semihosting output from the Segger GDB stub.

    You can also change “IOClient 2” to “IOClient 1” to direct semihosting output to a telnet port 2333.

     

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.