Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling v 1.14 with Winbond W25Q128 external flash #10

Open
RaulKompass opened this issue Feb 11, 2021 · 4 comments
Open

Compiling v 1.14 with Winbond W25Q128 external flash #10

RaulKompass opened this issue Feb 11, 2021 · 4 comments

Comments

@RaulKompass
Copy link

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
Copy link

umbors commented Apr 10, 2021

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.

@umbors umbors mentioned this issue Apr 10, 2021
@mathstudi
Copy link

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

@rkompass
Copy link

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants