AWS FreeRTOS IDT CmakeBuildSystem Failure

Dear AWS and ST team,

I’m trying to setup IDT on Linux machine to qualify STM32WB55 microcontroller.
This setup i’m doing it for the first time, hence need help from your side to start running IDT on Linux machine.

I have few questions listed below, requesting you to respond on it asap.

  1. I have WB55_AFR_20191200 Source code available with me.
  2. I have followed the link idt_pre-requisities

3.My Contents for userdata.json

    indent preformatted text by 4 spaces
{
  "sourcePath": "/home/kaushendra/IDT_TEST/STM_Release_Nov/WB55_AFR",
  "vendorPath": "{{testData.sourcePath}}/vendors/st/boards/p_nucleo_wb55",
  "buildTool": {
    "name": "make",
    "version": "v1",
    "command": [
      "/home/kaushendra/IDT_TEST/STM_Release_Nov/WB55_AFR/projects/st/p_nucleo_wb55/cmake/build_idt.sh {{testData.sourcePath}} {{enableTests}}"
    ]
  },
  "flashTool": {
    "name": "stmflash",
    "version": "v1",
    "command": [
      "/home/kaushendra/IDT_TEST/STM_Release_Nov/WB55_AFR/projects/st/p_nucleo_wb55/cmake/flash.sh {{testData.sourcePath}} {{buildImageName}}"
    ],
    "buildImageInfo" : {
      "testsImageName": "SBSFU_aws_tests.bin",
      "demosImageName": "SBSFU_aws_demos.bin"
    }
  },
  "clientWifiConfig": {
    "wifiSSID": "Kaushendra",
    "wifiPassword": "seed@123",
    "wifiSecurityType": "eWiFiSecurityWPA2"
  },
  "testWifiConfig": {
    "wifiSSID": "Kaushendra",
    "wifiPassword": "seed@123",
    "wifiSecurityType": "eWiFiSecurityWPA2"
  },
  "cmakeConfiguration": {
    "boardName": "p_nucleo_wb55",
    "vendorName": "st",
    "compilerName": "arm-gcc",
    "afrToolchainPath": "/home/kaushendra/st/stm32cubeide_1.4.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-arm-embedded.7-2018-q2-update.linux64_1.4.0.202007081208/tools/bin"
  }
}

4.My contents for device.json

    indent preformatted text by 4 spaces
[
  {
    "id": "stm32wb55",
    "sku": "STM_sku",
    "features": [
      {
        "name": "WIFI",
        "value": "No"
      },
      {
        "name": "OTA",
        "value": "No",
        "configs": [
          {
            "name": "OTADataPlaneProtocol",
            "value": "HTTP | MQTT | Both"
          }
        ]
      },
      {
        "name": "BLE",
        "value": "Yes"
      },
      {
        "name": "TCP/IP",
        "value": "No"
      },
      {
        "name": "TLS",
        "value": "Yes"
      },
      {
        "name": "PKCS11",
        "value": "ECC"
      },
      {
        "name": "KeyProvisioning",
        "value": "Import"
      }
    ],
    "devices": [
      {
        "id": "stm32wb55_id_1",
        "connectivity": {
          "protocol": "uart",
          "serialPort": "/dev/ttyACM0"
        }
      }
    ]
  }
]
  1. My contents for resource.json
[
  {
    "id": "ble-stm32wb55",
    "features": [
      {"name":"ble", "version":"4.2"}
    ],
    "devices": [
      {
        "id": "ble-stm32wb55-1",
        "connectivity": {
          "protocol": "ssh",
          "ip": "192.168.43.107"
        }
      }
    ]
  }
]

6.Following errors i’m getting while performing IDT for test_group

1-CmakeBuildSystem

> ========== Test Summary ==========
> Execution Time: 	10m18s
> Tests Completed: 	3
> Tests Passed: 		2
> Tests Failed: 		1
> Tests Skipped: 		0
> ----------------------------------
> Test Groups:
> Optional Test Groups:
>     CmakeBuildSystem: 		FAILED
> ----------------------------------
> Failed Tests:
>     Group Name: CmakeBuildSystem
>         Test Name: CmakeBuildDemos
>             Reason: Test case timeout during execution. Please refer to /home/kaushendra/IDT_TEST/STM_Release_Nov/devicetester_afreertos_linux_1.6.2/devicetester_afreertos_linux/results/3a7c084a-30b4-11eb-8fd5-c03eba6cbb6a/logs/CmakeBuildSystem__Cmake_Build_Demos.log for more information.

2-FullMQTT

> ========== Test Summary ==========
> Execution Time: 	8m6s
> Tests Completed: 	6
> Tests Passed: 		0
> Tests Failed: 		6
> Tests Skipped: 		0
> ----------------------------------
> Test Groups:
>     FullMQTT: 		FAILED
> ----------------------------------
> Failed Tests:
>     Group Name: FullMQTT
>         Test Name: MQTT_System
>             Reason: [Error: 205] FlashOrRunTestError: Failed to run test with error: failed to flash or run with error:

