Close

Status on the worker's firmware, and an alternative to the STM32F030F4P6

A project log for STM32Miner

Mining cryptocurrency with a lot of STM32F030

ho-tuan-kietHo Tuan Kiet 06/17/2018 at 14:360 Comments

After nearly three weeks of work, I can finally say that the worker's firmware is 95% completed. Although all functionalities has been implemented, I still say 95% because the other 5% is for the bugs/features that haven't been found yet. Too bad as I accidentally pushed -5VDC through my STM32F030F4P6 board, it's dead now and until I get a replacement board I wouldn't be able to sort out the remaining 5%. That also means no screenshots/video demos available, so bear with me.

Source code are available on GitLab so you can compile and test it out. Compatibility is only guaranteed on the STM32F030F4P6. If you're too lazy/can't afford to install all the prerequisites, you can download the automated builds and flash it on your 32F030. Download the latest production build that passes by the way, unless you want to study the internals/see the scrolling log, then the latest debug build is for you. After flashing, the user guide on utilizing the firmware is in the README. Basically, it exposes the 32F030 as an I2C device, so you'd need to write the block header to the device at this certain address (in the README), then it'll happily crunch through the nonce space.

Some statistics:

Next, I've been looking for an alternative to the 32F030. The 32F030 is a Cortex-M0 processor, so the instruction set is limited and moving to a Cortex-M3/M4 would mean better performance and smaller code. However I've been avoiding the M3/M4 as no manufacturers make M3/M4 chip in TSSOP20 package, only TQFP32 and above, which makes soldering a pain. Until I found the GD32F330F4P6.

Some background first: GD32 is a line of ARM Cortex-M processors made by GigaDevice. I first heard of it when they released the GD32F103C8T6, which according to many sites is a binary-compatible version of the STM32F103C8T6 except for some improvements such as faster clock and zero wait state flash. In other words, the GD32F103 has different silicon than the STM32 one, but the pins are the same, the registers are the same, so programs running on the STM32 also runs fine on the GD32 (except for some situations like SPI).

The GD32F330F4P6 is a Cortex-M4 processor with the same flash/RAM size as the STM32F030F4P6, but with faster clock and what's more, it's the only TSSOP20 Cortex-M4 processor available on the market AFAIK, so it's the perfect alternative to the 32F030. Finding places to buy this chip is a hassle though, Google isn't anywhere helpful and neither is Aliexpress/Alibaba. Fortunately I found it on Taobao at $0.62, so I'm looking to buy 5/10 of them for initial testing (and hey, buying them is also a pain as I have to rely on agents). I do have concerns that these chips are garbage/low quality/fragile compared to other Cortex-M chips on the market, but hey, they're cheap as heck so might as well give it a try. If things go smoothly I'm hoping for a 2x-3x boost in hash rate.

Discussions