logo elektroda
logo elektroda
X
logo elektroda

HK32F030M - Chinese ARM for 15 cents

piotr_go  60 18234 Cool? (+19)
📢 Listen (AI):

TL;DR

  • HK32F030M is a Cortex-M0 Chinese microcontroller with an STM8S-like pinout, not an STM32F030 clone.
  • It provides 16kB Flash, 2kB RAM, 448B EEPROM, SPI/I2C/USART/ADC, three 16-bit timers, and a 32MHz HSI.
  • Compared with STM32F030, it lacks DMA, PLL, and external quartz support, while adding a BEEPER peripheral.
  • J-Link needs manual JLinkDevices.xml entries plus attached .FLM loaders because HK32F030M is not supported out of the box.
  • A hello-world and LED-blink demo worked, with LED1–4 on PC4–PC7 and UART TX on PA3 at 9600 baud.
Generated by the language model.


No, this is not another STM32F030 clone as the designation would suggest.
It is a Cortex M0 with a pinout similar to the 8-bit STM8S microcontrollers.

STM8S/HK32F030M/STM32F030:


The HK32F030M has 16kB Flash, 2kB RAM and 448B EEPROM. SPI/I2C/USART/ADC present.
There is no DMA, PLL, or external quartz support, which is present in the STM32F030. The Chinese manufacturer added BEEPER appearing in STM8S.
We only have 3 timers. Two with PWM and one only internal. All 16 bit.
The internal HSI generator runs at 32MHz.
For 15 cents in detail? There is no competition.

HK32F030M/STM32F030:


Peripheral addresses are similar. Unfortunately, the individual registers are slightly different, so the code from STM32F030 may not work properly without corrections.


HK32F030M/STM32F030 clocks:


J-Link does not support "out of the box" microcontroller. You need to edit the "JLinkDevices.xml" file and add the following entries:
Quote:
<!-- -->
<!-- HK -->
<!-- -->
<Device>
<ChipInfo Vendor="ST" Name="HK32F030M" WorkRAMAddr="0x20000000" WorkRAMSize="0x800" Core="JLINK_CORE_CORTEX_M0" />
<FlashBankInfo Name="Code Flash" BaseAddr="0x08000000" MaxSize="0x4000" Loader="Devices/HK32F030M/HK32F030MXX_16.FLM" LoaderType="FLASH_ALGO_TYPE_CMSIS" />
</Device>
<Device>
<ChipInfo Vendor="ST" Name="HK32F030M" WorkRAMAddr="0x20000000" WorkRAMSize="0x800" Core="JLINK_CORE_CORTEX_M0" />
<FlashBankInfo Name="Code EEPROM" BaseAddr="0x0C000000" MaxSize="0x01C0" Loader="Devices/HK32F030M/HK32F030MXX_EEPROM.FLM" LoaderType="FLASH_ALGO_TYPE_CMSIS" />
</Device>
<Device>
<ChipInfo Vendor="ST" Name="HK32F030M" WorkRAMAddr="0x20000000" WorkRAMSize="0x800" Core="JLINK_CORE_CORTEX_M0" />
<FlashBankInfo Name="Code OPT" BaseAddr="0x1FFFF800" MaxSize="0x0018" Loader="Devices/HK32F030M/HK32F030MXX_OPT.FLM" LoaderType="FLASH_ALGO_TYPE_CMSIS" />
</Device>

And upload ".FLM" files (attached).
"Vendor=ST" so that the system can be programmed with ST-Link converted to J-Link ;)

What more can I say? For now, not much except that the microcontroller works. :)
If I discover something new, I will add it.

"Hello world" and flashing LEDs in the attachment. Just in time to start.
LED1...4 = PC4...7
UART TX = PA3, speed 9600





Attachments:
  • JLink_support.tar.gz (5.78 KB) You must be logged in to download this attachment.
  • hello_world.tar.gz (61.6 KB) You must be logged in to download this attachment.
  • HK32F030M????V1.1.6.pdf (11.4 MB) You must be logged in to download this attachment.
  • HK32F030M????_V1.0.9.pdf (2.54 MB) You must be logged in to download this attachment.

