ST STEVAL-STWINKT1 Manual Download Page 4

2

Firmware

2.1

Architecture

The 

STSW-STWINCELL

 software package is a set of libraries and embedded software blocks available to enable

fast and easy development on the STM32 platform.

Figure 3. 

STSW-STWINCELL firmware architecture

Application

level

PREDMNT AWS

via Cellular to Cloud

Utilities

Middleware

level

Cellular framework

Cellular service

COM

AT framework

IPC

FreeRTOS

TM

Motion 

Signal 

Processing

AWS

CMSIS

Drivers

Development

boards

STEVAL-STWINKT1

PC software

Hardware

components

Sensors

HTS221

LPS22HH

IIS3DWB

Cellular Modules

MCU

STM32L4R9ZI

User interfaces

and utilities

MP23ABS1

Predictive Maintenance

AWS Dashboard

Board Support Package

(BSP)

Hardware Abstraction

Layer (HAL)

Quectel BG96

LTE Cat M1 & Cat NB1 &

EGPRS Module

STMod+ cellular expansion board

(BG96)

Board Support Package (BSP): set of APIs related to the hardware components on the boards.

Hardware abstraction layer (HAL): low-level drivers and the hardware interfacing methods to interact with the
upper layers.

Cortex Microcontroller Software Interface Standard (CMSIS): enables consistent device support and simple
software interfaces to the processor and its peripherals.

Middleware components: set of libraries for specific algorithms, communication interface and real time
operating system.

AN5472

Firmware

AN5472

 - 

Rev 1

page 4/48

Summary of Contents for STEVAL-STWINKT1

Page 1: ...r radioelectric coverage lower costs and longer battery life offered by NB IoT should be preferred when these services are not necessary The STSW STWINCELL software package lets you test and develop a...

Page 2: ...cellular modem LTE Cat M1 Cat NB1 EGPRS module Note The expansion board is not available separately and can only be ordered as part of the P L496G CELL02 STM32 Discovery pack which includes a Discove...

Page 3: ...Prog an all in one multi OS software tool for programming STM32 products to erase and program the flash memory of the microcontroller 5 IDE for STM32 to rebuild the projects IAR Embedded Workbench V8...

Page 4: ...L4R9ZI User interfaces and utilities MP23ABS1 Predictive Maintenance AWS Dashboard Board Support Package BSP Hardware Abstraction Layer HAL Quectel BG96 LTE Cat M1 Cat NB1 EGPRS Module STMod cellular...

Page 5: ...Driver BSP The board specific drivers for whole the HW components The BSP files are grouped in folders that include all the hardware device low level drivers as well as all specific board medium level...

Page 6: ...S parson STM32_Cellular Provides a Cellular Framework that is the software stack that allow to drive cellular modem from STM32 MCU STM32_Connect_Library Provides API to access network services on STM3...

Page 7: ...ueues and messages Before the osKerneStart OS scheduler is started the only task created is MainThread which initializes the platform followed by the network security and the sensors along with their...

Page 8: ...c and inertial analysis are run sequentially The required features can be selected in the aws_iot_config h file The user can choose any or all of the following features by toggling the value of the fo...

Page 9: ...Figure 5 Keil configuration selection Figure 6 STM32CubeIDE configuration selection AN5472 IDE configuration selection AN5472 Rev 1 page 9 48...

Page 10: ...3 Hardware setup 3 1 Set up and power supply Step 1 Connect the battery to the STEVAL STWINKT1 Figure 7 STEVAL STWINKT1 battery connection AN5472 Hardware setup AN5472 Rev 1 page 10 48...

Page 11: ...NKT1 STMOD power supply selection Step 3 Mount the STEVAL STWINKT1 with the battery in the plastic box Step 4 Insert the SIM card into the appropriate socket on the cellular expansion board Figure 9 S...

Page 12: ...1 for more than 2 seconds Figure 10 STEVAL STWINKT1 start in battery mode If powered through USB just connect a micro USB cable between the micro USB socket of the STEVAL STWINKT1 and a USB port with...

Page 13: ...11 STEVAL STWINKT1 start in USB mode Step 7 Connect the STEVAL STWINKT1 and the STLINK V3MINI debugger with the 14 pin programming cable plugged on J2 AN5472 Set up and power supply AN5472 Rev 1 page...

Page 14: ...than 3 seconds SW feature If the board is only powered via USB unplug the micro USB cable 3 2 Status LEDs The STEVAL STWINKT1 has the following status LEDs Red LED STBC02 Battery Charger status infor...