help and guidance will be appreciated.

Regards,
kaushendra sah

Would you please share the content of the log file?

Reason: Test case timeout during execution. Please refer to /home/kaushendra/IDT_TEST/STM_Release_Nov/devicetester_afreertos_linux_1.6.2/devicetester_afreertos_linux/results/3a7c084a-30b4-11eb-8fd5-c03eba6cbb6a/logs/CmakeBuildSystem__Cmake_Build_Demos.log for more information.

For the second one, it seems that the flash command is not successful. Does the command configured in "flashTool": works by itself? Also, please share the execution logs:https://docs.aws.amazon.com/freertos/latest/userguide/dt-afr-troublshooting.html

Thanks.

Hi Gaurav,

As kaushendra’s id is new,he’s not able to sent attachment.further communication will be using this id.
Please find the CmakeBuildSystem__Cmake_Build_Demos.log in the attachment.
Also i tried to debug Test case : FullMQTT at my end.

I have modified the flashtool configs.

“flashTool”: {
“name”: “stmflash”,
“version”: “v1”,
“command”: [
“/home/kaushendra/IDT_TEST/STM_Release_Nov/WB55_AFR/projects/st/p_nucleo_wb55/cmake/flash.sh {{testData.sourcePath}} {{buildImageName}}”
],
“buildImageInfo” : {
“testsImageName”: “aws_tests”,
“demosImageName”: “aws_demos”
}
},

Test Result:
> ========== Test Summary ==========
> Execution Time: 40m14s
> Tests Completed: 48
> Tests Passed: 47
> Tests Failed: 1
> Tests Skipped: 0
> ----------------------------------
> Test Groups:
> FullMQTT: FAILED
> ----------------------------------
> Reason: Test case timeout during execution.

Please refer to /home/kaushendra/IDT_TEST/STM_Release_Nov/devicetester_afreertos_linux_1.6.2/devicetester_afreertos_linux/results/001c2f99-3313-11eb-af53-c03eba6cbb6a/logs/FullMQTT__MQTT_System.log

Please refer the FullMQTT__MQTT_System.log also provided in attachment.

help will be appreciated.

regards,
arjun
001c2f99-3313-11eb-af53-c03eba6cbb6a.zip (90.4 KB)
3a7c084a-30b4-11eb-8fd5-c03eba6cbb6a.zip (20.5 KB)

CMake Build - Looking at the logs, it seems that the cmake is stuck. Would you please try to build aws_demos using cmake separately and see where it gets stuck:

time="2020-11-27T18:57:11+05:30" level=info msg="[ 89%] Building C object CMakeFiles/afr_ota.dir/libraries/3rdparty/tinycrypt/lib/source/hmac.c.obj"
time="2020-11-27T18:57:11+05:30" level=info msg="[ 89%] Building C object CMakeFiles/afr_ota.dir/libraries/3rdparty/tinycrypt/lib/source/aes_encrypt.c.obj"
time="2020-11-27T18:57:11+05:30" level=info msg="[ 89%] Building C object CMakeFiles/afr_ota.dir/libraries/3rdparty/tinycrypt/lib/source/ctr_mode.c.obj"
time="2020-11-27T18:57:11+05:30" level=info msg="[ 89%] Building C object CMakeFiles/afr_ota.dir/libraries/3rdparty/tinycrypt/lib/source/utils.c.obj"
time="2020-11-27T18:57:12+05:30" level=info msg="[ 90%] Linking C static library afr_shadow.a"
time="2020-11-27T18:57:12+05:30" level=info msg="[ 90%] Built target afr_shadow"

FullMQTT - Looking at the logs below, it seems that the test is stuck. Would you run this test with debugger and see where is it stuck:

0 5605 [TestRunner] [INFO ][INIT][lu] SDK successfully initialized.
1 5612 [TestRunner] [INFO ][MQTT][lu] MQTT library successfully initialized.
2 5619 [TestRunner] [WARN ][MQTT][lu] AWS IoT does not support disabling keep-alive. Default keep-alive of 1200 seconds will be used.

Thanks.

Hi Gurav,

I’m Validation my Cmake build via mannual Steps.
by the time I would like to understand about “FreeRTOSIntegrity
I have my code supporting STMWB55 device build with WB55_AFR_20191200.
Facing issue while running below Test.

Test

FreeRTOSIntegrity

Command

./devicetester_linux_x86-64 run-suite --userdata userdata.json --group-id FreeRTOSIntegrity

Result

> ========== Test Summary ==========
> Execution Time: 	1s
> Tests Completed: 	1
> Tests Passed: 		0
> Tests Failed: 		1
> Tests Skipped: 		0
> ----------------------------------
> Test Groups:
>     FreeRTOSIntegrity: 		FAILED
> ----------------------------------
> Failed Tests:
>     Group Name: FreeRTOSIntegrity
>         Test Name: AmazonFreeRTOSSourceIntegrity

