book
book copied to clipboard
Fix incorrect explanation
In the description of semihosting is explains that IO occurs on the host. This should be target surely?
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @therealprof (or someone else) soon.
Please see the contribution instructions for more information.
No, semihosting allows the target MCU to perform I/O using the host computer.
@hargoniX do you mean even the peripherals (like DAC etc) are emulated somehow on the host? That is what I interpreted by the statement that semihosting does all the IO on the host. If this is the case then that is really powerful!
No what the statemt means is that the microcontroller can use the IO capabilities of the host which is basically always just the host's printf
so you can have debug prints, this does however make it super slow and we thus usually want to avoid it. State of the art in Embedded Rust is RTT.
Yes that is what I suspected, which is why I suggested the PR in the first place. It is confusing to say "Semihosting is a mechanism that lets embedded devices do I/O on the host and is" as this implies (to me at least) all the IO of the target.
It can perform a certain set of I/O on the host machine as explained here: https://wiki.segger.com/Semihosting#Operations. While the explanation might be slightly misleading in the way you described your suggested change makes things worse because it claims something straight up wrong, semihosting is not used to perform IO on the target but on the host.
That being said in order to make sure it is understood properly in the text one could write "certain IO operations on the host" for example.
Thanks for the clarification @hargoniX. I understand now and will adjust the text accordingly if you don't mind?
Sure :+1:, if you want you can also leave a link to the segger explanation, they are also the ones that came up with RTT so definitely a trusted source.
I understand now and will adjust the text accordingly
Just do it