You are reading a single comment by @hutu and its replies. Click here to read the full conversation.
  • 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, in

    pins = board.get_pins()
    

    File "/Users/dp/Desktop/espmac/boards/STM32F4­11DISCOVERY.py", line 139, in get_pins

    pins = pinutils.scan_pin_file([], 'stm32f411.csv', 5, 8, 9)
    

    File "/Users/dp/Desktop/espmac/scripts/pinuti­ls.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, in

    pins = board.get_pins()
    

    File "/Users/dp/Desktop/espmac/scripts/../boa­rds/STM32F411DISCOVERY.py", line 139, in get_pins

    pins = pinutils.scan_pin_file([], 'stm32f411.csv', 5, 8, 9)
    

    File "/Users/dp/Desktop/espmac/scripts/pinuti­ls.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_c­onfig.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.


    2 Attachments

About

Avatar for hutu @hutu started