mcauser / WEACT_F411CEU6

MicroPython board definition for the WeAct STM32F411CEU6 board
121 stars 33 forks source link

Compiling v 1.14 with Winbond W25Q128 external flash #10

Open RaulKompass opened 3 years ago

RaulKompass commented 3 years ago

Hello,

I compiled with Micropython v 1.14 under Manjaro Linux.

After

sudo pacman -S arm-none-eabi-gcc arm-none-eabi-newlib sudo pacman -S stlink

I had no Problem compiling with the predefined settings. I noticed (too) that it was necessary to change into mpy-cross directory and execute make there before going to stm32 directory and making with make BOARD=WEACT_F411CEU6 .

I could use make BOARD=WEACT_F411CEU6 deploy-stlink with my STLink v2 connected to the Blackpill board. It gave an error first but repeating a second time I had success.

Now my Problem: In a second attempt I wanted to make binaries for my Blackpill boards from Canaduino which have Winbond W25Q128 (16 MByte) external flash added.

Following instructions here I set

define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (0)

and later uncommented

define MICROPY_HW_SPIFLASH_SIZE_BITS (128 1024 1024)

After executing the make command I ran into the Error that the type mp_spiflash_cache_t was not defined.

Therefore I had to adapt the sources a very little bit:

I included

include "../../drivers/memory/spiflash.h"

in line 2 of bdev.c (after #include "storage.h")

and

define MICROPY_HW_SPIFLASH_ENABLE_CACHE (1)

in line 104 of mpconfigport.h (after #define MICROPY_HW_SPIFLASH_MOSI (pin_A7) ).

And then it compiled and worked.

@mcauser : Sorry, I'm not familiar enough with git to make a pull-request. I hope you read this and make these changes.

A question: Do we need cache for the spiflash at all?

Greetings and thank you for your work.

rkompass

umbors commented 3 years ago

I encountered the same problem when I try to build it and solved refer to the method you said in the issue. Guess it is just a mistake and I would try to make a pull-request.

mathstudi commented 3 years ago

Hi, Just FYI! WeAct have their own port: https://github.com/WeActTC/WeAct_F411CE-MicroPython. Cheers

rkompass commented 2 years ago

I compiled 4 versions of micropython v 1.17. Just including #define MICROPY_HW_SPIFLASH_ENABLE_CACHE (1) in line 104 of mpconfigport.h (after #define MICROPY_HW_SPIFLASH_MOSI (pin_A7) ). was sufficient, no need to change bdev.c . I will drop the binaries here: build1.17-WEACT_F411CEU6.zip is for Blackpill board without SPI Flash. build1.17-WEACT_F411CEU6_W25Q128.zip is for Blackpill board with W25Q128 SPI Flash.

rkompass commented 2 years ago

And build1.17-WEACT_F411CEU6_ulab.zip is with ulab, no external flash. build1.17-WEACT_F411CEU6_W25Q128_ulab.zip with ulab, for W25Q128 SPI Flash. If you solder the flash, don't forget the 100nF buffer capacitor.