Unpause ARM Semihosting Console after restart?

Sysprogs forums Forums VisualGDB Unpause ARM Semihosting Console after restart?

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #36644
    wtywtykk
    Participant

    Hi,

    I’m using ARM Semihosting Console to print my log. I had 2 problems:

    1. The window stays paused when I restart the debugging. And nothing is displayed because it’s paused. It always takes me some time to realize it was paused.
    2. If restart with the window paused, old contents are not cleared. But if not paused, they are cleared.

    Is it possible to make it unpause when the debugging restarts(reloads the firmware)?

    Thanks!

    #36670
    support
    Keymaster

    Hi,

    That would be a bit tricky. The fast semihosting driver (that detects the resets) is designed to be interchangeable with several other drivers that can produce similar output, and the console window is also interchangeable with other parts that consume text output. Routing pausing/unpausing through it would make things unnecessarily complicated, and could introduce bugs.

    We have made an internal note on it and will look into it next time we do a major redesign of the console logic, but we wouldn’t promise any timeline for it currently.

    As for the old contents, they should normally not get cleared at all, but restarting temporarily fills the buffer with zeroes (or bootloader-specific contents) and that could quickly fill the semihosting window, scrolling beyond the previous contents out of view.

    #36678
    wtywtykk
    Participant

    Hi,

    To clearify, by “restart” I mean the blue button from VS. and “reset” is the green button added by visual gdb.

    My problem happens when I click “restart” (the one from VS). And I agree “reset” shouldn’t clear the content.

     

    After some digging, I found the old content is actually cleared. What it not cleared it the content that received/buffered after I pause the window. They are shown to the window immeidately after unpause. I think this is not expected.

     

    Reproduce:

    1. write a program that prints strng in main with some interval
    2. start the program, the string is shown in semihosting window
    3. pause the window, wait for a while
    4. restart the debugging(by the restart button or by stop then launch)
    5. quickly unpause
    6. you can see the data before restarting is added to the beginning.

     

    Some other problems:

    1. when reading the semihosting with “gets”, restarting will show a error message “Object reference not set to an instance of an object.”
    2. resetting during reading will cause the semihosting to stuck/show some garbage data.

     

    reproduce:

    1. run the following code. This program echos back the input line.
    
    for (;;)
    {
    HAL_GPIO_WritePin(GPIOC, GPIO_PIN_12, GPIO_PIN_SET);
    HAL_Delay(500);
    HAL_GPIO_WritePin(GPIOC, GPIO_PIN_12, GPIO_PIN_RESET);
    HAL_Delay(500);
    puts("aaa\n");
    char bb[128];
    gets(bb);
    puts(bb);
    }

    2. the program should wait for input from semihosting

    3. reset the mcu (if end debugging here, “Object reference not set to an instance of an object.” is shown)

    4. type something

    5. the mcu is stuck at gets (no echo is showed after pressing enter)

     

    Thanks!

     

     

    • This reply was modified 1 week, 1 day ago by wtywtykk.
    • This reply was modified 1 week, 1 day ago by wtywtykk.
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.