Home

Awesome

WeAct STM32F411CEU6

MicroPython board definition files for the WeAct V1.3 STM32F411CEU6 dev board.

board

Build the firmware

Clone the board definitions to your MicroPython ports/stm32/boards folder.

cd micropython/ports/stm32/boards
git clone https://github.com/mcauser/WEACT_F411CEU6.git

cd ..
make BOARD=WEACT_F411CEU6

Flashing via DFU

This board can be flashed using DFU. To put the board in DFU mode, disconnect USB, connect A9 to A10 and reconnect USB. Press and hold BOOT0. Press and release RESET. Wait 0.5 seconds. Release BOOT0.

List attached DFU capable devices to check you are in DFU mode.

dfu-util -l

Found DFU: [0483:df11] ver=2200, devnum=12, cfg=1, intf=0, path="20-2", alt=3, name="@Device Feature/0xFFFF0000/01*004 e", serial="328A37623437"
Found DFU: [0483:df11] ver=2200, devnum=12, cfg=1, intf=0, path="20-2", alt=2, name="@OTP Memory /0x1FFF7800/01*512 e,01*016 e", serial="328A37623437"
Found DFU: [0483:df11] ver=2200, devnum=12, cfg=1, intf=0, path="20-2", alt=1, name="@Option Bytes  /0x1FFFC000/01*016 e", serial="328A37623437"
Found DFU: [0483:df11] ver=2200, devnum=12, cfg=1, intf=0, path="20-2", alt=0, name="@Internal Flash  /0x08000000/04*016Kg,01*064Kg,03*128Kg", serial="328A37623437"

Now you can flash the board using USB with the command:

make BOARD=WEACT_F411CEU6 deploy

Once the upload is complete, disconnect USB, remove jumper between A9 and A10, then reconnect USB.

Alternatively, you can use the MicroPython command pyb.bootloader() to get into DFU mode without needing to use the switch.

Currently, you need to unplug and replug the board in order to switch from DFU mode back to regular mode.

Accessing the board

Once built and deployed, you can access the MicroPython REPL (the Python prompt) via USB serial.

screen /dev/tty.usbmodem1422 115200
# or
screen /dev/ttyACM0 115200

Flash

In mpconfigboard.h you can configure the board to use F411CE internal flash or if you add a SPI flash chip to the bottom of the board you can use it instead.

If you use internal, there's only around 45kb free. With external you can have 4-16 MB.

// Use internal flash (512 KByte):
#define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (1)

// Or use external SPI flash:
#define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (0)

Tested with:

Define the size that matches your flash chip.

// Winbond W25Q32 (4 MByte)
#define MICROPY_HW_SPIFLASH_SIZE_BITS (32 * 1024 * 1024)

// Or Winbond W25Q64 (8 MByte)
#define MICROPY_HW_SPIFLASH_SIZE_BITS (64 * 1024 * 1024)

// Or Winbond W25Q128 (16 MByte)
#define MICROPY_HW_SPIFLASH_SIZE_BITS (128 * 1024 * 1024)

If you use the wrong one, say 8 MB but you only have a 4 MB chip, it will appear as an 8 MB volume and let you write more than 4 MB, but you absolutely will get data corruption.

You can also use external SPI flash modules. Most modules have WP/IO2 and HOLD/RESET/IO3 pulled high, so you can't use Quad SPI mode, only SPI.

spi flash

Specifications

Exposed Port Pins

Peripherals

SPI Flash (U3) Unpopulated

SWD debug (P3)

USB-C (J1)

User LED

Links

Related boards

License

Licensed under the MIT License.