"external build" (using external makefiles tree) is very slow and buggy
As an exemple, the following part of makefile does not execute the same way on two successive build launched from “external build”.
It’s like if the $(shell...) command was not reliable when used from stm32 workbench.
Notice that exactly the same makefile source launched from cygwin works very well ...
...
CFLAGS += -DWTC_ROM_BLOCKS_PLACEMENTS_H="$(WTC_ROM_BLOCKS_PLACEMENTS_H)"
aWRM_INFOD_START = $(shell cat “$(WTC_ROM_BLOCKS_PLACEMENTS_H)” | grep ‘aWRM_INFOD_START’ | tr -s ’ ’ | cut -d ’ ’ -f 3 - )
aWRM_INFOC_START = $(shell cat “$(WTC_ROM_BLOCKS_PLACEMENTS_H)” | grep ‘aWRM_INFOC_START’ | tr -s ’ ’ | cut -d ’ ’ -f 3 - )
aWRM_INFOB_START = $(shell cat “$(WTC_ROM_BLOCKS_PLACEMENTS_H)” | grep ‘aWRM_INFOB_START’ | tr -s ’ ’ | cut -d ’ ’ -f 3 - )
aWRM_INFOA_START = $(shell cat “$(WTC_ROM_BLOCKS_PLACEMENTS_H)” | grep ‘aWRM_INFOA_START’ | tr -s ’ ’ | cut -d ’ ’ -f 3 - )
aWRM_CALIBRATION_DATA_START = $(shell cat “$(WTC_ROM_BLOCKS_PLACEMENTS_H)” | grep ‘aWRM_CALIBRATION_DATA_START’ | tr -s ’ ’ | cut -d ’ ’ -f 3 - )
aWRM_ZCD_DEFAULT_CONF_START = $(shell cat “$(WTC_ROM_BLOCKS_PLACEMENTS_H)” | grep ‘aWRM_ZCD_DEFAULT_CONF_START’ | tr -s ’ ’ | cut -d ’ ’ -f 3 - )
aWRM_LORAWAN_FCNTUP_LSB_BUF_START = $(shell cat “$(WTC_ROM_BLOCKS_PLACEMENTS_H)” | grep ‘aWRM_LORAWAN_FCNTUP_LSB_BUF_START’ | tr -s ’ ’ | cut -d ’ ’ -f 3 - )
aWRM_ZCD_BR_STORED_DATA_START = $(shell cat “$(WTC_ROM_BLOCKS_PLACEMENTS_H)” | grep ‘aWRM_ZCD_BR_STORED_DATA_START’ | tr -s ’ ’ | cut -d ’ ’ -f 3 - )
aWRM_ZCD_STORED_DATA_START = $(shell cat “$(WTC_ROM_BLOCKS_PLACEMENTS_H)” | grep ‘aWRM_ZCD_STORED_DATA_START’ | tr -s ’ ’ | cut -d ’ ’ -f 3 - )
aWRM_START_OF_RESERVED_ROM = $(shell cat “$(WTC_ROM_BLOCKS_PLACEMENTS_H)” | grep ‘aWRM_START_OF_RESERVED_ROM’ | tr -s ’ ’ | cut -d ’ ’ -f 3 - )
aWRM_END_OF_RESERVED_ROM = $(shell cat “$(WTC_ROM_BLOCKS_PLACEMENTS_H)” | grep ‘aWRM_END_OF_RESERVED_ROM’ | tr -s ’ ’ | cut -d ’ ’ -f 3 - )
${info }
${info SPECIFIC ROM DATA MEMORY MAPPING :}
${info ..aWRM_INFOD_START : $(aWRM_INFOD_START)}
${info ..aWRM_INFOC_START : $(aWRM_INFOC_START)}
${info ..aWRM_INFOB_START : $(aWRM_INFOB_START)}
${info ..aWRM_INFOA_START : $(aWRM_INFOA_START)}
${info ..aWRM_CALIBRATION_DATA_START : $(aWRM_CALIBRATION_DATA_START)}
${info ..aWRM_ZCD_STORED_DATA_START : $(aWRM_ZCD_STORED_DATA_START)}
${info ..aWRM_ZCD_BR_STORED_DATA_START : $(aWRM_ZCD_BR_STORED_DATA_START)}
${info ..aWRM_LORAWAN_FCNTUP_LSB_BUF_START : $(aWRM_LORAWAN_FCNTUP_LSB_BUF_START)}
${info ..aWRM_ZCD_DEFAULT_CONF_START : $(aWRM_ZCD_DEFAULT_CONF_START)}
${info }
${info ..aWRM_START_OF_RESERVED_ROM : $(aWRM_START_OF_RESERVED_ROM)}
${info ..aWRM_END_OF_RESERVED_ROM : $(aWRM_END_OF_RESERVED_ROM)}
${info .. Size : $(shell printf “%d kB” $(( ($(aWRM_END_OF_RESERVED_ROM) - $(aWRM_START_OF_RESERVED_ROM)) / 1024 )) )}
${info ..NOTE: Verify LD Script compatibility with this ROM Mapping }
...
On two successive launch this could give the two differently erroneous results :
First launch result:
SPECIFIC ROM DATA MEMORY MAPPING :
5
..aWRM_INFOD_START :
..aWRM_INFOC_START : 0x807B800
..aWRM_INFOB_START : 0x807C000
..aWRM_INFOA_START : 0x807C800
..aWRM_CALIBRATION_DATA_START :
..aWRM_ZCD_STORED_DATA_START : 0x807D800
5
..aWRM_ZCD_BR_STORED_DATA_START :
..aWRM_LORAWAN_FCNTUP_LSB_BUF_START : 0x807F800
5
..aWRM_ZCD_DEFAULT_CONF_START :
..aWRM_START_OF_RESERVED_ROM : 0x807A800
..aWRM_END_OF_RESERVED_ROM : 0x8080000
.. Size : 22 kB
..NOTE: Verify LD Script compatibility with this ROM Mapping
Second launch result:
SPECIFIC ROM DATA MEMORY MAPPING :
5
..aWRM_INFOD_START :
..aWRM_INFOC_START : 0x807B800
5
..aWRM_INFOB_START :
5
..aWRM_INFOA_START :
..aWRM_CALIBRATION_DATA_START :
5
..aWRM_ZCD_STORED_DATA_START :
5
..aWRM_ZCD_BR_STORED_DATA_START :
..aWRM_LORAWAN_FCNTUP_LSB_BUF_START : 0x807F800
..aWRM_ZCD_DEFAULT_CONF_START : 0x807D000
..aWRM_START_OF_RESERVED_ROM : 0x807A800
..aWRM_END_OF_RESERVED_ROM : 0x8080000
.. Size : 22 kB
..NOTE: Verify LD Script compatibility with this ROM Mapping
The the correct result obtained from cygwin
SPECIFIC ROM DATA MEMORY MAPPING :
..aWRM_INFOD_START : 0x807B000
..aWRM_INFOC_START : 0x807B800
..aWRM_INFOB_START : 0x807C000
..aWRM_INFOA_START : 0x807C800
..aWRM_CALIBRATION_DATA_START :
..aWRM_ZCD_STORED_DATA_START : 0x807D800
..aWRM_ZCD_BR_STORED_DATA_START : 0x807F000
..aWRM_LORAWAN_FCNTUP_LSB_BUF_START : 0x807F800
..aWRM_ZCD_DEFAULT_CONF_START : 0x807D000
..aWRM_START_OF_RESERVED_ROM : 0x807A800
..aWRM_END_OF_RESERVED_ROM : 0x8080000
.. Size : 22 kB
..NOTE: Verify LD Script compatibility with this ROM Mapping