Page 15: ...issues when the same cellular expansion board is plugged into an STEVAL STWINKT1 powered via USB but when the STEVAL STWINKT1 is only powered by a lithium battery the input voltage provided to the STM...

Page 16: ...procedure below to load the demonstration firmware onto STEVAL STWINKT1 and the STMOD cellular expansion board Step 1 Download and unpack the STSW STWINCELL firmware As long path lengths can cause iss...

Page 17: ...n the STSW STWINCELL Projects Demonstrations C2C AWS Binary folder Step 6 Check the Verify programming Run after programming and Download file boxes Step 7 Click Start Programming Figure 16 STM32CubeP...

Page 18: ...Step 9 Click Disconnect Figure 17 STM32CubeProgrammer Erasing Programming completed AN5472 How to upload the firmware to the microcontroller AN5472 Rev 1 page 18 48...

Page 19: ...sh any or all of the following data 1 Vibration signal preprocessing in the time domain 2 Vibration signal preprocessing in the frequency domain 3 Environmental values as humidity pressure and tempera...

Page 20: ...e you log in you can create new devices and manage any previous devices you have already created Figure 19 DSH PREDMNT home page Step 3 Click Register a new device Figure 20 DSH PREDMNT register page...

Page 21: ...ownload the files for connecting the device with the cloud and the IoT Endpoint Figure 22 DSH PREDMNT configuration file download for new device Step 6 Download the zip file and note of the IoT Endpoi...

Page 22: ...he thresholds to be monitored Figure 23 DSH PREDMNT set streaming time Step 10 Add the new device to the dashboard by selecting the corresponding tab Figure 24 DSH PREDMNT add device to the dashboard...

Page 23: ...sensor node Figure 25 DSH PREDMNT dashboard waiting for first connection RELATED LINKS The DSH PREDMNT web folder has several resources including a user manual and a quick Getting Started guide AN5472...

Page 24: ...load the configured firmware onto the microcontroller RELATED LINKS 3 1 Set up and power supply on page 10 4 Firmware setup on page 16 6 1 How to set up and use the demo application Step 1 Start Tera...

Page 25: ...Figure 26 Tera Term Terminal setup New line Receive AUTO Transmit LF Figure 27 Tera Term Serial setup Baud rate 115200 Data 8 bit Parity none Stop 1 bit Flow control none Transmit delay 10 ms each AN5...

Page 26: ...ot 0 External 1 Internal 0 You have selected the external SIM Enter Sim Operator Access Point Code e g EM or ESEYE1 etc nbiot tids tim it You have entered nbiot tids tim it as the Sim Operator Access...

Page 27: ...6 Updating TLS security credentials Enter the x509 certificates or keys as per the following format BEGIN CERTIFICATE YMPGn8u67GB9t aEMr5P 1gmIgNb1LTV Xjli5wwOQuvfwu7uJBVcA0Ln0kcmnL R7EUQIN9Z SG9jGr8X...

Page 28: ...ates for the AWS IoT device This information is available in the zip file you download during the device creation phase on ST Predictive Maintenance Dashboard Figure 28 Tera Term File menu AN5472 How...

Page 29: ...Db2ZhwLnoQbeXeGADbkpy rpXRfboQnoZsG4p5WTP468SQvvG5 END CERTIFICATE read BEGIN CERTIFICATE MKKDQTCCAimgAwKBAgKTBmyfz5m jAo54vB4ikPmljZbyjANBgkphkiG9w0BAQsF ADA5MQswCQYDVQQGEwWVUzEPMA0GA1UEChMGQW1hem9uM...

Page 30: ...AeB jPagM lmhmNKeFcoen1m HU5lLkKwK6 WMf24HPkK5avDpMo036U6NpY43YwCQ END CERTIFICATE read BEGIN CERTIFICATE MKKDWjCCAkKgAwKBAgKVAKPWpBtX6wziOY4z0pX19T7aU5owMA0GCSpGSKb3DQEB CwUAME0xSzBWBgNVBAsMQkFtYXpvb...

Page 31: ...7s9Oy070zEuno51 cyoDZuXE8H2LtWpYjxVohSKnXNxviW END RSA PRIVATE KEY read BEGIN RSA PRIVATE KEY MKKEowKBAAKCAQEApTNTDQuubZpVROfL9DS BNQY91P7shGzzzaDicSDaW4pQcBl jgz1ALsaGwhBpLW4K0hHfR1DZyWK5pnfAp lg9F23...

