Semihosting does not work with codes generated by STM32CubeMX v4.15.1 on STM32F103RCT6/STM32F405RG
Figured out the problem finally!
With the items (listed above) properly set up Semihosting works when printing inside main() function.
To print inside FreeRTOS thread, need to e.g. “invoke setvbuf(stdout, NULL, _IOLBF, 256);” explicitly even if log strings have ‘\n’.
Tried both “-specs=nosys.specs -specs=nano.specs -specs=rdimon.specs -lc -lrdimon” and “-specs=nano.specs -specs=rdimon.specs -lc -lrdimon” and they work! Seems it’s conflicting that nosys and rdimon co-exist. In first setting the latter rdimon spec could ‘overwrite’ nosys spec that’s why it works as well (I guess)


