diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c63febb..18d10d6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,3 +30,6 @@ jobs: path: | *.hex *.bin + inf/*.inf + inf/*.cat + diff --git a/.github/workflows/devrelease.yml b/.github/workflows/devrelease.yml index 90f17d1..2cbbd3d 100644 --- a/.github/workflows/devrelease.yml +++ b/.github/workflows/devrelease.yml @@ -32,3 +32,5 @@ jobs: README.md *.bin *.hex + inf/*.inf + inf/*.cat diff --git a/.github/workflows/tagrelease.yml b/.github/workflows/tagrelease.yml index 80f525a..3d00842 100644 --- a/.github/workflows/tagrelease.yml +++ b/.github/workflows/tagrelease.yml @@ -31,3 +31,5 @@ jobs: README.md *.bin *.hex + inf/*.inf + inf/*.cat diff --git a/README.md b/README.md index a5ddc85..87797ad 100644 --- a/README.md +++ b/README.md @@ -9,18 +9,14 @@ is available in many stores around the globe. The board contains decent hardware that supports _USB 2.0 Full-Speed_, has 3 independent _USARTs_ and enough processing power to handle high-speed _UART_ communications. -**Note**: some Chinese-made _Blue Pill_ boards have an incorrect pull-up -resistor soldered to the _USB D+_ line (_PA12_) which prevents them from being -successfully detected as a USB device by the host. There is an existing -software workaround for this issue, but it is not reliable. - -This firmware does not contain the workaround for faulty Blue Pill boards and -requires the incorrect resistor to be replaced with the right one. Please refer -to the section [Fixing USB on Blue Pill Boards](#fixing-usb-on-blue-pill-boards) +**Note**: some _Blue Pill_ clones have an incorrect pull-up resistor soldered +to the _USB D+_ line (_PA12_) which prevents them from being successfully +detected by the host. Please refer to +[Fixing USB on Blue Pill Boards](#fixing-usb-on-blue-pill-boards) for more information. -Some USB controllers work fine even with faulty _Blue Pill boards_. If your -board appears to be OK with your computer, don't bother fixing it. +Some USB controllers work fine even with faulty _Blue Pill_ boards. If your +board works with your computer, don't bother fixing it. ## Features @@ -32,18 +28,17 @@ board appears to be OK with your computer, don't bother fixing it. * 1, 1.5, and 2 stop bits; * Works with _CDC Class_ drives on _Linux_, _OS X_, and _Windows_; * Supports all standard baud rates; -* Supports non-standard baud rates2; +* Supports non-standard baud rates; * _DMA_ _RX_/_TX_ for high-speed communications; * _IDLE line_ detection for short response time; +* Signed _INF_ driver for _Windows XP, 7, and 8_; * Built-in command shell for device parameters configuration; -* No external dependencies other than CMSIS; +* No external dependencies other than _CMSIS_; (1) _UART1_ does not support hardware flow control because _RTS_/_CTS_ pins (_PA12_, _PA11_) are used for _USB_ communication and cannot be remapped. If you need hardware flow control, use _UART2_ or _UART3_. -(2) As long as your CDC driver does not hesitate to ask. - ## UART Signal Levels Although _STM32F103C8T6_ installed on the Blue Pill board is a **3.3 V** @@ -256,13 +251,27 @@ You can also flash _STM32F103C8T6_ via a built-in serial bootloader. Visit [https://www.st.com/en/development-tools/flasher-stm32.html](https://www.st.com/en/development-tools/flasher-stm32.html) for instructions and software. +## Windows Driver (WinXP, 7, 8) + +_Windows_ versions prior to _Windows 10_ require an _INF_ file that maps +the device Vendor ID / Product ID to the Microsoft _usbser.sys_ CDC ACM driver. +_Windows 10_ does not require this and loads the standard driver automatically. + +A signed _INF_ file for _Windows XP, 7, and 8_ is included in the distribution. +To install the _INF_ file, plug in _bluepill-serial-monster_ and point _Windows_ +to a directory containing both **bluepill-serial-monster.inf** and **bluepill-serial-monster.cat** files during a new device installation. + +Alternatively, you can open _Windows Device Manager_, right-click on any of the +_Bluepill Serial Monster_ devices, choose _Update driver_ and point Windows to +the _INF_ file directory from there. + ## Fixing USB on Blue Pill Boards _STM32 Blue Pill_ boards come in slightly different variations. Nevertheless, their schematic is very similar. Below you will find the instructions on how to identify and replace the incorrect USB pull-up resistor on any _Blue Pill_ board. -With a digital multimeter, measure the resistance between **PA12** and **3.3 V** +With a digital multimeter, measure resistance between **PA12** and **3.3 V** pads on the board. If the resistance reads close to **1.5k** (**1500 ohms**), then your board is either non-faulty or faulty for some other reason, and this section does not apply. @@ -272,7 +281,7 @@ you will have to locate the incorrect resistor on the board and replace it with a **1.5k** or **1.8k** resistor. If your board has component names on it, locate **R10**. Otherwise, trace the -board to see where the incorrect resistor is located. +board to find the incorrect resistor. Once you identified the incorrect resistor, replace it with a **1.5k** or **1.8k** resistor. diff --git a/inf/bluepill-serial-monster.cat b/inf/bluepill-serial-monster.cat new file mode 100755 index 0000000..54602d1 Binary files /dev/null and b/inf/bluepill-serial-monster.cat differ diff --git a/inf/bluepill-serial-monster.inf b/inf/bluepill-serial-monster.inf new file mode 100644 index 0000000..85c00d1 --- /dev/null +++ b/inf/bluepill-serial-monster.inf @@ -0,0 +1,66 @@ +; Windows USB CDC ACM Setup File + +; Based on INF template which was: +; Copyright (c) 2000 Microsoft Corporation +; Copyright (c) 2007 Microchip Technology Inc. +; likely to be covered by the MLPL as found at: +; . +; For use only on Windows operating systems. + +[Version] +Signature = "$Windows NT$" +Class = Ports +ClassGuid = {4D36E978-E325-11CE-BFC1-08002BE10318} +Provider = %PROVIDER% +CatalogFile = bluepill-serial-monster.cat +DriverVer = 11/19/2020,1.0.0.0 +PnpLockdown = 1 + +[SourceDisksNames] + +[SourceDisksFiles] + +[Manufacturer] +%MANUFACTURER% = DeviceList,NT,NTamd64 + +[DestinationDirs] +DefaultDestDir = 12 + +[DeviceList.NT] +%DESCRIPTION% = DriverInstall,USB\VID_1209&PID_FFFE&MI_00 +%DESCRIPTION% = DriverInstall,USB\VID_1209&PID_FFFE&MI_02 +%DESCRIPTION% = DriverInstall,USB\VID_1209&PID_FFFE&MI_04 + +[DeviceList.NTamd64] +%DESCRIPTION% = DriverInstall,USB\VID_1209&PID_FFFE&MI_00 +%DESCRIPTION% = DriverInstall,USB\VID_1209&PID_FFFE&MI_02 +%DESCRIPTION% = DriverInstall,USB\VID_1209&PID_FFFE&MI_04 + +[DriverInstall.NT] +Include = mdmcpq.inf +CopyFiles = FakeModemCopyFileSection +AddReg = DriverInstall.NT.AddReg + +[DriverInstall.NT.AddReg] +HKR,,DevLoader,,*ntkern +HKR,,NTMPDriver,,usbser.sys +HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" + +[DriverInstall.NT.Services] +AddService = usbser, 0x00000002, DriverServiceInstall + +[DriverServiceInstall] +DisplayName = %SERVICE% +ServiceType = 1 +StartType = 3 +ErrorControl = 1 +ServiceBinary = %12%\usbser.sys +LoadOrderGroup = Base + +[FakeModemCopyFileSection] + +[Strings] +PROVIDER = "Kirill Kotyagin" +MANUFACTURER = "Kirill Kotyagin" +DESCRIPTION = "Blue Pill Serial Monster" +SERVICE = "Blue Pill Serial Monster" \ No newline at end of file diff --git a/usb_descriptors.c b/usb_descriptors.c index 192fddf..8eaf929 100644 --- a/usb_descriptors.c +++ b/usb_descriptors.c @@ -69,7 +69,7 @@ const usb_endpoint_t usb_endpoints[usb_endpoint_address_last] = { const usb_string_descriptor_t usb_string_lang = USB_ARRAY_DESC(usb_language_code_en_US); const usb_string_descriptor_t usb_string_manufacturer = USB_STRING_DESC("R2AXZ Kirill Kotyagin"); -const usb_string_descriptor_t usb_string_product = USB_STRING_DESC("STM32 Blue Pill Serial Monster"); +const usb_string_descriptor_t usb_string_product = USB_STRING_DESC("Bluepill Serial Monster"); const usb_string_descriptor_t usb_string_serial = USB_STRING_DESC("NO SERIAL"); /* Placeholder, replaced by STM32 UID */ const usb_string_descriptor_t *usb_string_descriptors[usb_string_index_last] = {