Thanks for the answer with example, i guess the port for my F401CC (256 kb) doesn't support it, gonna wait for my F411CE boards.
WeAct STM32F411CEU6 black pill
-
- Posts: 5
- Joined: Mon Jan 11, 2021 12:47 pm
Re: WeAct STM32F411CEU6 black pill
Re: WeAct STM32F411CEU6 black pill
Hi,
I'm quite new to MP and STM32, so please forgive me if my question is too trivial!
Is there a way to extend the allowed maximum firmware size during compile when I use W25Q128?
I figured out that I need to search around FLASH_TEXT and FLASH_FS... but I'm stuck here.
My reason:
I try to compile a FW with WIZNET5K and LWIP support and I try to freeze the MicroWebSrv2 module into it.
Without the MicroWebSrv2 it compiles fine, but as soon as I try to integrate it, I got the following error:
I'm quite new to MP and STM32, so please forgive me if my question is too trivial!
Is there a way to extend the allowed maximum firmware size during compile when I use W25Q128?
I figured out that I need to search around FLASH_TEXT and FLASH_FS... but I'm stuck here.
My reason:
I try to compile a FW with WIZNET5K and LWIP support and I try to freeze the MicroWebSrv2 module into it.
Code: Select all
make MICROPY_PY_WIZNET5K=5500 MICROPY_PY_LWIP=1 BOARD=WEACT_F411CEU6 -j2
Code: Select all
LINK build-WEACT_F411CEU6/firmware.elf
arm-none-eabi-ld: build-WEACT_F411CEU6/firmware.elf section `.text' will not fit in region `FLASH_TEXT'
arm-none-eabi-ld: region `FLASH_TEXT' overflowed by 30536 bytes
make: *** [Makefile:669: build-WEACT_F411CEU6/firmware.elf] Error 1
Re: WeAct STM32F411CEU6 black pill
Hello everyone! I have this "black pill" f401ccu6 board. I bought it a long time ago and haven't used it, but I now need a board on which to put mycropython. On the back of the board it says "weact v2.0". I wasn't able to find an image for it, the official github page has documentation and images for f401ceu6. Any way to get micropython running on this?
-
- Posts: 463
- Joined: Wed Apr 08, 2015 5:19 am
Re: WeAct STM32F411CEU6 black pill
This is apparently an update of this variant of the Black Pill:
https://stm32-base.org/boards/STM32F401 ... -Pill-V1.2
You need to compile your own firmware for this variant of the Black Pill.
You should be able to use this board definition from WeACT:
https://github.com/YXZhu/micropython/tr ... Act_F401CC
You can follow the instructions for mcausers board definition for the STM32F411CEU6:
https://github.com/mcauser/WEACT_F411CEU6
And adapt them where necessary.
Hth, Chris
https://stm32-base.org/boards/STM32F401 ... -Pill-V1.2
You need to compile your own firmware for this variant of the Black Pill.
You should be able to use this board definition from WeACT:
https://github.com/YXZhu/micropython/tr ... Act_F401CC
You can follow the instructions for mcausers board definition for the STM32F411CEU6:
https://github.com/mcauser/WEACT_F411CEU6
And adapt them where necessary.
Hth, Chris
Re: WeAct STM32F411CEU6 black pill
Ok so I tried doing just that, got the board definitions and tried building but I get a bunch of errors and compilation stops:
and so on...
Code: Select all
In file included from ./mpconfigport.h:31,
from ../../py/mpconfig.h:62,
from ../../lib/oofatfs/ffconf.h:30,
from ../../lib/oofatfs/ff.h:33,
from ../../lib/oofatfs/ff.c:28:
boards/WeAct_F401CC/mpconfigboard.h:19: error: "MICROPY_VFS_FAT" redefined [-Werror]
19 | #define MICROPY_VFS_FAT (0)
|
<command-line>: note: this is the location of the previous definition
cc1: all warnings being treated as errors
In file included from ./mpconfigport.h:31,
from ../../py/mpconfig.h:62,
from ../../lib/oofatfs/ffconf.h:30,
from ../../lib/oofatfs/ff.h:33,
from ../../lib/oofatfs/ffunicode.c:26:
boards/WeAct_F401CC/mpconfigboard.h:19: error: "MICROPY_VFS_FAT" redefined [-Werror]
19 | #define MICROPY_VFS_FAT (0)
|
Re: WeAct STM32F411CEU6 black pill
Hi bartag,
Did you modify your mpconfigboard.h file?
I tried your line:
without WIZNET and it compiled for me using arm-none-eabi-gcc-4.9.3 on a 32 bit machine. Thanks for the hint ... I have been messing around in the mpconfigboard files ... this looks an easier way to do it.
I would like to build in support for PPP as well so I can try to talk to a Huawei 3G dongle. Any suggestions?
Thanks,
Dave
Did you modify your mpconfigboard.h file?
I tried your line:
Code: Select all
make MICROPY_PY_LWIP=1 BOARD=WEACT_F411CEU6 -j2
I would like to build in support for PPP as well so I can try to talk to a Huawei 3G dongle. Any suggestions?
Thanks,
Dave
Re: WeAct STM32F411CEU6 black pill
bartag,
I tried building with the W25Q32 by changing line 9 in mpconfigboard.h and got the same problem. I think there are some hints earlier in this thread so I am off to re-read them.
Tried the other fork here:
and got the same error. I noticed that the lines:
were not in his mpconfigboard.h file. Even including them made no difference.
Off to find who generates the FLASH_TEXT message.
Both firmware.map and stm32f411.ld have the name FLASH_TEXT in them, the first length 0x00060000 (393,216) and the second 384K.
Doesn't something need to change these numbers when you use bigger flash?
I tried building with the W25Q32 by changing line 9 in mpconfigboard.h and got the same problem. I think there are some hints earlier in this thread so I am off to re-read them.
Tried the other fork here:
Code: Select all
git clone https://github.com/jugnu-jethi/WeAct_F411CE-MicroPython.git WeAct_F411CE
Code: Select all
#define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (0)
#define MICROPY_HW_SPIFLASH_ENABLE_CACHE (1)
Off to find who generates the FLASH_TEXT message.
Both firmware.map and stm32f411.ld have the name FLASH_TEXT in them, the first length 0x00060000 (393,216) and the second 384K.
Doesn't something need to change these numbers when you use bigger flash?
Re: WeAct STM32F411CEU6 black pill
@davef
I don't know if this is the proper solution, but this worked for me:
In STM32F411.ld I changed from this:
To this:
Whit this the compiler does not drop an error about the firmware size.
Unfortunatelly the
does not work anymore, because it tries to flash the two chunks into the original addresses (0x08000000 and 0x08020000, instead of 0x08000000 and 0x08008000)
I was able to write the firmware with the following two commands:
!!TODO: It would be nice to get rid of that remaining 16K FLASH_FS part (external SPI flash is used, that 16K is not in use), and add that area to the FLASH_TEXT.
So at the end, it compiled, it could be flashed... but the RAM is not enough to load .pyhtml files to the MicroWebSrv2... but this is just my problem, the basic task (enlarge the size of the FLASH_TEXT) is done
I don't know if this is the proper solution, but this worked for me:
In STM32F411.ld I changed from this:
Code: Select all
/* Specify the memory areas */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */
FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 112K /* sectors 1,2,3 are 16K, 4 is 64K */
FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 384K /* sectors 5,6,7 are 128K */
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
}
Code: Select all
/* Specify the memory areas */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */
FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 16K /* */
FLASH_TEXT (rx) : ORIGIN = 0x08008000, LENGTH = 480K /* */
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
}
Unfortunatelly the
Code: Select all
dfu-util --alt 0 -D <path to .dfu>
I was able to write the firmware with the following two commands:
Code: Select all
dfu-util -s 0x08000000:leave -a 0 -D firmware0.bin
dfu-util -s 0x08008000:leave -a 0 -D firmware1.bin
So at the end, it compiled, it could be flashed... but the RAM is not enough to load .pyhtml files to the MicroWebSrv2... but this is just my problem, the basic task (enlarge the size of the FLASH_TEXT) is done
Re: WeAct STM32F411CEU6 black pill
@bartag,
You have exceeded my rather limited knowledge-base.
Good luck, hope someone else can help!
You have exceeded my rather limited knowledge-base.
Good luck, hope someone else can help!
-
- Posts: 5
- Joined: Mon Jan 11, 2021 12:47 pm
Re: WeAct STM32F411CEU6 black pill
When I build firmware using files from "jugnu-jethi/WeAct_F411CE-MicroPython" or modified mcauser files (to fix building errors) everything seems to work fine. But reset to factory settings feature doesn't work. It seems it activates but can't do what it supposed to do. I press the "key" button, than reset the board, wait for LED to flash 3 times, than release "key", LED lights up for a couple of seconds like it writes to the flash, but all the files are still there, it doesn't go to default empty boot.py and main.py.
Is there a way to bring it back to working order? It works with firmwares from WeAct github.
Also, with latest source build fails with this error: error: implicit declaration of function 'LL_USART_SetBaudRate'. I think i solved it by adding "#include "stm32f4xx_ll_usart.h"" to stm32f4xx_hal_conf.h (after #ifdef HAL_UART_MODULE_ENABLED).
Is there a way to bring it back to working order? It works with firmwares from WeAct github.
Also, with latest source build fails with this error: error: implicit declaration of function 'LL_USART_SetBaudRate'. I think i solved it by adding "#include "stm32f4xx_ll_usart.h"" to stm32f4xx_hal_conf.h (after #ifdef HAL_UART_MODULE_ENABLED).