Close

STM32 and first steps

A project log for STM32Miner

Mining cryptocurrency with a lot of STM32F030

ho-tuan-kietHo Tuan Kiet 05/26/2018 at 19:020 Comments

After some months of swimming in school work, I can finally work on this project again! Time for some updates:

Firstly, about the MCU. After looking at the plethora of MCUs out there, the STM32F030F4P6 comes out as the winner. It fits all of my requirements:

With that in mind, I'm also changing the project name to "STM32Miner". Having a short, memorable name is better than a full sentence that's hard to remember.

Secondly, I've decided on using I2C to communicate between the worker and the master (master MCU to be decided). While using I2C means that the master will have to continuously poll workers for information, the hashrate is so low I don't think this would be a problem. Also I2C means that only two signal links is required, unlike UART or SPI.

Currently, I'm working on the worker's firmware. Initial benchmark shows that the STM32F030 can reach 2500 - 2600 hash / sec of SHA256d operations (running at 64MHz, don't do this at home kids). While that's quite fast, it would still take 19 days for a F030 to scan through the nonce space (2^32). The SHA256 code I'm using is designed for generic data though, so some Bitcoin specific optimization should lead to a higher hashrate (I hope).

(useless information: to measure the hashrate, I programmed the firmware to toggle a GPIO every 100 hashing operations, then a logic analyzer is used to measure the pulse width (below). At 39ms per 100 ops, it worked out to ~2564 ops / sec)

By the way, I'm looking at the ESP8266/ESP32 as replacement to the F030. ESP8266 has an Xtensa 32-bit processor running at 160MHz (maximum), so in theory it should be somewhat faster then the F030. But an ESP-01 is also 2x more expensive than the F030, so unless I can get the ESP8266 to perform at least 3x faster than the F030, it's of no use.

Discussions