Skip to main content
Visitor II
November 26, 2020
Solved

[Solved] Directions on how to run AWS IoT on 32F413HDISCOVERY

  • November 26, 2020
  • 7 replies
  • 1297 views

Hello,

quite new to STM32 platform (used during the university time, then moved to a competitor for work). I am now trying to come back. In particular I want to set up a small IoT project.

I bought a 32F413HDISCOVERY board and I am using STM32CubeIDE. I would like to use AWS IoT so I have downloaded X-CUBE-AWS 1.4.1 and I went through the documentation UM2178 rev 1 (the latest rev 4 is only for X-CUBE-AWS 2.0 and I cannot find the other revisions).

I have all set up from AWS point of view. And now I am stuck.

I have tried importing the project contained in the zip file for my board and compile, but I get errors. In the manual is written that something show be flashed, but it is unclear which file.

Can I get some indications on how to go on? Is it a problem of the IDE (that did not exist when the manual was written)?

Thanks in advance

Davide

    This topic has been closed for replies.
    Best answer by DDori.1

    Thanks for the correction, but it was not the solution. I am not an expert in bash scripts, but based on the error I posted before, the script goes to the "else" section, so the problem is not with the PATH definition only. I have removed the check if the script is running on Windows. Now the script looks like below and it is working! Thank you a lot.

     if [ $ret == 0 ] && [ $# == 5 ]; then
     echo "Generating the global elf file SBSFU and userApp"
     echo "Generating the global elf file SBSFU and userApp" >> $projectdir"/output.txt"
     # Set to the default installation path of the Cube Programmer tool
     # If you installed it in another location, please update PATH.
     PATH="~/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin":$PATH > /dev/null 2>&1
     programmertool="STM32_Programmer.sh"
     command=$programmertool" -ms "$elf" "$headerbin" "$sbsfuelf
     $command >> $projectdir"/output.txt"
     ret=$?
     fi

    7 replies

    ST Employee
    November 26, 2020

    Hello

    what errors do you have during compilation ? Are you on a Windows PC or Linux or Mac ?

    the file to flash with STM32CubeProgrammer should be under Projects\STM32F413H-Discovery\Applications\Cloud\AWS\SW4STM32\PostBuild\SBSFU_STM32F413H-Discovery_AWS.bin

    Alternatively if STM32CubeIDE project compiles without error it is possible to debug the project with STM32CubeIDE using "Debug As ... STM32 Cortex M C / C++ application". In that case it's STM32CubeIDE that flashes the .elf file under Debug/.

    there's also a precompiled binary delivered under Projects\STM32F413H-Discovery\Applications\Cloud\AWS\Binary\ but it was compiled with IAR EWARM ( not STM32CubeIDE).

    there's an updated manual for X-CUBE-AWS 1.4.1 at https://github.com/STMicroelectronics/x-cube-aws (in Doc directory)

    DDori.1Author
    Visitor II
    November 26, 2020

    Thank you Guillaume.

    I have spent some other time. Flashing (via dang and drop) the bin already in the zip file works and I see the bootload starting.

    I am using Linux. The importation of the System Workbench project to STM32CubeIDE gives no error. When I compile all, at the end I receive the following error. Ideas? Should be not folder permissions

    arm-none-eabi-size STM32F413H-Discovery_AWS.elf 
     text	 data	 bss	 dec	 hex	filename
     194064	 736	 124792	 319592	 4e068	STM32F413H-Discovery_AWS.elf
    Finished building: default.size.stdout
     
    arm-none-eabi-objdump -h -S STM32F413H-Discovery_AWS.elf > "STM32F413H-Discovery_AWS.list"
    Finished building: STM32F413H-Discovery_AWS.list
     
    arm-none-eabi-objcopy -O binary STM32F413H-Discovery_AWS.elf "STM32F413H-Discovery_AWS.bin"
    Finished building: STM32F413H-Discovery_AWS.bin
     
    arm-none-eabi-objcopy -O binary "STM32F413H-Discovery_AWS.elf" "STM32F413H-Discovery_AWS.bin"
    arm-none-eabi-size "STM32F413H-Discovery_AWS.elf"
     text	 data	 bss	 dec	 hex	filename
     194064	 736	 124792	 319592	 4e068	STM32F413H-Discovery_AWS.elf
    "../../../../../BootLoader_OSC/2_Images_SECoreBin/SW4STM32/postbuild.sh" "../.." "./STM32F413H-Discovery_AWS.elf" "./STM32F413H-Discovery_AWS.bin" "1" "bigelf"
    /bin/sh: ../../../../../BootLoader_OSC/2_Images_SECoreBin/SW4STM32/postbuild.sh: Permission denied
    make[1]: *** [makefile:102: post-build] Error 126
    make: *** [makefile:64: all] Error 2
    "make all" terminated with exit code 2. Build might be incomplete.

    I'll give a look at the updated manual, maybe I find something.

    Thanks again

    Davide

    ST Employee
    November 26, 2020

    Apparently the SBSFU postbuild script doesn't have executable bit set on Linux.

    This post-build operation is very important to obtain a full binary with secure bootloader and the application merged together.

    try to do a "chmod +x" on Projects/STM32F413H-Discovery/Applications/BootLoader_OSC/2_Images_SECoreBin/SW4STM32/postbuild.sh

    DDori.1Author
    Visitor II
    November 26, 2020

    That helped. I run again and I had to install ecdsa and pycryptodomex to fix two other issues. However, now I have a new error. Should I conclude that the postuild works only under Windows?

    arm-none-eabi-size "STM32F413H-Discovery_AWS.elf"
     text	 data	 bss	 dec	 hex	filename
     194064	 736	 124792	 319592	 4e068	STM32F413H-Discovery_AWS.elf
    "../../../../../BootLoader_OSC/2_Images_SECoreBin/SW4STM32/postbuild.sh" "../.." "./STM32F413H-Discovery_AWS.elf" "./STM32F413H-Discovery_AWS.bin" "1" "bigelf"
    prepareimage with python script
    Generating the global elf file SBSFU and userApp
    fix access path to STM32_Programmer_CLI.exe 
    ../../../../../BootLoader_OSC/2_Images_SECoreBin/SW4STM32/postbuild.sh: line 93: -ms: command not found
    -ms ./STM32F413H-Discovery_AWS.elf ../../PostBuild/STM32F413H-Discovery_AWSsfuh.bin /home/davide/STM32CubeIDE/proto_1/STM32CubeExpansion_Cloud_AWS_V1.4.1/Projects/STM32F413H-Discovery/Applications/BootLoader_OSC/2_Images_SBSFU/SW4STM32/STM32F413H_DISCOVERY_2_Images_SBSFU/Debug/SBSFU.elf : failed
    make[1]: *** [makefile:102: post-build] Error 1
    make: *** [makefile:64: all] Error 2
    "make all" terminated with exit code 2. Build might be incomplete.

    DDori.1Author
    Visitor II
    November 26, 2020

    It seems that is a common issue but still I cannot solve it https://community.st.com/s/question/0D53W0000091jd7SAA/problem-with-sbsfustm32l496gdiscoverycloudawsv140bin-pl496gcell02

    I have installed STM32CubeProg in /home/davide/STM32Microelectronics and tried to fix the part in the postbuild.sh file (line 85 on) as following, but still doesn't work. Path typing error or still something missing?

     # Set to the default installation path of the Cube Programmer tool
     # If you installed it in another location, please update PATH.
     PATH="/home/davide/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/";$PATH > /dev/null 2>&1
     programmertool="STM32_Programmer_CLI.bin"

    ST Employee
    November 26, 2020

    On Linux, use a colon (":") to separate the directories in the PATH:

    PATH="/home/davide/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin":$PATH > /dev/null 2>&1

    DDori.1AuthorAnswer
    Visitor II
    November 27, 2020

    Thanks for the correction, but it was not the solution. I am not an expert in bash scripts, but based on the error I posted before, the script goes to the "else" section, so the problem is not with the PATH definition only. I have removed the check if the script is running on Windows. Now the script looks like below and it is working! Thank you a lot.

     if [ $ret == 0 ] && [ $# == 5 ]; then
     echo "Generating the global elf file SBSFU and userApp"
     echo "Generating the global elf file SBSFU and userApp" >> $projectdir"/output.txt"
     # Set to the default installation path of the Cube Programmer tool
     # If you installed it in another location, please update PATH.
     PATH="~/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin":$PATH > /dev/null 2>&1
     programmertool="STM32_Programmer.sh"
     command=$programmertool" -ms "$elf" "$headerbin" "$sbsfuelf
     $command >> $projectdir"/output.txt"
     ret=$?
     fi