> Reason: Following files are modified : /home/kaushendra/IDT_TEST/STM_Release_Nov/FreeRTOS_Integrity/WB55_AFR/libraries/freertos_plus/aws/ota/test/aws_test_ota_agent.c, /home/kaushendra/IDT_TEST/STM_Release_Nov/FreeRTOS_Integrity/WB55_AFR/demos/ota/aws_iot_ota_update_demo.c, /home/kaushendra/IDT_TEST/STM_Release_Nov/FreeRTOS_Integrity/WB55_AFR/libraries/c_sdk/standard/ble/src/services/mqtt_ble/iot_ble_data_transfer.c, /home/kaushendra/IDT_TEST/STM_Release_Nov/FreeRTOS_Integrity/WB55_AFR/libraries/c_sdk/standard/ble/src/iot_ble_gap.c, /home/kaushendra/IDT_TEST/STM_Release_Nov/FreeRTOS_Integrity/WB55_AFR/libraries/abstractions/ble_hal/test/src/iot_test_ble_hal_afqp.c, /home/kaushendra/IDT_TEST/STM_Release_Nov/FreeRTOS_Integrity/WB55_AFR/demos/mqtt/iot_demo_mqtt.c, /home/kaushendra/IDT_TEST/STM_Release_Nov/FreeRTOS_Integrity/WB55_AFR/libraries/abstractions/ble_hal/test/src/iot_test_ble_hal_common.c

FreeRTOSIntegrity__FreeRTOS_Integrity.zip (1.7 KB)

Please help me understand the issue here.

Regards,
kaushendra sah

So does CMake and FullMQTT tests pass for you?

The FreeRTOSIntegrity test ensures that you do not modify any file that you are not supposed to. From your logs, these are the files that the test is complaining about:

libraries/freertos_plus/aws/ota/test/aws_test_ota_agent.c
demos/ota/aws_iot_ota_update_demo.c
libraries/c_sdk/standard/ble/src/services/mqtt_ble/iot_ble_data_transfer.c
libraries/c_sdk/standard/ble/src/iot_ble_gap.c
libraries/abstractions/ble_hal/test/src/iot_test_ble_hal_afqp.c
demos/mqtt/iot_demo_mqtt.c
libraries/abstractions/ble_hal/test/src/iot_test_ble_hal_common.c

Would you please see why you need to modify these files?

Thanks.

Hi Gaurav,

CMake Build
Yes we identified the problem here in mannual build.
please check with below details:
1–building aws_demos
pwd:/home/kaushendra/IDT_TEST/STM_Release_Nov/WB55_AFR

cmake -DVENDOR=st -DBOARD=p_nucleo_wb55 -DCOMPILER=arm-gcc -DAFR_TOOLCHAIN_PATH=/home/kaushendra/st/stm32cubeide_1.4.0/plugins/		com.st.stm32cube.ide.mcu.externaltools.gnu-arm-embedded.7-2018-q2-update.linux64_1.4.0.202007081208/tools/bin -DAFR_ENABLE_TESTS=0 -S . -B ./build

cd build/
sudo make all -j4

2–building aws_tests
pwd:/home/kaushendra/IDT_TEST/STM_Release_Nov/WB55_AFR

cmake -DVENDOR=st -DBOARD=p_nucleo_wb55 -DCOMPILER=arm-gcc -DAFR_TOOLCHAIN_PATH=/home/kaushendra/st/stm32cubeide_1.4.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-arm-embedded.7-2018-q2-update.linux64_1.4.0.202007081208/tools/bin -DAFR_ENABLE_TESTS=1 -S . -B ./build

cd build/
sudo make all -j4

–observation

1st-demo,2nd test(builds sucess)
1st-test,2nd demo(builds issue in demos)

FullMQTT
could you please help me undersatnd how to test with debugger and see where is it stuck.

FreeRTOSIntegrity
I have verified the Source Code available with me and downloaded a fresh version of same using meld.I found some minor changes in Keep-alive and other parameters.
My query here is to understand the failure scenario for FreeRTOSIntegrity.
Can’t we manage to pass it with some minor libraries modification as it is required for our AWS Demo to work with the Board.

Regards,
Arjun

CMake Build

1st-test,2nd demo(builds issue in demos)

What are these issues? If these are not already resolved, would you please share build logs.

FullMQTT

could you please help me undersatnd how to test with debugger and see where is it stuck.

This depends on your hardware. I assume you could use STM32CubeIDE but I’d suggest checking with ST.

FreeRTOSIntegrity
The reason you are not supposed to modify these files is because they are common files and are used by all the boards. Board specific configuration should go in a config file which is board specific. An example of a config file is this: https://github.com/aws/amazon-freertos/blob/fd27d7bbd0d370004817c217b7fb95242f136b0d/vendors/st/boards/stm32l475_discovery/aws_demos/config_files/aws_demo_config.h

Are the changes you making cannot be done via config files? If so, would you please share those changes so that we can think of a portable solution.

Thanks.