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.
Jeizooo
Posts: 10
Joined: Mon Jan 04, 2021 10:14 am

Re: WeAct STM32F411CEU6 black pill

Post by Jeizooo » Mon Jan 04, 2021 10:29 am

rahmed wrote:
Sun Jan 03, 2021 7:20 pm
Jeizoo,
Thanks for the quick reply. You are right that I don't have the highlighted updates in stm32f4xx_hal_conf.h file. I need so guidance/help how to download the latest Branch using Git as tried to download the Zip file and update it manually but it gave me errors as I am assuming that there are object files in the overall package
Appreciate you support and Thanks in advance for the help.

Kind Regards
Rizwan
Delete the current board directory (ports/stm32/boards/WeAct_F411CE/), compilation directory (ports/stm32/build-WeAct_F411CE/)
In ports/stm32/boards directory:

Code: Select all

git clone https://github.com/jugnu-jethi/WeAct_F411CE-MicroPython.git WeAct_F411CE
Switch to branch:

Code: Select all

cd WeAct_F411CE
git checkout myFix_FirstTimeBuild
Then in ports/stm32:

Code: Select all

make clean
to be sure nothing remains from previous compilation.
Then

Code: Select all

make BOARD=WeAct_F411CE -j4
Hope it helps!

rahmed
Posts: 11
Joined: Sun Jan 03, 2021 10:15 am

Re: WeAct STM32F411CEU6 black pill

Post by rahmed » Mon Jan 04, 2021 10:32 am

stumin wrote:
Sun Jan 03, 2021 5:01 pm
If you're having problem compiling firmware for STM32F411CEU6 and getting these error:
"
boards/WEACT_F411CEU6/bdev.c:16:8: error: unknown type name 'mp_spiflash_cache_t'
STATIC mp_spiflash_cache_t spi_bdev_cache;
^~~~~~~~~~~~~~~~~~~
boards/WEACT_F411CEU6/bdev.c:23:6: error: 'const struct _mp_spiflash_config_t' has no member named 'cache'
.cache = &spi_bdev_cache,
^~~~~
boards/WEACT_F411CEU6/bdev.c:23:14: error: excess elements in struct initializer [-Werror]
.cache = &spi_bdev_cache
"
then try inserting:

#define MICROPY_HW_SPIFLASH_ENABLE_CACHE (1)

in boards/WEACT_F411CEU6/mpconfigboard.h
I have it after MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE

...
// 1 = use internal flash (512 KByte)
// 0 = use onboard SPI flash (4 MByte) Winbond W25Q32
#define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (0)
#define MICROPY_HW_SPIFLASH_ENABLE_CACHE (1)
...

Hopefully it will work for you.
Hi stumin,

Thanks for the help, i was able to compile and was able to download to the board delivered today.

Thanks very much

rahmed
Posts: 11
Joined: Sun Jan 03, 2021 10:15 am

Re: WeAct STM32F411CEU6 black pill

Post by rahmed » Mon Jan 04, 2021 10:41 am

rahmed wrote:
Sun Jan 03, 2021 7:20 pm
Jeizoo wrote:
Sun Jan 03, 2021 1:26 pm
rahmed wrote:
Sun Jan 03, 2021 11:23 am
I used your link and I am getting the following error

adc.h:50:29: error: 'LL_ADC_PATH_INTERNAL_VBAT' undeclared (first use in this function); did you mean 'HAL_ADC_ERROR_INTERNAL'?
adc_common->CCR &= ~LL_ADC_PATH_INTERNAL_VBAT;
^~~~~~~~~~~~~~~~~~~~~~~~~
HAL_ADC_ERROR_INTERNAL
adc.h:50:29: note: each undeclared identifier is reported only once for each function it appears in
make: *** [../../py/mkrules.mk:77: build-WeAct_F411CE/machine_adc.o] Error 1
make: *** Waiting for unfinished jobs....
Check that you pulled the right branch of the git repo (myFix_FirstTimeBuild)

This error is fixed in the above branch with this in stm32f4xx_hal_conf.h

Code: Select all

#ifdef HAL_ADC_MODULE_ENABLED
  #include "stm32f4xx_hal_adc.h"
THIS LINE ---->  #include "stm32f4xx_ll_adc.h"
#endif /* HAL_ADC_MODULE_ENABLED */
Jeizoo,
Thanks for the quick reply. You are right that I don't have the highlighted updates in stm32f4xx_hal_conf.h file. I need so guidance/help how to download the latest Branch using Git as tried to download the Zip file and update it manually but it gave me errors as I am assuming that there are object files in the overall package
Appreciate you support and Thanks in advance for the help.

Kind Regards
Rizwan
Hi Jeizoo,

I manually change the file and was able to to compile and I now have a working firmware. Thanks for the support extended.
But I will still be interested in finding out how to download the latest Branch using Git. I tried searching but was not able find the right information.

rahmed
Posts: 11
Joined: Sun Jan 03, 2021 10:15 am

Re: WeAct STM32F411CEU6 black pill

Post by rahmed » Mon Jan 04, 2021 11:08 am

