book icon indicating copy to clipboard operation
book copied to clipboard

Fix incorrect explanation

Open neilpate opened this issue 2 years ago • 9 comments

In the description of semihosting is explains that IO occurs on the host. This should be target surely?

neilpate avatar Jul 09 '22 19:07 neilpate

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.

rust-highfive avatar Jul 09 '22 19:07 rust-highfive

No, semihosting allows the target MCU to perform I/O using the host computer.

hargoniX avatar Jul 09 '22 19:07 hargoniX

@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!

neilpate avatar Jul 11 '22 10:07 neilpate

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.

hargoniX avatar Jul 11 '22 13:07 hargoniX

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.

neilpate avatar Jul 11 '22 14:07 neilpate

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.

hargoniX avatar Jul 11 '22 19:07 hargoniX

Thanks for the clarification @hargoniX. I understand now and will adjust the text accordingly if you don't mind?

neilpate avatar Jul 12 '22 07:07 neilpate

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.

hargoniX avatar Jul 12 '22 09:07 hargoniX

I understand now and will adjust the text accordingly

Just do it

stappersg avatar Mar 11 '23 10:03 stappersg