-
Hi Gordon,
sure, it's not trivial and I will go deeper and check further by myself.
just an open question, why not use the HAL/CMSIS files generated by ST tools directly ? I saw for STM32L4 family you are using this approach, MicroPython use this approach too, should be easier and more consistent than from scratch ? or the official library is too buggy ?
-
Hi Gordon,
I guess it's due to you derived the scripts for support of such boards from STM32F4DISCOVERY, which is using STM32F407xx. if the new chip has different peripheral configurations, need tune the scripts manually and seems not straight forward process.
and also in the beginning, I'm referring to Nucleo board BOARD.py file(NUCLEOF411RE.py) and CSV file(stm32f411.csv, stm32f411_af.csv), but seems you have different scripts for Nucleo and Discovery boards(for example in BOARD.py file, Discovery board do not call the function to scan the alternate function file).
-
-
-
-
Hi Gordon,
I have pulled your latest commit and compiled it without errors without any modification. thanks for your great support :)
but still questions and doubts:
1.I have double checked the data sheet of STM32F411VET6, the ADC number is only 1, but if I revise the adc number to 1, the compilation error as attached screen shoot of adc-numbers.
2.I have downloaded from ST website and put the startup_stm32f411xe.s file into targets/lib/stm32f4 folder. if use it, the build will be failed at the final link stage. switch to startup_stm32f401xx.s without issue. see attached screen shoot startup_stm32f411xe-linker-error.
3.I find an error in stm32f411.csv(one line with eventout/adc1_9 instead of eventout,adc1_9, cause the index out of range error), after this error be corrected, I met another error, seems link to ADC, no matter put adc number as 2 or 1, switch the startup files, it's the same error message, see attached screen shoot of error-with-stm32f411-csv. switch back to stm32f40x.csv or stm32f401.csv, they are working.
-
Hi Gordon,
I attach a short screen shoot of the diff between two csv files fyi.
without format error, the python script should work properly...
but now just switch to f411.csv file, the compilation is broken: list index out of range
-->
Traceback (most recent call last):
File "scripts/build_pininfo.py", line 50, inpins = board.get_pins()
File "/Users/dp/Desktop/espmac/scripts/../boards/STM32F411DISCOVERY.py", line 139, in get_pins
pins = pinutils.scan_pin_file([], 'stm32f411.csv', 5, 8, 9)
File "/Users/dp/Desktop/espmac/scripts/pinutils.py", line 197, in scan_pin_file
pin["csv"][head] = pindata[i].strip()
IndexError: list index out of range
make: *** [/Users/dp/Desktop/espmac/gen/jspininfo.h] Error 1
make: *** Waiting for unfinished jobs....
make: *** [/Users/dp/Desktop/espmac/gen/platform_config.h] Error 1 -
Hi Gordon,
follow your suggestion, I have changed the csv file from 'stm32f411.csv'(which created by me following the data sheet)to 'stm32f401.csv'(original) in pinutils.scan_pin_file().
the same applied to pinutils.scan_pin_af_file() - from 'stm32f411_af.csv' to 'stm32f401_af.csv'.
and changed the startup file from 'startup_stm32f411xe.o' to 'startup_stm32f40_41xxx.o'
then the build work successfully.
but I'm more confused as I do not understand the root cause.
why the standard startup file(startup_stm32f411xe.o)is not working ?
the pin definitions is slightly different between stm32f401 and stm32f411, why follow strictly with data sheet, without format error, the parser is not working ?
sorry for the curious as I'm keen on understanding the principals & processes how you do it(how to build or port to new device).
thanks for your kindness.
-
Hi,
one more thing, compile for STM32F4DISCOVERY is successful without touching any file:-->
$make clean && BOARD=STM32F4DISCOVERY RELEASE=1 makeCC src/jshardware_common.o
CC /Users/dp/Desktop/esptest/gen/jswrapper.o
LD espruino_1v94.3381_stm32f4discovery.elf
GEN espruino_1v94.3381_stm32f4discovery.lst
GEN espruino_1v94.3381_stm32f4discovery.bin
GEN espruino_1v94.3381_stm32f4discovery.hex
bash scripts/check_size.sh espruino_1v94.3381_stm32f4discovery.bin
PASS - size of 300720 is under 786432 bytes -
Hi, I attached my STM32F411DISCOVERY.py file too.
I revised a little bit(chip part number) as seems the original source from Espruino repo is not correct.
I added a new startup file : startup_stm32f411xe.s from ST to replace original startup_stm32f401xx.s :
-->
('PRECOMPILED_OBJS+=$(ROOT)/targetlibs/stm32f4/lib/startup_stm32f411xe.o' # FIXME: need change to startup_stm32f40_411xe.S ?) -
Hi, STM32F4DISCOVERY board is "old" and difficult to get so I want to use STM32F411DISCOVERY board to replace. after installed the toolchain on Mac and git clone the latest Espruino github repo, I'm hitting the command in terminal: $make clean && BOARD=STM32F411DISCOVERY RELEASE=1 make, the compilation error report as below:
-->
......
In file included from /Users/dp/Desktop/esptest/gen/jspininfo.c:3:0:
/Users/dp/Desktop/esptest/gen/jspininfo.h:36:18: note: 'functions' declared here
JshPinFunction functions[JSH_PININFO_FUNCTIONS];^~~~~~~~~
/Users/dp/Desktop/esptest/gen/jspininfo.c:86:12: warning: missing initializer for field 'functions' of 'JshPinInfo {aka const struct JshPinInfo}' [-Wmissing-field-initializers]
/* PH0 */ { JSH_PORTH, JSH_PIN0+0, JSH_ANALOG_NONE, { 0, 0, 0, 0, 0 } },^
In file included from /Users/dp/Desktop/esptest/gen/jspininfo.c:3:0:
/Users/dp/Desktop/esptest/gen/jspininfo.h:36:18: note: 'functions' declared here
JshPinFunction functions[JSH_PININFO_FUNCTIONS];^~~~~~~~~
/Users/dp/Desktop/esptest/gen/jspininfo.c:87:12: warning: missing initializer for field 'functions' of 'JshPinInfo {aka const struct JshPinInfo}' [-Wmissing-field-initializers]
/* PH1 */ { JSH_PORTH, JSH_PIN0+1, JSH_ANALOG_NONE, { 0, 0, 0, 0, 0 } },^
In file included from /Users/dp/Desktop/esptest/gen/jspininfo.c:3:0:
/Users/dp/Desktop/esptest/gen/jspininfo.h:36:18: note: 'functions' declared here
JshPinFunction functions[JSH_PININFO_FUNCTIONS];^~~~~~~~~
make: *** [/Users/dp/Desktop/esptest/gen/jspininfo.o] Error 1
make: *** Waiting for unfinished jobs....======
I'm checking the file STM32F411DISCOVERY.py in Espruino/boards and find it seems using the revision of STM32F4DISCOVERY.py with wrong pin definitions in stm32f40x.csv file and also wrong name/alternate function offset, so I edited a new stm32f411.csv file based on the data sheet, the compilation error now becomes :
-->
......
Cleaning targets
Generating platform configs
Generating pin info
Traceback (most recent call last):
File "scripts/build_platform_config.py", line 47, inpins = board.get_pins()
File "/Users/dp/Desktop/espmac/boards/STM32F411DISCOVERY.py", line 139, in get_pins
pins = pinutils.scan_pin_file([], 'stm32f411.csv', 5, 8, 9)
File "/Users/dp/Desktop/espmac/scripts/pinutils.py", line 194, in scan_pin_file
pin["csv"][head] = pindata[i].strip()
IndexError: list index out of range
Traceback (most recent call last):
File "scripts/build_pininfo.py", line 50, inpins = board.get_pins()
File "/Users/dp/Desktop/espmac/scripts/../boards/STM32F411DISCOVERY.py", line 139, in get_pins
pins = pinutils.scan_pin_file([], 'stm32f411.csv', 5, 8, 9)
File "/Users/dp/Desktop/espmac/scripts/pinutils.py", line 194, in scan_pin_file
pin["csv"][head] = pindata[i].strip()
IndexError: list index out of range
make: *** [/Users/dp/Desktop/espmac/gen/jspininfo.h] Error 1
make: *** Waiting for unfinished jobs....
make: *** [/Users/dp/Desktop/espmac/gen/platform_config.h] Error 1======
just generating the pin info, I'm stuck...so I'm checking scripts/pinutils.py to try to find some clues, but still not clear about the potential root cause.
so I'm checking how other STM32 based boards do it, by referring to NUCLEOF401RE.py, I'm adding a new file stm32f411_af.csv based on the data sheet and use the get_pins() function as below:
def get_pins():
pins = pinutils.scan_pin_file([], 'stm32f411.csv', 5, 8, 9)
pins = pinutils.scan_pin_af_file(pins, 'stm32f411_af.csv', 0, 1)
return pinutils.only_from_package(pinutils.fill_gaps_in_pin_list(pins), chip["package"])unfortunately, the compilation error is still the same, so lose clue to move forward...does someone met similar issue or some other documents to understand the pinutils.py logic behind better ? I attached stm32f411.csv and stm32f411_af.csv files for you reference.
-
Hi, anyone made the Bluetooth module(HC-05 like module)working on STM32F4DISCOVERY board ? Espruino is the latest 1v94 version.
web IDE can connect to the board successful
but when upload the code(simple on/off led and console.log()) or reset() in the console terminal, it's not responsive with the famous Espruino logo and result.I have removed the MicroUSB for the normal connection with Mac but just use another USB port to power the board.
I have tried all the UART combinations available on the discovery board but no one working. occasionally the console terminal will response an error message - can't load prompt, upload failed, try to recover.
seems for non-official Espruino board. the feature is disabled(debug wirelessly through Bluetooth, between web IDE and non-official boards).
if wirelessly debugging through Bluetooth can only be supported by official Espruino board, I need try to buy Espruino WiFi and Pico asap :) instead of wasting time on trying Nucleo or Discovery board ...
thanks
-
-
Hi Gordon,
thanks and very clear. double check again, indeed STM32L4 porting is based on LL library instead of HAL. and Espruino is more memory efficient than MicroPython.
hope it's not offensive, many people will check both Espruino and MicroPython, at least for me MicroPython seems easier for new comer the way different vendor/board/chip/process organized. I know it's carping and unfair to you as Espruino is almost your one-man story. hope no hard feeling to you, I really enjoy and thanks for your creation :)