cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103 USB Packet Memory

Joe.H
Associate III

Writing a USB Driver using a China manufactured "Blue Pill"

I'm not using HAL or Cube.

I wrote some code to test the USB cell and my understanding of how it works.

I tested the USB's Packet memory which is 512 bytes organized as 256 words. The Application accesses this memory on 32 bit boundaries (using a DWORD pointer).

I wrote test data to the Packet Memory and then read it out into a ram based array to verify its contents. I have found that single bits are incorrect at many of the Packet Memory locations.

Has anyone else seen this issue?

The Blue Pill is a sub $2 board - are they being built with ST parts that had issues in MFG test?

Any ideas on this issue?

6 REPLIES 6

> The Blue Pill is a sub $2 board - are they being built with ST parts that had issues in MFG test?

More probably with counterfeit parts, i.e. chips which are not by ST but are marked falsely so.

https://www.eevblog.com/forum/microcontrollers/cheap-bluepill-very-likely-it-has-fake-stm32-right/

> I wrote test data

How exactly? I haven't tried on 'F1, but on 'F0 writing by bytes does not work

https://community.st.com/s/question/0D50X00009XkaAs/f042-usb-usb-buffer-not-writable-bytewise

JW

The PMA is arranged as 256 16-bit words that need to be written on 32-bit foundries. I used a 32-bit pointer to write/read 16-bit values to the 256 locations in the PMA - exactly the same way HAL or many drivers do it.

Don't you have a board with known genuine STM32F103 to compare?

JW

No I don't. I usually design my own boards using larger micros. I needed to cheap little board to build a heated box so I purchased the Blue Pill. I wanted to get into USB so I used the STM32F103 - Blue Pill - as the test board for writing my own USB driver. After working with it, I don't think I would choose that device for an embedded application - implementation seems quirky when control/status bits need to be changed by "toggle" instead of standard - set/clear.

I'll use the board for the "Bread Proofer Box"but will not proceed with the USB development.

I purchased a "Black Pill" - STM32F411 - I'll use THAT board to develop my USB understanding. The USB FS implementation appears to be much better than that of the STM32F103.

Piranha
Chief II

Honestly I don't understand this masochism with deficient clones of the old STM32F1 and boards without debugger, when there is a NUCLEO-G431KB with ST-LINK on board.

https://octopart.com/nucleo-g431kb-stmicroelectronics-102284322

Joe.H
Associate III

Just to clarify - I do embedded design for a living. A Real J-Link tool was used in the investigation of this issue with this Blue Pill.