About Author
piotr_go
piotr_go wrote 2904 posts with rating 3336 , helped 94 times. Been with us since 2003 year.

Comments

Anonymous 25 Sep 2020 12:27

I wonder if the manufacturer fires the license fee to ARM :) [Read more]

piotr_go 25 Sep 2020 13:52

PDFs are not top secret, so I think they have a license. ARM abolished the entry fee for M0 and M3, they only charge on the produced pcs. (supposedly 1%, I haven't found official confirmation) [Read more]

mariomario 25 Sep 2020 23:49

The link to the store and the shipping price are missing ;) [Read more]

victoriii 26 Sep 2020 00:41

Link to the store Personally, I recommend this store - it's cheap, a lot of cheap Chinese chips and I've never come across fakes. [Read more]

piotr_go 28 Sep 2020 18:49

I was hoping for some interesting discussion... Why are the prices of Western microcontrollers so high? It's not a hand job. PIC10F200 - price 3 times higher. PICs are like 40 years old, it's... [Read more]

Anonymous 28 Sep 2020 20:01

Sorry, but I did not find information about Arduino Core support for this processor :) Inter-corporate agreements, additional benefits, etc. On the other hand, it is as if you wonder why many ATMs... [Read more]

victoriii 28 Sep 2020 20:05

Well, it depends where you buy. Exactly the same STM32 as in LCSC in Farnell is 3-4 times more expensive. I believe this is due to higher wages in the UK and Farnell's inflated costs. I wonder what... [Read more]

willyvmm 28 Sep 2020 20:17

The first thing the NDA orders. [Read more]

piotr_go 28 Sep 2020 20:20

Haha, well... I wonder what price the Chinese would offer me at 2 million, because I can't complain about the prices for single pieces. And I'm not boasting about the discount anymore ... [Read more]

victoriii 28 Sep 2020 20:23

I don't think the Chinese have anything to do with it. Instead of 2p/pc (PADAUK) you will get 1.5p/pc ;) [Read more]

piotr_go 28 Sep 2020 20:32

The 2 cent one is not the cheapest Padauk. There is also PMS15A. Apparently, with a large amount at the manufacturer, they are $0.01 each. And you can always order "bare die". [Read more]

m7m 28 Sep 2020 21:36

Hello. Prices - well, no competition.... We'll wait and see how it is with parameters, stability, life time. "Western" products work quite well even if you buy regular versions, not any "military". ... [Read more]

Anonymous 29 Sep 2020 01:59

Only the simplest ones (probably Chinese copies or rejects). Others cost the same or usually more expensive. e.g.: STM32F745VET6 - LCSC ?12.107382, Farnell - ?9.41. [Read more]

piotr_go 29 Sep 2020 09:18

Maybe ST has some production there? Or they are in arrears because they imported too much and Chinese equivalents appeared. Chinese versions of PICs have 4 cents in LCSC. The original is there too,... [Read more]

squeze 29 Sep 2020 12:41

Western behemoths are maintainable, but at this price there is also a tool that they often provide for free, not to mention the documentation (EN) :) In addition to the DS itself, they also release application... [Read more]

piotr_go 29 Sep 2020 13:07

That's right. Flash is seen at addresses 0x0800xxxx and 0x0000xxxx. 0x0000xxxx booting, 0x0800xxxx programming. In STM32 under 0x0000xxxx RAM/FLASH/ROM is switched. There is probably only FLASH here... [Read more]

Anonymous 29 Sep 2020 13:57

Fanell, Arrow and others just like hobbyists because they are a high-margin group - which can be seen in the ever wider range of products for hobbyists. Procek as a curiosity OK, but IMO for a hobbyist,... [Read more]

piotr_go 29 Sep 2020 14:10

Only when I once wanted to buy r-PI, they told me to look elsewhere, because they only sell to companies. Did someone ban it? You can see that he has a lot of different crap on aliexpress with... [Read more]

Anonymous 29 Sep 2020 19:43

