STM32L4 AWS FreeRTOS demo failure

jonpasc wrote on November 08, 2018:

First, I am very inexperienced with embedded device programming but trying to work through as much as I can. I have been trying the documentation for getting started with a STM32L4 IOT node, but cannot seem to produce any results on AWS IOT Subscribe Test. I’ve followed the tutorial twice through from the beginning using System Workbench and TrueStudio. I’ve updated the wifi firmware and reproduced my certificates by creating a new device following other post on this forum.

I also tried the program offered with X-Cube-AWS on In that program it prompts for the Root CA and when i enter the certificate key nothing happens in the terminal. My root CA doesn’t exactly look like the demo ST posted on youtube though.

Any advice on where to start? I’ve looked through TrueStudio, but can’t seem to find a log that is produced as the file runs. Where can i find that to start narrowing down the problem?

jonpasc wrote on November 16, 2018:

Sorry, I saw the note about the terminal but it’s not in the getting started page to open the channel to see the terminal outputs log. I tried on 3 terminals with nothing and I’ve been able to successfully transmit messages through the terminal in the past. I used the noted terminal settings and matched the terminal on my device manager. The code will go to breakpoint in main, but I get no response after that.

During the build, the compiler (TrueStudio) noted a warning on the lib/third_party/mcu_vendor/st/stm32l475_discovery/components/es_wifi/es_wifi.c file. (attached) Line 328, 342, 989, and 991. I’m working on my C programming and haven’t dug into these warnings enough to know if they are catastrophic and locking up the program or just a warning from the compiler. It still seems odd that I would be getting nothing out of the terminal, not even an initialization line.

Line 328 - Information - expected ‘char ’ but argument is of type 'uint8_t{aka unsigned char*}’
Line 342 - Implicit declaration of function ‘atoi’[-Wimplicit-function-declaration]
Line 989 - pointer targets in passing argument 2 of ‘sprintf’ differ in signedness [-Wpointer-sign]
Line 991 - pointer targets in passing argument 1 of ‘AT_ParseFWRev’ differ in signedness [-Wpointer-sign]

Gaurav-Aggarwal-AWS wrote on November 19, 2018:

Those warnings are not catastrophic and you can safely ignore them. It is a bit difficult to understand the problem without logs.
Which OS you are runnign on and what Terminal Emulator program are you trying? Can you share some screenshot of your Termial Emulator settings so that we can better understand the problem. Would you like to have a debugging session to debug this issue?


jonpasc2 wrote on December 02, 2018:

Thank you for your assistance

I’m not sure what I changed, maybe using a different IDE, but I was able to get logs. The code returned [MQTTEcho] Error: MQTT echo failed to connect with error 1. I was able to turn on the MQTT logs I believe and was not able to figure out exactly where the fail is occurring. I tried tracing if the MQTT was passing along credentials and wasn’t able to see where, but I recreated my policy and device anyway.

0 521 [Tmr Svc] WiFi module initialized.
1 532 [Tmr Svc] Write code signing certificate…
2 554 [Tmr Svc] Write device private key…
3 1410 [Tmr Svc] Key provisioning done…
4 4539 [Tmr Svc] WiFi connected to AP Wxxxxxxb.
5 4544 [Tmr Svc] IP Address acquired
6 4548 [Tmr Svc] WiFi firmware version is: C3.5.2.5.STM
7 4554 [Tmr Svc] WiFi firmware is up-to-date.
8 4558 [Tmr Svc] Creating MQTT Echo Task…
9 4562 [MQTTEcho] MQTT echo attempting to connect to
10 4571 [MQTTEcho] Sending command to MQTT task.
11 4575 [MQTT] Received message 10000 from queue.
12 6174 [MQTT] Anonymous metrics will be collected. Recompile withmqttconfigENABLE_METRICS set to 0 to disable.
13 7191 [MQTT] Received fixed header, 0 bytes to receive.
14 7196 [MQTT] About to close socket.
15 7205 [MQTT] Socket closed.
16 7208 [MQTT] Notifying task.
17 7211 [MQTTEcho] Command sent to MQTT task failed.
18 7216 [MQTTEcho] ERROR: MQTT echo failed to connect with error 1.
19 7222 [MQTTEcho] MQTT echo test could not connect to broker.
20 7228 [MQTTEcho] Sending command to MQTT task.
21 7232 [MQTT] Received message 20000 from queue.
22 7237 [MQTT] Notifying task.
23 7240 [MQTTEcho] Command sent to MQTT task passed.
24 7245 [MQTTEcho] MQTT echo demo finished.
25 7249 [MQTTEcho] ----Demo finished----

Gaurav-Aggarwal-AWS wrote on December 03, 2018:

I see that you are trying to connect to ATS endpoint. Which version of Amazon FreeRTOS are you using? Would you please try to use the latest Amazon FreeRTOS Version?