AWS FreeRTOS IDT Setup failure

kvarsha wrote on December 16, 2019:

Dear AWS team,
We are trying to setup IDT on windows machine to qualify our microcontroller.
This setup we are doing it for the first time, hence we need help from your side to start running IDT on windows machine.

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

We have created aws_demos and aws_tests keil project in amazon-freertos-201910.00\projects\vendor\board\ide folder. Now for IDT in userdata.json file, we have to give details about build and flash scripts. We are finding difficulty in writing these script files.
Currently we started like this - build.bat script will open above mentioned aws_test keil project, build and create hex file.

  1. Is this okay?
    with this setup i got build error on IDT as:
    time=“2019-12-13T12:37:02+05:30” level=info msg=[Error: 204] BuildSourceError: failed to build with error: exit status 1 suiteId=AFQ groupId=FullMQTT testCaseId=MQTT_System deviceId=7013 executionId=ea8f91c7-1d71-11ea-8805-00266cd8158e
    time=“2019-12-13T12:37:02+05:30” level=info msg=[Error: 204] BuildSourceError: Failed to run test with error: failed to build with error: exit status 1 executionId=ea8f91c7-1d71-11ea-8805-00266cd8158e suiteId=AFQ groupId=FullMQTT testCaseId=MQTT_System deviceId=7013

  2. It is observed that for each test suite, IDT is copying amazon-freertos-201910.00 directory to temporary directory. So how build and flashing works wrt each test suite?

  3. What is need of copying to temporary directory?

  4. Is there any modification done on any AWS FreeRTOS source files while building for each test case?

  5. How to run IDT for aws_demo? Where to mention to run IDT for demo or tests?

  6. Is the same build and flash script will be used for running demo and tests?

It will be really helpful if you explain how IDT will setup test suite, how building-flashing happens for each test suite execution.

Please share build and flash script samples for keil IDE.

Please correct me if any of my understanding above is not correct.

Regards,
Varsha Kiragi

Charles-AWS wrote on January 03, 2020:

Here is some information which I think will help in your understanding of how to configure IDT.
IDT will modify “tests/common/aws_test_runner.c” to select what tests will be built, and may modify additional files as necessary depending on the test group. Depending on whether you are using parallel or serial testing, the behavior for how the source code is modified differs. In parallel the source code is copied to a temporary directory, and that temporary source is modified for the test. In serial the source code is copied to a temporary directory, however the original location is modified and the temporary copy is used to restore the original source code after the test is finished.

(To use parallel testing you will need to use {{testData.sourcePath}} in your buildTool.command/flashTool.command/and vendorPath configurations, since parallel testing modifies and uses the copied source your build and flash commands need to use the copied location.)

Build and flash scripts will differ depending on the tool chains used for your device. For errors with the build script, IDT just runs the command provided after replacing any place holder values with their actual value, like {{testData.sourcePath}}. If your build command is failing, I advise adding debug messages into the build script to specify what part of the build script is failing and log any failure messages the commands generate.

  1. It is observed that for each test suite, IDT is copying amazon-freertos-201910.00 directory to temporary directory. So how build and flashing works wrt each test suite?
  2. What is need of copying to temporary directory?

IDT needs to modify the source code to enable the specific test(s) to run for a given test group, as well as to inject different configuration values such as WiFi credentials.

  1. How to run IDT for aws_demo? Where to mention to run IDT for demo or tests?

Yes, the same build and flash commands are used for demo and tests. Use the {{enableTests}} placeholder in your scripts, which will be replaced with “1” for tests, and “0” for demos, depending on what type of tests IDT needs to run.

I hope this helps answer your questions, please let me know if you have additional questions.

Charles-AWS wrote on February 12, 2020:

Answered questions asked, no further followup.