cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the Azure STM32Cube example application to build on OSX

SBade.1
Associate II

I'm trying to get the Azure STM32Cube expansion pack to build targeted against a F413H Nucleo board. Using SW4STM32 ide (importing into the CubeIde gives me errors in the prebuild script which are not very informative), I've successfuly built the SECoreBin and the SBSFU modules. Compilation of the Discovery_azure works, however I'm getting a failure in the postbuild processing. The error i'm getting is

 418272  2320 122464 543056  84950 STM32F413H-Discovery_Azure.elf

"../../../../../BootLoader_OSC/2_Images_SECoreBin/SW4STM32/postbuild.sh" "../.." "./STM32F413H-Discovery_Azure.elf" "./STM32F413H-Discovery_Azure.bin" "1" "bigelf"

/bin/bash: 

: No such file or directory

make[1]: *** [post-build] Error 127

make: *** [STM32F413H-Discovery_Azure.elf] Error 2

If i run the postbuild.sh script from the debug directory as it is invoked by the makefile with

sh -x (to get a bit more output). I'm getting errors that are different and earlier. for example, line 14 (which is a blank line) is showing as

+$'\r'

I'm thinking that these files need to somehow be converted to a unix format. there are \r's all over the -x output of the script which seem to be the root of this.

Has anyone gotten the example application to build on a mac?

1 REPLY 1
SBade.1
Associate II

Got past this by running every text file through dos2unix which made the CRLF into LF's. so Bash seems to be much happier. I have even gotten this sample into the STM32CubeIDE. I had to modify the keys.py file since it was trying to load the Cryptodome python module, and the module seems to be named Crypto (pycryptodome installed with pip installs Crypto). I also had to modify the postbuild.sh script to add the path to the STM32_Programmer_ClI in the IDE application directory.

However when I get to the STM32_Programmer_CLI step in the postbuild it's failing with

"../../../../../BootLoader_OSC/2_Images_SECoreBin/SW4STM32/postbuild.sh" "../.." "./STM32F413H-Discovery_Azure.elf" "./STM32F413H-Discovery_Azure.bin" "1" "bigelf"

prepareimage with python script

Generating the global elf file SBSFU and userApp

libc++abi.dylib: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc

../../../../../BootLoader_OSC/2_Images_SECoreBin/SW4STM32/postbuild.sh: line 101: 1738 Abort trap: 6      $command >> $projectdir"/output.txt"

STM32_Programmer_CLI -ms ./STM32F413H-Discovery_Azure.elf ../../PostBuild/STM32F413H-Discovery_Azuresfuh.bin /Users/sbade1/STIDE/STM32CubeExpansion_Cloud_AZURE_V1.2.1/Projects/STM32F413H-Discovery/Applications/BootLoader_OSC/2_Images_SBSFU/SW4STM32/STM32F413H_DISCOVERY_2_Images_SBSFU/Debug/SBSFU.elf : failed

make[1]: *** [makefile:91: post-build] Error 1

make: *** [makefile:58: all] Error 2

"make all" terminated with exit code 2. Build might be incomplete.

Any suggestions?