cancel
Showing results for 
Search instead for 
Did you mean: 

X-Cube-AWS: Couldn't port the NUCLEO-H755 aws_demo project to STM32H747-DISCO board

AAvda.1
Associate II

Hello everyone,

I want to connect my STM32H747-Disco board to my AWS IoT services and the AWS S3.

I've attempted to do it with minimal changes with the aws_Demo application project from the X-CUBE-AWS V2.2.0 expansion package:

  • First try: I've just followed Appendix 2 of the getting started guide(UM2178), but when I drop the SBSFU_NUCLEO-H755ZI_aws_demos_CM7.bin to the device's folder I see nothing on the UART console, therefore I moved to my second try.
  • Second try: I've suspected that something with the secure core/boot/firmware is not compatible, therefore I've tried to build them with some minor project's symbols change (like STM32H755xx changed to STM32H747xx), they all have been built successfully. After building the SBSFU, I found in the readme.txt:
1. Compile projects in the following order. This is mandatory as each project requests some objects generated by the
   compilation of the previous one:
   - 2_Images_SECoreBin (see also SECoreBin/readme.txt)
   - 2_Images_SBSFU
   - 2_Images_UserApp (see also UserApp/readme.txt)

I couldn't understand what is the UserApp (I guessed it the aws_demo app), so I've downloaded the X-Cube-SBSFU package, and still couldn't make it boot...

Conclusion:

I could not find any STM32H747-DISCO example of those 2 packages, and couldn't make it boot (nothing on the UART console). What have I done wrong? Is it even possible to port some of those examples to the STM32H747/757 DISCO/EVAL boards?

Thanks in advance for everybody.

5 REPLIES 5
grd
ST Employee

The X-CUBE-AWS V2.2.0 STM32H755 secure bootloader is mostly reused from the X-CUBE-SBSFU v2.4.0 STM32H753 bootloader, and relies on secure HW IPs which are only present in STM32H75x MCUs.

On STM32H74x MCUs, the SBSFU bootlader should be removed (skip the pre- and post-build steps of aws_demos, adapt the linker file), and disable the OTA update feature from the FreeRTOS build, which implementation is based on the SBSFU.

On other STM32H75x MCUs, it should be possible to port the SBSFU bootloader, but it will require to dig into its internal design.

Guillaume K
ST Employee

Also if you want to use AWS S3 service it is not supported in X-CUBE-AWS. This package only does AWS IoT Core service with MQTT protocol.

AAvda.1
Associate II

@Guillaume K​ @grd​  Hi,

So I've skipped the pre and post build steps and have built and run the demo application for the M7 processor of the STM32H747 with the following steps:

  • Deleted the Nucleo folder from the BSP directory
  • Copied from the H7 software package the STM32H747I-DISCO BSP to the project's BSP directory (only stm32h747i_discovery.c and .h)
  • changed the USART instance from 3 to 1
  • changed all GPIO pins and ports numbers to correspond to the STM32H747I-DISCO board
  • I've changed the OTA update example to be MQTT example
  • removed the Debug_CM4 build configuration (Because I couldn't find another way to keep my project explorer to use the CM7 build configuration)
  • Built for CM7 target
  • Run it and Debugged it because it gets hardFault handler

What I've found from debugging:

  • it gets an exception from vTaskStartScheduler
  • Control registered values:
    • CFSR [address=0xe000ed28] = 0x01000000
    • HFSR [address=0xe000ed2c] = 0x40000000
    • CCR [address=0xe000ed14] = 0x00060218
  • From these registers, I found that I have unalignment write

I must mention that I did not understand, what should I change in the link file (besides deleting the INCLUDE lines)

I would like to ask for help from you:

  1. Although I did not disable the OTA update feature, it built w/o errors. How do I disable it?
  2. Which tips you can give me to spot my faulty alignment write?
  3. Did I make something wrong with described steps above?
  4. What should I change in the linker file? because I suspect that the issue is there
  5. What would you do to make things more clear?

Thanks in advance, it is really appriiciated.

grd
ST Employee

@AAvda.1​ , the linker file of an SBSFU-enabled user application cannot be used for a standalone application. You need to write your own.

The figure NUCLEO-H755ZI-Q mapping in single-core configuration of UM2178 highlights the memory areas that are important for the CPU1 user application, so they must be kept or relocated.

Possible starting or comparison points are the LwIP application examples in the STM32CubeH7 package, or the application code generated by the STM32CubeMX tool for your target.

If the hardfault occurs in an interruption context, it can be due to a wrong configuration of the vector table address. In system_stm32h7xx_dualcore_boot_cm4_cm7.c, SCB->VTOR must be set according to your linker file.

Regarding the OTA, removing the SBSFU from the build prevents the compilation of aws_ota_pal.c because SHARED_REGION_RAM_START is imported from the SBSFU definitions.

Depending on the toolchain, the file may have to be excluded from the build, or its reference to SBSFU commented out (the functions will not be called by the non-OTA demos anyway).

Hi @grd​ ,

First of all, thanks a lot!

Is there any training or user manual that will help me with the linker files? I am not that familiar with this.

BTW, I've disabled the unaligned access trap, then it run and worked, but there is a problem with the DHCP client, so I made it static IP but for some reason it is not working either

Would you recommend this way or better to start write a new linker file?

Thanks in advance,