The theory is perfect. You can take only a standard and a datasheet. Then simply implementing clear and univocal algorithm from the standard using opportunities of your hardware, described in datasheets. Looks like a simple lab work in the university, but the real world is a little complicated.
On the practice I have a standard whom chapters tree looks like labyrinth. And two mainstream OS whom authors do not notify me which requests and data streams their drivers are expected. That complication is unpleasant, because I never want to confess that I haven't got money for buying a multiple expensive development boards and debugging tools. I just want to write a system code who will work at the first time with any OS and software. While use of the only one 2$ integrated circuit.
Complicated standard
At basic level it is clear. For the every type of device we have a separate specification who adds it's requests and pipes to the lowest possible configuration from main USB 2.0 spec. Virtual com port considered in this post is a device of communication device class (CDC). But when we obtains that documentation we deals with a yet another heap of acronyms consisting of unobvious terms. And at that moment I could feel that I deal with a professional technology, not with child's toy. On the whole, USB-UART adapter in vision of USB IF team is a "Public switched telephone network analogue modem adapter communication device with an abstract control model". Not as obvious as it may was, but put up with it. Yet another complication is in control pipes. For VCP control null control endpoint is not enough, we need separate pipes for requests and notifications in addition to the data endpoints. And the notifications datastream protocol is not represented in documentation (USB PSTN 1.2, chapter 6.5.4), only meantioned. The problem is in that such spaces in documentation makes impossible writing stable firmware working with any OS. Suggested by the standard device structure is shown at the picture.
OS documentation analysis
Even if standard describes the feature, the OS may couldn't support it. Let's take a look to OS documentation to see what say OS driver programmers about theory what we read in standard recently. Most understandable case is linux. Linux default generic serial driver can add any CDC device if it have at least input and output bulk data streams. The whole configuration data in that case will be ignored.
The windows help website says that it can connect any communication device (a device with bDeviceClass = 0x02, bDeviceSubClass = 0x02 constants) using it's usbser.sys default driver. But this article nothing says about configuration and notification data, or this driver ignore it, or serial port configuration requests and notifications are mandatory, no information. But there is a good news in that I can make a VCP which will be connected without driver installation.
Code examples analysis
Check working code of another opensource projects. There are stm32 VCP example and LUFA library. Both of they have an additional master interface with interrupt endpoint and slave interface with data input and output bulk endpoints. Both of they have an constant who says that they supports modem AT commands, obviosly they do not need them. Both of them ignores existing configuration datastream.
cleaned oiled mushrooms on STM32 tore off the chip with tracks, glued it with superglue does not work
ОтветитьУдалитьYeah, top STM's can save some short tracks in AMR, they have a lot of flash. Maybe I will build a music box gift on them.
ОтветитьУдалить