Skip to content

Commit

Permalink
Merge branch 'main' into r2axz-config-interface
Browse files Browse the repository at this point in the history
  • Loading branch information
r2axz authored Nov 25, 2020
2 parents 379a596 + b280bc5 commit 2846292
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ jobs:
path: |
*.hex
*.bin
inf/*.inf
inf/*.cat
2 changes: 2 additions & 0 deletions .github/workflows/devrelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ jobs:
README.md
*.bin
*.hex
inf/*.inf
inf/*.cat
2 changes: 2 additions & 0 deletions .github/workflows/tagrelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ jobs:
README.md
*.bin
*.hex
inf/*.inf
inf/*.cat
41 changes: 25 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 rates<sup>2</sup>;
* 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**
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down
Binary file added inf/bluepill-serial-monster.cat
Binary file not shown.
66 changes: 66 additions & 0 deletions inf/bluepill-serial-monster.inf
Original file line number Diff line number Diff line change
@@ -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:
; <http://msdn.microsoft.com/en-us/cc300389.aspx#MLPL>.
; 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"
2 changes: 1 addition & 1 deletion usb_descriptors.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {
Expand Down

0 comments on commit 2846292

Please sign in to comment.