Interesting!
I have my 32F417 board, which among other stuff has a USB port implementing a VCP (USB CDC device profile). This is accessible to the PC like any other VCP e.g. COM3. It is also accessible to internal software as a UART port.
And this all works. I can output long chunks of text via the output to the PC (Teraterm), and I can read stuff from the PC (Teraterm keyboard). I have done a simple loopback routine in the target, which echoes keystrokes nicely.
The immediate purpose of this feature is to run a factory test screen over it. Later it will be documented for general use; it is pretty fast at > 100kbytes/sec.
Now, would you expect, if running a VT100 terminal on the PC, for the cursor keys to move the cursor on the terminal? I am not actually sure, but during a test a while ago this was working just like that. It isn't now. The terminal is doing VT100 cursor codes (it evidently supports "cursor home" etc, but the keyboard isn't generating them.
There was a problem with the VCP code back then, corrupting a few % of the data, which was never noticed on keystrokes, but when I got around to testing the VCP feature properly for not just output (which has been working for years, for debugs) but also input, I found this issue, and fixed it (various forum posts which WEK will recall).I went looking for config options, but according to the above links, Teraterm is basically a
VT100 emulator.
It does support keyboard mappings via a key mapping file, under Setup / Load key map. But among the files provided, none generate VT100 cursor codes (readily found on google e.g. ESC [ A (3 bytes) is cursor UP).
To be fair, I would not expect F keys to be specially supported, because they didn't exist on a VT100.
Some DEC terminals did have F keys but mostly these sent out whole text strings. But I would expect TT to emulate "something". How do PC applications deal with F keys? Do they look for ESC sequences, or is there a specific API? If the former then I would expect to find a table somewhere, but I found nothing. It seems to be dealt with using scan codes or some such.
And only one of the .cnf files, function.cnf, which come with TT, makes the F keys do anything. Some others make all F keys generate the same code. Using the function.cnf keyboard mapping file, I get these F key codes again; F1= 1B 50, F2= 1B 51... That's OK; I can use that, but do these relate to anything whatsoever?
The cursor keys are 1B 41 to 1B 44, consistently across the .cnf files, but again I cannot see these codes relating to anything. They are not VT100 cursor codes for sure.
There is no other config I can find in TT.
Possibly I was using some keyboard mapping file which I can't find now, but I doubt it because my Teraterm installations (I use it everywhere) are straight out of the box, no config.
I cannot see how TT ever generated the VT100 cursor codes.
I uninstalled TT, deleting previous settings, and reinstalled it, and get the same thing.
I have a usable terminal now, but with keyboard F key and cursor codes which don't relate to anything I find online.
The TT "terminal ID" does not do anything in terms of changing key codes and such
The keyboard cursor codes I am seeing are e.g. here
https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequencesbut without the '[' i.e. ESC [ A is just ESC A. But my VCP passes through the '[' fine.
I am printing the hex codes to the SWV ITM data console. I am quite confident about this part.