Page 5 of 8

Re: WeAct STM32F411CEU6 black pill

Posted: Sat Dec 19, 2020 1:33 pm
by RobH
When I try to build the firmware version of today I get the messages as shown below.
How do I solve this?

Code: Select all

boards/WEACT_F411CEU6/bdev.c:16:8: error: unknown type name 'mp_spiflash_cache_t'
   16 | 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'
   23 |     .cache = &spi_bdev_cache,
      |      ^~~~~
boards/WEACT_F411CEU6/bdev.c:23:14: error: excess elements in struct initializer [-Werror]
   23 |     .cache = &spi_bdev_cache,
      |              ^
boards/WEACT_F411CEU6/bdev.c:23:14: note: (near initialization for 'spiflash_config')
cc1: all warnings being treated as errors

Re: WeAct STM32F411CEU6 black pill

Posted: Sat Dec 19, 2020 3:06 pm
by dhylands
The command help('modules') will show you the modules which are built into the firmware:

Code: Select all

>>> help('modules')
__main__          micropython       uasyncio/stream   urandom
_onewire          network           ubinascii         ure
_uasyncio         onewire           ucollections      uselect
builtins          pyb               uctypes           usocket
cmath             stm               uerrno            ustruct
dht               uarray            uhashlib          usys
framebuf          uasyncio/__init__ uheapq            utime
gc                uasyncio/core     uio               utimeq
lcd160cr          uasyncio/event    ujson             uzlib
lcd160cr_test     uasyncio/funcs    umachine
math              uasyncio/lock     uos
Plus any modules on the filesystem

Re: WeAct STM32F411CEU6 black pill

Posted: Mon Dec 28, 2020 7:27 pm
by RDA
dhylands wrote:
Sat Dec 19, 2020 3:06 pm
The command help('modules') will show you the modules which are built into the firmware:

Code: Select all

>>> help('modules')
__main__          micropython       uasyncio/stream   urandom
_onewire          network           ubinascii         ure
_uasyncio         onewire           ucollections      uselect
builtins          pyb               uctypes           usocket
cmath             stm               uerrno            ustruct
dht               uarray            uhashlib          usys
framebuf          uasyncio/__init__ uheapq            utime
gc                uasyncio/core     uio               utimeq
lcd160cr          uasyncio/event    ujson             uzlib
lcd160cr_test     uasyncio/funcs    umachine
math              uasyncio/lock     uos
Plus any modules on the filesystem
Thank you sir and sorry for not being able to give it a go earlier.

So unfortunately this did not get me any closer to my goal which is to get Little File System (either version) added to the board. Looking also at the micropython docs its says "other STM32" only FAT included in the fw.

I have been trying to look on how to get the build ton include the LFS to the fw but cant really find anything. Would be great if someone could tell where to start reading on adding modules and/or altering the build.

Re: WeAct STM32F411CEU6 black pill

Posted: Sat Jan 02, 2021 10:19 pm
by Jeizoo
RobH wrote:
Sat Dec 19, 2020 1:33 pm
When I try to build the firmware version of today I get the messages as shown below.
How do I solve this?
Hi,

Use this fork (https://github.com/jugnu-jethi/WeAct_F4 ... tTimeBuild) to compile with uP 1.13

Hope it helps.

Re: WeAct STM32F411CEU6 black pill

Posted: Sun Jan 03, 2021 10:48 am
by rahmed
I am new to the forum as we as to Micro python but I did work with C, Pascal and microcontrollers in the past. I successfully built firmware for STM32F411CEU6 board based on the mcauser WEACT_F411CEU6 github link and I am able to download to black pill MCU and use it to develop some small projects.

I have now ordered two STM32F411CEU6 Version 3.0 with pre installed Winbond W25Q64 (8 MByte) and was trying to built firmware for the boards and I updated the following parameters in mpconfigboard.h file.

#define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (0)
#define MICROPY_HW_SPIFLASH_SIZE_BITS (64 * 1024 * 1024)

With this changes/updates I am now following Errors and it abort the firmware built process, am I missing some modification in other files, Thanks in advance for your support

------------------Error -------------------------
CC boards/WEACT_F411CEU6/board_init.c
CC boards/WEACT_F411CEU6/bdev.c
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,
^
boards/WEACT_F411CEU6/bdev.c:23:14: note: (near initialization for 'spiflash_config')
cc1: all warnings being treated as errors
make: *** [../../py/mkrules.mk:77: build-WEACT_F411CEU6/boards/WEACT_F411CEU6/bdev.o] Error 1

Re: WeAct STM32F411CEU6 black pill

Posted: Sun Jan 03, 2021 11:23 am
by rahmed
Jeizoo wrote:
Sat Jan 02, 2021 10:19 pm
RobH wrote:
Sat Dec 19, 2020 1:33 pm
When I try to build the firmware version of today I get the messages as shown below.
How do I solve this?
Hi,

Use this fork (https://github.com/jugnu-jethi/WeAct_F4 ... tTimeBuild) to compile with uP 1.13

Hope it helps.
Jeizoo,

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....

Re: WeAct STM32F411CEU6 black pill

Posted: Sun Jan 03, 2021 1:26 pm
by Jeizoo
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 */

Re: WeAct STM32F411CEU6 black pill

Posted: Sun Jan 03, 2021 5:01 pm
by stumin
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.

Re: WeAct STM32F411CEU6 black pill

Posted: Sun Jan 03, 2021 7:20 pm
by rahmed
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

Re: WeAct STM32F411CEU6 black pill

Posted: Sun Jan 03, 2021 8:07 pm
by RobH
@stumin: Thanks for the suggestion to add the #define for the SPI cache: I now have a working firmware V1.13-268!

One remark: the make works fine under Linux Mint 20.0, but produces error messages (different than the ones related to cache) under Linux Mint 20.1-beta. Presumably an issue of the beta.

It was because I forgot to install a prerequisite on my newly installed Mint 20.1:

Code: Select all

sudo apt install gcc-arm-none-eabi