WeAct STM32F411CEU6 black pill

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
jppang
Posts: 1
Joined: Tue Feb 04, 2020 8:18 am

Re: WeAct STM32F411CEU6 black pill

Post by jppang » Tue Feb 04, 2020 8:32 am

gersch07 wrote:
Mon Feb 03, 2020 10:59 pm
Dear all,

I’ve followed the steps above to compile MicroPython (including support for a Winbond W25Q128 Flash Chip) and successfully flashed it using the ST-Link Utility. However, the ST Virtual COM port has so far only appeared twice after plugging in the USB cable... most of the time the device remains undetected, showing „Error 43“ in the Windows device manager. I‘m not sure if this is related, but in the „STM32duino“ forum people have reported that running the MCU at 100 MHz causes the USB clock to be slightly off...
Has anyone of you had similar trouble? I’ve also opened an issue on GitHub.

Thanks for your help!
I had tried 100MHz clock but failed too, USB communication was unstable.
96MHz clock is a good option for micropython.
Hope this can help.

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: WeAct STM32F411CEU6 black pill

Post by mcauser » Mon Feb 10, 2020 4:10 am

In the board definition mpconfigboard.h, HSE is set to 25MHz and the CPU freq set to 96MHz (192/2) and USB 48MHz (192/4):

Code: Select all

#define MICROPY_HW_CLK_PLLM (25)
#define MICROPY_HW_CLK_PLLN (192)
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV2)
#define MICROPY_HW_CLK_PLLQ (4)
I noticed on the Arduino_Core_STM32 fix they increased the flash latency from 2 to 3. I'll try adding that:

Code: Select all

#define MICROPY_HW_FLASH_LATENCY    FLASH_LATENCY_3

SpotlightKid
Posts: 463
Joined: Wed Apr 08, 2015 5:19 am

Re: WeAct STM32F411CEU6 black pill

Post by SpotlightKid » Thu Jun 25, 2020 9:04 pm

I just got three of these today from China and successfully flashed MP onto the first one. Having only ~45 kB left on the flash FS is a bit of a bummer, though.

* If I add frozen modules to my firmware build, will they further decrease the flash FS size?
* If I disable some builtin modules I don't use, can I increase the flash FS size?
* I have a breakout board with a microsd slot. This has only the usual SPI pins (MISO, MOSI, SCK, CS) and VCC/GND but no card detect pin. Can I use this as the boot FS? If yes, which SPI bus do I use and what do I need to add to mpconfigboard.h?
Last edited by SpotlightKid on Thu Jun 25, 2020 9:47 pm, edited 2 times in total.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: WeAct STM32F411CEU6 black pill

Post by dhylands » Thu Jun 25, 2020 9:42 pm

According to the datasheet, 3 wait states should be used for 90-100 MHz with a voltage of 2.7V to 3.6V.

2 wait states is recommended for 64-90 MHz (same voltage range).

User avatar
rcolistete
Posts: 352
Joined: Thu Dec 31, 2015 3:12 pm
Location: Brazil
Contact:

Re: WeAct STM32F411CEU6 black pill

Post by rcolistete » Fri Jun 26, 2020 8:58 pm

SpotlightKid wrote:
Thu Jun 25, 2020 9:04 pm
I just got three of these today from China and successfully flashed MP onto the first one. Having only ~45 kB left on the flash FS is a bit of a bummer, though.
See the 1st page of this topic. It is very simple to add a W25Q128 (16 MBytes) SPI flash.
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).

SpotlightKid
Posts: 463
Joined: Wed Apr 08, 2015 5:19 am

Re: WeAct STM32F411CEU6 black pill

Post by SpotlightKid » Sat Jun 27, 2020 6:06 am

Yes, I read that. I was looking though to make the most of the existing flash or extending it without having to order extra parts.

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: WeAct STM32F411CEU6 black pill

Post by davef » Mon Aug 03, 2020 6:00 am

Has anybody actually managed to build ussl into this port?

Thanks,
Dave

User avatar
RobH
Posts: 91
Joined: Fri Mar 23, 2018 3:37 pm
Location: Netherlands
Contact:

Re: WeAct STM32F411CEU6 black pill

Post by RobH » Wed Aug 05, 2020 11:48 am

mcauser wrote:
Sun Jan 19, 2020 1:15 pm
The SPI flash pins are exposed on the side pins, so you have the option of experimenting with a few flash sizes, until you are happy to solder one on.
I have followed the instructions to build the firmware (1.12-662) with additional 16MB flash and connected an external board with W25Q128. After uploading this firmware gc.mem_free() still reports 97600 (same as before with the unmodified firmware).
I (re-)checked both my modifications of mpconfigboard.h :
line9: #define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (0)
line 98: #define MICROPY_HW_SPIFLASH_SIZE_BITS (128 * 1024 * 1024) // W25Q128 - 128 Mbit (16 MByte)
Also re-checked the wiring of the flash-board. But I do not see anything wrong.
The Micropython prompt confirms that I uploaded 'my own' firmware (version and date).
Any idea what else could be wrong or a suggestion what else to check?

Rob.

User avatar
rcolistete
Posts: 352
Joined: Thu Dec 31, 2015 3:12 pm
Location: Brazil
Contact:

Re: WeAct STM32F411CEU6 black pill

Post by rcolistete » Wed Aug 05, 2020 3:49 pm

'gc.mem_free()' shows the free RAM, not the free space in file system on flash memory.
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).

User avatar
RobH
Posts: 91
Joined: Fri Mar 23, 2018 3:37 pm
Location: Netherlands
Contact:

Re: WeAct STM32F411CEU6 black pill

Post by RobH » Thu Aug 06, 2020 10:04 am

rcolistete wrote:
Wed Aug 05, 2020 3:49 pm
'gc.mem_free()' shows the free RAM, not the free space in file system on flash memory.
Ah, I wasn't aware of that! And indeed, when I examine the 'disk' space I see 17MB free!
Thanks!
Rob.

Post Reply