Page 2 of 8

Re: WeAct STM32F411CEU6 black pill

Posted: Tue Feb 04, 2020 8:32 am
by jppang
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.

Re: WeAct STM32F411CEU6 black pill

Posted: Mon Feb 10, 2020 4:10 am
by mcauser
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

Re: WeAct STM32F411CEU6 black pill

Posted: Thu Jun 25, 2020 9:04 pm
by SpotlightKid
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?

Re: WeAct STM32F411CEU6 black pill

Posted: Thu Jun 25, 2020 9:42 pm
by dhylands
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).

Re: WeAct STM32F411CEU6 black pill

Posted: Fri Jun 26, 2020 8:58 pm
by rcolistete
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.

Re: WeAct STM32F411CEU6 black pill

Posted: Sat Jun 27, 2020 6:06 am
by SpotlightKid
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.

Re: WeAct STM32F411CEU6 black pill

Posted: Mon Aug 03, 2020 6:00 am
by davef
Has anybody actually managed to build ussl into this port?

Thanks,
Dave

Re: WeAct STM32F411CEU6 black pill

Posted: Wed Aug 05, 2020 11:48 am
by RobH
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.

Re: WeAct STM32F411CEU6 black pill

Posted: Wed Aug 05, 2020 3:49 pm
by rcolistete
'gc.mem_free()' shows the free RAM, not the free space in file system on flash memory.

Re: WeAct STM32F411CEU6 black pill

Posted: Thu Aug 06, 2020 10:04 am
by RobH
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.