@piotr_go I'm not going to stick a stick in an anthill - I just shared my thoughts. Nobody, of course - but those who only need Arduino will not write libraries themselves. Their absence greatly... [Read more]

FAQ

TL;DR: HK32F030M MCUs ship for $0.15 per 1 000 units and run a 32 MHz Cortex-M0 core; “there is no competition” [Elektroda, piotr_go, post #18941722] Boards kept blinking up to 7 V before failure [Elektroda, piotr_go, post #19358946]

Why it matters: Ultra-low pricing plus ARM IP make these chips tempting drop-in upgrades for 8-bit designs.

Quick Facts

• Core: ARM Cortex-M0, 32 MHz internal HSI [Elektroda, piotr_go, post #18941722] • Memory: 16 kB Flash, 4 kB RAM, 448 B EEPROM (newer silicon) [Elektroda, BlueDraco, post #19167018] • Price: USD 0.15 @ 1 k pcs; recent lots ≈ 0.20 USD [Elektroda, piotr_go, post #19007720] • Typical active current: 3.06 mA @ 32 MHz, 3.3 V [Elektroda, piotr_go, post #19374070] • Package quirks: early SO-8 had NRST on pin 6, later on pin 7 [Elektroda, piotr_go, post #19171083]

What makes HK32F030M different from STM32F030?

HK32F030M keeps the same Cortex-M0 core but drops DMA, PLL and external crystal support, adds a beeper like STM8S, and limits timers to three 16-bit units [Elektroda, piotr_go, post #18941722]

Will STM32F0 firmware run unmodified?

Peripheral base addresses match, yet register bitfields differ; expect to patch code and headers before it boots correctly [Elektroda, piotr_go, post #18941722]

How do I flash and debug the chip with J-Link?

  1. Add the XML snippet posted in the thread to JLinkDevices.xml.
  2. Place the three .FLM loaders in Devices/HK32F030M/.
  3. Connect SWD and power, then program via J-Link commander [Elektroda, piotr_go, post #18941722]

Can I power it from 5 V?

Yes. One unit survived an hour at 5 V and only mis-behaved above 7 V, though this exceeds absolute-max ratings and risks latent damage [Elektroda, piotr_go, post #19358946]

What about Arduino Core support?

No vendor core exists yet. Porting is feasible because register sets resemble STM32F030; UART bootloaders work, but USB DFU is absent [Elektroda, khoam, post #18948238]

How accurate is the 32 MHz HSI?

Datasheet gives ±1 % (typ.); developers have overclocked to 48 MHz without wait-states and even 96 MHz with one wait-state via HSICAL tweaks [Elektroda, dabyd64, post #20598122]

Is on-chip EEPROM reliable?

Users report erase/write works, but page 0xC000000 maps over Flash in the current reference manual, so test thoroughly before field use [Elektroda, BlueDraco, post #19168967]

How do I generate a minimal UART bootloader?

  1. Enable clock to USART and GPIO.
  2. Map PA3 (TX) and PA2 (RX) to AF.
  3. Implement XMODEM receive and write 128-byte frames to Flash pages (128 B each) [Elektroda, piotr_go, post #18941722]

Edge case: what fails first under stress?

At 7 V supply, code execution glitches before any thermal rise; FLASH content remained intact after the test [Elektroda, piotr_go, post #19358946]

Can I buy them today and where?

LCSC lists HK32F030MF4P6 for CNY 0.80 (≈ USD 0.12) but recent demand raised quotes to USD 0.20 [Elektroda, victoriii, #18943068; piotr_go, #19007720].

Are there 5 V-tolerant or larger-RAM siblings?

Yes: HK32F0301M offers 48 MHz core and 4 kB RAM at the same price, while HC32F005 adds full 5 V operation for slightly more [Elektroda, piotr_go, post #19007720]

What’s a safe development workflow?

“Use Keil with patched .pdsc files; J-Link clones based on BluePill debug fine,” an adopter confirms [Elektroda, dabyd64, post #20598122]
Generated by the language model.
%}