Semihosting in both bootloader and application

Sysprogs forums Forums VisualGDB Semihosting in both bootloader and application

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #27682
    MrZANE
    Participant

    Hi.

    I haven’t been able to use semihosting in both bootloader and application. Either one at a time works fine but when enabling in both and jumping from bootloader to application the semihosting stops working.

    Any suggestion on how to fix/work around this problem?

    Ps. I’ve tried calling one of the semihosting init functions (don’t remember the name) from the application but that didn’t help.

    #27699
    support
    Keymaster

    Sorry, this is a known limitation of the advanced semihosting. It works by continuously polling a designated memory area (semihosting buffer) to detect when new data is written there, and it won’t work if that area is moved during runtime (that would happen when transitioning from the bootloader to the main application).

    As a workaround, please consider using the regular semihosting from the bootloader, and the advanced semihosting from the main program.

    #27771
    MrZANE
    Participant

    Would it work if I create a memory area at the same address in both linkfiles and used attribute to place the buffer in that area?

    If so what variable is it that needs to be placed like this?

    #27776
    support
    Keymaster

    It might theoretically work, however this is not something we have explicitly tested (or can officially support). When the control passes from the bootloader to the main application, the variable would get rewritten by the initialization code, and that may trigger weird bugs.

    Either way, it could be worth trying. The variable name is s_FastSemihostingState in FastSemihosting.cpp. If it doesn’t work, making some sort of a syscall mechanism between the bootloader and the main application could be a better option.

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