Jeizooo wrote:
Mon Jan 04, 2021 10:29 am
rahmed wrote:
Sun Jan 03, 2021 7:20 pm
Jeizoo,
Thanks for the quick reply. You are right that I don't have the highlighted updates in stm32f4xx_hal_conf.h file. I need so guidance/help how to download the latest Branch using Git as tried to download the Zip file and update it manually but it gave me errors as I am assuming that there are object files in the overall package
Appreciate you support and Thanks in advance for the help.

Kind Regards
Rizwan
Delete the current board directory (ports/stm32/boards/WeAct_F411CE/), compilation directory (ports/stm32/build-WeAct_F411CE/)
In ports/stm32/boards directory:

Code: Select all

git clone https://github.com/jugnu-jethi/WeAct_F411CE-MicroPython.git WeAct_F411CE
Switch to branch:

Code: Select all

cd WeAct_F411CE
git checkout myFix_FirstTimeBuild
Then in ports/stm32:

Code: Select all

make clean
to be sure nothing remains from previous compilation.
Then

Code: Select all

make BOARD=WeAct_F411CE -j4
Hope it helps!
Thanks once again, it worked liked a charm and thanks for the precise instruction.

Jeizooo
Posts: 10
Joined: Mon Jan 04, 2021 10:14 am

Re: WeAct STM32F411CEU6 black pill

Post by Jeizooo » Mon Jan 04, 2021 3:22 pm

rahmed wrote:
Mon Jan 04, 2021 10:41 am

Hi Jeizoo,

I manually change the file and was able to to compile and I now have a working firmware. Thanks for the support extended.
But I will still be interested in finding out how to download the latest Branch using Git. I tried searching but was not able find the right information.
You don't download a branch, you switch your local git repo to a branch...

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 » Mon Jan 04, 2021 4:08 pm

Jeizooo wrote:
Mon Jan 04, 2021 10:29 am
Then in ports/stm32:

Code: Select all

make clean
to be sure nothing remains from previous compilation.
Then

Code: Select all

make BOARD=WeAct_F411CE -j4
I just thought I'd point out that running

Code: Select all

make clean
without specifying BOARD= will do a clean of the default board, which is PYBV10.

You really want to do:

Code: Select all

make BOARD=WeAct_F411CE clean

rahmed
Posts: 11
Joined: Sun Jan 03, 2021 10:15 am

Re: WeAct STM32F411CEU6 black pill

Post by rahmed » Mon Jan 04, 2021 6:30 pm

dhylands wrote:
Mon Jan 04, 2021 4:08 pm
Jeizooo wrote:
Mon Jan 04, 2021 10:29 am
Then in ports/stm32:

Code: Select all

make clean
to be sure nothing remains from previous compilation.
Then

Code: Select all

make BOARD=WeAct_F411CE -j4
I just thought I'd point out that running

Code: Select all

make clean
without specifying BOARD= will do a clean of the default board, which is PYBV10.

You really want to do:

Code: Select all

make BOARD=WeAct_F411CE clean
Thanks Dave- I was wondering that why I got the message the following message for removing the directory for PYBV10
rm -rf build-PYBV10

Jeizooo
Posts: 10
Joined: Mon Jan 04, 2021 10:14 am

Re: WeAct STM32F411CEU6 black pill

Post by Jeizooo » Tue Jan 05, 2021 5:30 pm

This issue may be useful (https://github.com/mcauser/WEACT_F411CEU6/issues/9) concerning mp_spiflash_cache_t error.

I got this error when using onboard flash.
Try
...
// 1 = use internal flash (512 KByte)
// 0 = use onboard SPI flash (4 MByte) Winbond W25Q32
#define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (0)
#define MICROPY_HW_SPIFLASH_ENABLE_CACHE (1)
...

in boards/WEACT_F411CEU6/mpconfigboard.h

with "#define MICROPY_HW_SPIFLASH_ENABLE_CACHE (1)" I managed to compile without problem.
Compilation working for me...

CATSUPERBERG
Posts: 5
Joined: Mon Jan 11, 2021 12:47 pm

Re: WeAct STM32F411CEU6 black pill

Post by CATSUPERBERG » Mon Jan 11, 2021 12:50 pm

Does STM32F411 port have "@micropython.asm_thumb" and can i use FPU?

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 Jan 13, 2021 4:01 am

Yes, it is supported. Example :

Code: Select all

@micropython.asm_thumb
def toggleLED_asm_thumb():
    movwt(r1, stm.GPIOC)    # LED(1) is PC13
    add(r1, stm.GPIO_BSRRL)
    movw(r5, 1 << 13)       # r5 has mask for BSRR register
# loop
    label(loop)
    strh(r5, [r1, 0])       # Turn the LED on
    strh(r5, [r1, 2])       # Turn the LED off
    bl(loop)
When running at default 96 MHz, it gives a frequency f = 16.0 MHz. While pure MicroPython gives f = 116 kHz.

And the STM32F411CEU6 is a 32 bit ARM Cortex-M4 @ 96 MHz (máx. 100 MHz), with single precision hardware floating point unit (FPU).
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).

Post Reply