Page 32: ...adow Connect MQTT connection in progress Attempt 1 3 Signal Level 77 dBm Signal Level 71 dBm Connected to a31pjrd6x4v4ba ats iot eu west 1 amazonaws com 8883 Step 13 The shadow is automatically update...

Page 33: ...103 05 103 96 106 89 107 94 105 41 104 05 104 44 106 7 108 06999999999998 106 14 104 22 104 27 106 03 107 58 107 39 106 11 105 46 106 28 107 14 107 63 106 02 104 95 105 56 106 35 107 33 106 61 105 44...

Page 34: ...1557 42 0 01 0 01 0 01 1583 38 0 01 0 01 0 01 1609 34 0 01 0 01 0 01 1635 29 0 01 0 00 0 01 1661 25 0 01 0 01 0 01 1687 21 0 01 0 01 0 01 1713 16 0 01 0 01 0 01 1739 12 0 01 0 01 0 01 1765 08 0 01 0...

Page 35: ...620 35 0 01 0 01 0 01 4646 31 0 01 0 01 0 01 4672 27 0 01 0 01 0 01 4698 22 0 01 0 00 0 01 4724 18 0 01 0 01 0 01 4750 14 0 01 0 01 0 01 4776 09 0 01 0 01 0 01 4802 05 0 01 0 00 0 01 4828 01 0 01 0 01...

Page 36: ...AWS IoT certificates entered via the terminal console are written into separate flash memory locations on the STEVAL STWINKT1 sensor node STM32 microcontroller This ensures that the information is no...

Page 37: ...braries and application examples for STM32L4 Series MCUs acting as hosts for cellular connectivity applications An alternative method is to send the AT command directly to the modem through its USB AT...

Page 38: ...96_bg96_socket_v500 bin Figure 31 Load firmware onto P L496G CELL02 Step 6 Observe the terminal console while the X CUBE CELLULAR firmware running BG96 UART config BaudRate 115200 HW flow ctrl 1 X CUB...

Page 39: ...nfig nb1band any modem config scanseq NB1_M1_GSM modem config send Step 10 Disconnect the P L496G CELL02 Discovery board and detach the cellular expansion board with BG96 modem Step 11 Connect the cel...

Page 40: ...SB cable from your PC to the micro USB socket on the BG96 cellular expansion board Figure 32 STEVAL STWINKT1 with BG96 cellular expansion board connected to PC AN5472 Program BG96 sending AT commands...

Page 41: ...e of Tera Term select the appropriate COM port and set the parameters shown below Terminal New line Receive AUTO Transmit CR Local Echo selected Serial Port Quectel USB AT Port assigned by OS see Figu...

Page 42: ...scanmode 3 1 OK AT QCFG iotopmode 1 1 OK AT QCFG band 0000000F 400A0E189F A0E189F 1 OK AT QCFG nwscanseq QCFG nwscanseq 030201 OK AT QCFG nwscanmode QCFG nwscanmode 3 OK AT QCFG iotopmode QCFG iotopmo...

Page 43: ...s JSON JavaScript Object Notation LPWAN Low Power Wide Area Network LTE Long Term Evolution LTE M Or LTE MTC LTE Machine Type Communication which includes eMTC LTE Cat M1 eMTC category M1 LTE Cat NB1...

Page 44: ...Revision history Table 2 Document revision history Date Version Changes 23 Mar 2020 1 Initial release AN5472 AN5472 Rev 1 page 44 48...

Page 45: ...Firmware setup 16 4 1 How to upload the firmware to the microcontroller 16 5 How to activate the ST Predictive Maintenance Dashboard 19 6 Demonstration application 24 6 1 How to set up and use the de...

Page 46: ...16 STM32CubeProgrammer Erasing Programming mask 17 Figure 17 STM32CubeProgrammer Erasing Programming completed 18 Figure 18 myST login page 19 Figure 19 DSH PREDMNT home page 20 Figure 20 DSH PREDMNT...

Page 47: ...List of tables Table 1 List of acronyms 43 Table 2 Document revision history 44 AN5472 List of tables AN5472 Rev 1 page 47 48...

Page 48: ...ts and ST assumes no liability for application assistance or the design of Purchasers products No license express or implied to any intellectual property right is granted by ST herein Resale of ST pro...

Reviews: