Home

General purpose ST7540 power line modem module based on

image

Contents

1. The following is a description of the symbols that can appear in the sniffer window indicated with a number in Figure 19 DoclD024383 Rev 1 2 UM1619 Software GUI description ONDAY 11 12 13 14 15 As soon as the START button is pressed the sniffing date and time is shown Each time a data frame is received this number represents the time passed in seconds after the previous received data frame This symbol represents the frame type and can be one of the following DAT Data frame SER Service frame PNG Ping frame ERR Error frame PRG Programming frame ACK Acknowledge frame BAK Back acknowledgment frame UNK Unknown frame type P Frame rejected because a wrong postamble C Frame rejected because a wrong CRC S 0x Sender device address without group indication D 0x Target device destination address without group indication Frame sent in Unicast U or Broadcast B Frame with acknowledgment required A or not required A Frame with back acknowledgment required b or not required b Frame can be repeated R or repeating disable for that frame R Normal repeating mode n or static repeating mode s Grouping enabled G or disabled G Data not encrypted E or encrypted data E ID xxx Indicates the frame ID number xxx FEC nnn Represents the number of the FEC forward error check correction for t
2. 4 1 Dongle works also as a repetitor 0 Dongle doesn t repeat frames 1 Static repeater behavior 0 Repeat only frames without response 1 Grouping filter subnet enabled 0 Grouping filter disabled 1 Encrypted data 0 Clear data SS O 1 Reserved 5 Set module parameters programming user parameters uint8_t buffer buffer 0 32 buffer 1 APP_PROGRAMMING_FRAME buffer 2 3 target module group buffer 4 5 6 7 target module address buffer 8 PROG CMD SET DATA buffer 9 PROG GRP USER DATA buffer 10 gt 29 user data buffer buffer 30 31 CRC16 6 Get module parameters uint8 t buffer buffer 0 12 buffer 1 APP PROGRAMMING FRAME buffer 2 3 target module group buffer 4 5 6 7 target module address buffer 8 PROG CMD GET DATA FOR GET DATA LINK STACK PARAMETERS buffer 9 PROG GRP LL STACK PARAM FOR GET MODULE PARAMETERS buffer 9 PROG GRP DEVICE DATA FOR GET USER DATA buffer 9 PROG GRP USER DATA buffer 10 11 CRC16 After a certain delay from the get command acknowledgment the PLM module will send the following frame RESPONSE FRAME FOR DATA LINK STACK PARAMETERS GET COMMAND APP userdata t frame frame source SOURCE PLM Data source PLM frame type APP PROGRAMMING FRAME frame len 52 frame error APP ERROR NONE
3. ABOUT CONFIGURATION DONGLE OPERATIONS PROGRAM SERVICE SNIFFER OPTIONS COM port META E REFRESH Use encryption AES128 COM3 Baudrate COM14 Log Window E Decimal view com2 DONGLE NOT CONNECTED The module is now in programming mode the Programing mode message will flash at the bottom of the interface near the connected COM port indication 2 DoclD024383 Rev 1 13 56 Software GUI description UM1619 5 5 1 5 2 14 56 Software GUI description Introduction The software GUI is a demonstration tool that allows to program and set up the GP power line modules and test all the embedded features The GUI is composed of several tabs each one grouping different functions A log window is present at the bottom of the GUI and is common to all tabs Each operation performed by the user by the modules and each error are logged in this window The decimal view check box allows swapping of the data display from hexadecimal to decimal mode Independent of the visualization each item of data can be inserted by the user in decimal or hexadecimal mode starting the latter with the token Ox Configuration tab This tab Figure 12 is dedicated to the module configuration As soon as the GUI is started and the COM port selected as described in the Hardware Installation paragraph press the CONNECT button The module enters the programming mode the orange LED flashes twice
4. 3 3V U4 USB USBDP j D1 D4 2 USB D Grd 3 3V 433V m 2v USB USBDM 3 D2 pa L4 USB D CON24A USBUFO2W6 SPI2_MOSI 1 2 PLM7 GPIO SPI2_MISO 3 4 PLM6 GPIO SPI2 SCK 5 6 PLM5 GPIO R28 N M SPI2 NSS F 8 PLM4 GPIO USART1_RX RS232 RX 9 10 PLM3 GPIO USARTI TX RS232 TX 11 12 PLM2 GPIO 12V 3 3V USB D 13 14 PLM1 GPIO R29 NM USB D 15 16 PLMO GPIO J2 17 18 i 19 20 BOOTO 21 22 1 3 e 23 24 4 NM 3 3V 33V e C30 100nF U3 ST3232CTR C31 J3 A 1 nm vec 16 2 R22 R23 R24 R25 R26 2 15 gt 10K 10K 10K 10K 10K 1 V GND TRST 2 TDi i 3 cm 3 Ct T1 OUT 14 R32 OR RS232 TX TMS 4 TCK 7 5 10m 4 c2 RIIN 13 R31 OR RS232 RX TDO 6 JRSTIN i 7 5 C2 R1 OUT 12 R30 OR USART1 RX 8 E 6 v TAIN 11 USART1 TX PROG 7 T2 OUT T2 IN 10 R27 1 R2 In R2 our gt 10K Loo y y A 1 Bill of material Table 1 Bill of material Voltage Technolo Qty Ref Part value Tol 9 Watts gy PA Manufact current information Lithium batter y Through 1 BATT1 3V 3V BR2032 hale Panasonic 190mAh Through Polypropylene hetedead 1 C2 68 nF X1 10 330 Vac film capacitor Epcos spacing 15 MKP mm 1 C3 N M X7R ceramic 1 C4 6 8 nF 10 50 V SMD 0603 Any capacitor C1 C5 C9 C1 X6S ceramic 5 10 uF 10 35V SMD 1206 Murata 6 C19 capacitor Ly DoclD024383 Rev 1 49 56 Schematic diagrams and
5. ate 7 Decimal view CLEAR LOG COM2 PROGRAMMING MODE e Working Mode The working mode panel is used to specify the working mode of the power line communication The communication between two or more modules can be with or without acknowledgment and with or without back acknowledgment Select the respective check box in order to enable or disable the ACK bACk frames on a communication Checking the REPEATER box the module works also as a repeater in case a data frame is not addressed to itself In this case after a certain delay if the targeted module does not reply with an ACK to the sender the module repeats the data frame as it was previously sent The repetition for a given frame is done only once per each module If the STATIC REPEATER check box is checked the module repeats statically each sensed frame without checking if the frame has been received acknowledged or not In both cases the anti collision mechanism explained in the UM1573 is always adopted The GROUPING check box allows the creation of sub nets group of modules interacting only among those with the same group number The group number has to be specified in the group field of the dongle parameters panel The ENCRYPTION AES128 check box enables the encryption mode all the data exchanged by the module are encrypted using the standard AES128 encryption algorithm The 128 bit encryption key is configurable in the AES key panel The HOP LEV
6. Belgium Brazil Canada China Czech Republic Finland France Germany Hong Kong India Israel Italy Japan Malaysia Malta Morocco Philippines Singapore Spain Sweden Switzerland United Kingdom United States of America www st com 56 56 DoclD024383 Rev 1 Ly
7. Kr UM1619 y life augmented User man ual General purpose ST7540 power line modem module based on ST7540 PLM and STM32 microcontroller Introduction This document explains how to use and setup the firmware and the software designed for the STEVAL IHPOO5V1 board and all the necessary setup for using the hardware The application firmware uses the ST7540 power line modem firmware stack driver described in the UM1573 ST7540 power line modem firmware stack and is organized in a layer structure A dedicated layer allows the user to design his own application interfacing to the module features with very simple and easy to use APIs A dedicated software graphical user interface GUI allows the user to use all the embedded features interfacing the PLM module with the PC via an RS232 communication port This firmware is developed using STM32F 10x Standard Peripherals Library Rel 3 5 0 and IAR Embedded Workbench IDE for STM32 microcontrollers Rel 6 3 The STEVAL IHP005V1 hardware module embeds an ARM 32 bit Cortex M3 core based STM32F103xB and a FSK power line transceiver ST7540 Figure 1 STEVAL IHP005V1 SLI AREAS IELTS lesssesees Y inooooooooo LaS f pe EN a s mi A Lu BILL i e Trin Tes E a a EA Uca a E May 2013 DoclD024383 Rev 1 1 56 www st com Contents UM1619 Contents 1 FSdIUIBS vapor de aii e ica 4 2 Hardware description 0 0c cece eee 5 3 Getting Started st 2 2
8. uint8 t buffer CRC16 buffer 0 11 buffer 1 APP PROGRAMMING FRAME buffer 2 3 target module group buffer 4 5 6 7 target module address buffer 8 PROG CMD EXIT PROG MODE buffer 9 10 CRC16 3 Set module parameters data link stack parameters uint8 t buffer buffer 0 buffer 1 APP PROGRAMMING FRAME buffer 2 3 target module group buffer 4 5 6 7 target module address buffer 8 PROG CMD SET DATA buffer 9 PROG GRP LL STACK PARAM STACK PARAMETERS buffer 10 11 PLM MIN SLOT buffer 12 13 PLM MAX SLOT buffer 14 15 PLM NTW P GLOBAL TX TO buffer 16 17 18 19 PLM NTW P BC GLOBAL TX TO 62 buffer buffer buffer 20 21 PLM NTW P ACTIVITY TO 22 23 PLM NTW P WATCHDOG TO 24 25 26 27 PLM NTW P DATATRANSFER TO buffer 28 29 PLM NTW P BANDINUSE TO buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 531 54 55 56 57 58 59 60 61 PLM NTW P FRAME TX TO PLM NTW P BCAST TX TO PLM NTW P ACK RX TO PLM NTW P bACK RX TO PLM NTW P FRM RX TO PLM NTW P NDX TO PLM LI MAX ATTEMPT PLM LL MAX RPT ATTEMPT DEVICE TIME SYNC CRC16 pil fil Timeout Timeout Timeout Timeout Timeout Minimum Minimum backoff time Maximum backoff time Timeout for g
9. DoclD024383 Rev 1 Ly UM1619 Software GUI description 5 3 If the module dongle is in programming mode all the other tabs are locked In order to unlock all the tabs press the RUN button The GUI and the module will enter in run mode and the run mode message will appear in green at the bottom of the window The module LED will be switched off Dongle tab The DONGLE tab Figure 13 is where to set up and use two features embedded in the module the real time clock RTC and the general purpose inputs outputs pins The node time indicates the value of the internal RTC of the module Press the GET TIME button in the commands panel to know the actual time of the module In order to modify the time write the new time in the node time panel and click the SET TIME button The module time can be synchronized with the PC time shown in the current time panel In this case simply check the SET CURRENT option in the node time panel before pressing the SET TIME button The module has 8 general purpose input output pins that can be configured individually either as input pin or as output pin In order to know the actual configuration press the GET IO CFG button in the commands panel If a pin is configured as input the Input x where x is the number of the pin appears in the input status panel with the respective check box checked and a red or a green LED is shown the color of the LED specifies if in the module pin is applied a high
10. SNIFFER OPTIONS minds Available Node list y 0x00 0x00 0x00 0x00 0x00 0x00 gt Node O sENDMsa EA Message Broadcast El Clear Message Window STOP Log Window Node is now in PR E Decimal view COMI RUN MODE If the message has to be sent in broadcast the BROADCAST check box must be checked As soon as the send message is sent the green LED of the module connected to the GUI is switched on When the LED is switched off the message has been sent to the target module or an error has occurred The operation result is shown in the log window If the target device is connected to a PC with a running GUI the received message is shown in the log window ky DoclD024383 Rev 1 19 56 Software GUI description UM1619 5 5 20 56 Program tab The PROGRAM tab shown in Figure 15 is used to store permanently user data in the module flash memory Actually is possible to store 20 bytes as example but modifying a constant in the firmware define USER SETTINGS SIZE directive in the interfaceconfig h file it is possible to store more then 800 bytes of user data Figure 15 GUI program tab B Remote Console for GP ST7540 power line modem module Rel 5 5 STMicroelectronics ABOUT CONFIGURATION DONGLE OPERATIONS PROGRAM SERVICE SNIFFER OPTIONS User Data Commands Available Node list 0 0x00 0x00 0x00 gt Node 0 1 0x00 en 0 0x00 0x00 0x0
11. Schematic diagrams and bill of material UM1619 Table 1 Bill of material continued Qty Ref Part value Tol Voltage Watts Technology PA Manufact current information SMD VAC FSK power line SMD Sopa SIAU transceiver HTSSOP28 uii STM32F103 SMD 1 U2 CBT7TR 32 bit MCU LOFP48 ST 3 to 5 5 V low power up to 400 SMD 1 U3 ST3232CTR kbps RS 232 TSSOP16 ST drivers and receivers EMI filter and USBUFO2W line termination SMD Te 6 for USB SOTT323 6 ST upstream ports 3 1 Y1 16MHz ppm Y HC 49 SMD Euroquartz ear 5 Citizen 1 Y2 32 768KHz ppm Y SMD ear QD 3 1 Y3 8MHz ppm Y HC 49 SMD Euroquartz ear 52 56 DoclD024383 Rev 1 ky UM1619 CRC 16 calculation Appendix B CRC 16 calculation The CRC 16 is based on the X16 X15 X2 1 polynomial Used CRC 16 table const uint16 t TableCRC16 256 0x0000 0xC601 Oxccol Ox0A00 OxD801 Ox1E00 0x1400 OxD201 OxF001 0x3600 0x3C00 OxFAO01 0x2800 OxEEO1 OxE401 0x2200 OxA001 0x6600 0x6C00 OxAAO01 0x7800 OxBEO1 OxBA401 0x7200 0x5000 0x9601 Ox9C01 0x5A00 0x8801 0x4E00 0x4400 0x8201 4 Oxcoc 0x06C0 0x0CCO OxCAC 0x18C0 OxDEC OxD4C 0x12C0 0x30C0 OxF6C OxFCC 0x3ACO OxE8C 0x2ECO 0x24C0 OxE2C 0x60C0 OxA6C OxACC Ox6ACO 0xB8C 0x7ECO 0x74CO OxB2C 0x90C 0x56C0 0x5CCO Ox9AC 0x48C0 0x8EC 0x84C 0x42C0 Y D D 1 0
12. ARE ST PRODUCTS DESIGNED OR AUTHORIZED FOR USE IN A SAFETY CRITICAL APPLICATIONS SUCH AS LIFE SUPPORTING ACTIVE IMPLANTED DEVICES OR SYSTEMS WITH PRODUCT FUNCTIONAL SAFETY REQUIREMENTS B AERONAUTIC APPLICATIONS C AUTOMOTIVE APPLICATIONS OR ENVIRONMENTS AND OR D AEROSPACE APPLICATIONS OR ENVIRONMENTS WHERE ST PRODUCTS ARE NOT DESIGNED FOR SUCH USE THE PURCHASER SHALL USE PRODUCTS AT PURCHASER S SOLE RISK EVEN IF ST HAS BEEN INFORMED IN WRITING OF SUCH USAGE UNLESS A PRODUCT IS EXPRESSLY DESIGNATED BY ST AS BEING INTENDED FOR AUTOMOTIVE AUTOMOTIVE SAFETY OR MEDICAL INDUSTRY DOMAINS ACCORDING TO ST PRODUCT DESIGN SPECIFICATIONS PRODUCTS FORMALLY ESCC QML OR JAN QUALIFIED ARE DEEMED SUITABLE FOR USE IN AEROSPACE BY THE CORRESPONDING GOVERNMENTAL AGENCY Resale of ST products with provisions different from the statements and or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever any liability of ST ST and the ST logo are trademarks or registered trademarks of ST in various countries Information in this document supersedes and replaces all information previously supplied The ST logo is a registered trademark of STMicroelectronics All other names are the property of their respective owners O 2013 STMicroelectronics All rights reserved STMicroelectronics group of companies Australia
13. RE RR il il RES Sos 8 3 1 System requirements 000 ees 8 3 2 Software installation llle 8 4 Hardware installation oooooooooommmmnoonaraaas 11 5 Software GUI description sllllllllu 13 5 1 Introduction o 13 5 2 Configuration tab variar Er AAA ARANA 13 5 3 Dongle tab qp pcc rrr 16 5 4 Operations tab anana nanana ss 17 5 5 A A II 19 5 6 Service tab 20 5 7 Sniffer taD vicio a Ra ACD RACK RR RR A 22 6 Firmware description lt 5 465 53 ir ARAS 25 6 1 IntroductiOn viaria rara al aa a kes qe Nai 25 6 2 Remote firmware update RFU 0 000 cee eee ee 25 6 3 Firmware download ooo 28 6 4 Firmware description 0 000 e eee eee 29 6 5 Firmware data types 2 220 ee 31 6 6 Firmware frame types 0 eee 34 6 6 1 Data Frames 2 000 c cece teens 34 6 6 2 PING Frames 6 rt ede RUE dee eame Pde ee de 35 6 6 3 Eror Frames iux eoe TEMERE EE RE RAM eR ERE 35 6 6 4 Acknowledgment Frames llle eee eee 36 6 6 5 Programming Frames sll les 36 6 6 6 Programming Frames o ococcc elles 40 6 6 7 Embedded module features APIS ooooccccccccocoo 46 2 56 DoclD024383 Rev 1 Ly UM1619 Contents Appendix A Schematic diagrams and bill of material 47 A 1 BllOrmaterial ys arcade ani dia e ina h 49 Appendix B CRC 16 calculation ooooooooomncnrrnrnnrn mms 53 References
14. and bill of material Table 1 Bill of material continued Qty Ref Part value Tol Voltage Watts Technology PA Manufact current information 1 220 uH 10 0 24 A Power inductor SMD EPCOS PNP small signal SMD 2 Q1 Q2 BC857 transistor SOT23 Any 1 R1 OR NM Not mounted SMD 1206 1 R2 750R 1 4710 w Metal film SMD 0603 any resistor 2 R3 R4 82R 1 4710 w Metal film SMD 0603 any resistor R5 R22 R23 Metal film 7 R24 R25 R2 10k 1 140 W 8 SMD 0603 Any resistor 6 R27 3 R6 R7 R19 1K 1 4710 w Metam SMD 0603 Any resistor 1 R8 27K 1 4710 w Metal film SMD 0603 Any resistor 1 R9 68K 1 4710 w Meal SMD 0603 Any resistor 1 R10 15K 1 4710 w etel film SMD 0603 Any resistor 1 RA 1K1 1 4710 w Metal film SMD 0603 Any resistor 1 R12 390 R 1 4710 w Metal film SMD 0603 Any resistor 1 R13 2K7 1 4710 w Meta film SMD 0603 Any resistor 1 R14 13 K 1 4710 w Metal film SMD 0603 Any resistor 1 R15 82K 1 4710 w Metal film SMD 0603 Any resistor 1 R16 4K7 1 4710 w Metal film SMD 0603 Any resistor g RIZR30 R3 on 1 110 w Metal film SMD 0603 Any 1 R32 resistor R21 R28 R2 3 9 R33 N M Not mounted SMD 0603 1 R18 1K8 1 4710 w Metal film SMD 0603 Any resistor 1 R20 2K49 1 4710 w Metab SMD 0603 Any resistor 1 T1 TRAFO 1 1 Transformer 1 1 oe Wurth Elektr Ly DoclD024383 Rev 1 51 56
15. and stay switched on In the GUI the orange message Programming Mode flashes at the bottom of the window In this tab there are several configuration panels described hereafter e Dongle Parameters In the dongle parameters panel it is possible to assign an address to the device The configuration is able to group certain modules with other and form a sub network group independent from other groups sharing the same power line If the grouping feature is used select the grouping box in the working mode box and assign the same group number to each module belonging to the same sub network If the grouping feature is not used the group fields are considered as the highest part of a 6 bytes address The address field is a 4 bytes address of the module if the grouping is used otherwise is the lowest 4 byte part of a 6 bytes address if the grouping is not used DoclD024383 Rev 1 Ly UM1619 Software GUI description Figure 12 GUI configuration tab B Remote Console for GP ST7540 power line modem module Rel 5 5 STMicroelectronics Asour conricurarion poNGuE OPERATIONS PROGRAM SERVICE SNIFFER OPTIONS Dongle Parameters Working Mode Hardware Commands El ACK Required F E SET Fe CONNECT Group 0x00 0x00 jired LF GET GB comer Address 0x00 0x00 0x00 0x00 Dongle Mode 4 CLEAR cs RUN E HOP level 2 x Hem SET TO REMOTE ea oxoo oxoo ADDRESS 0x00 Dongle Description
16. buffer 4 5 6 7 target module address buffer 8 SERVICE PARAM GET FOR GET DATA LINK STACK PARAMETERS buffer 9 PROG GRP LL STACK PARAM FOR GET MODULE PARAMETERS buffer 9 PROG GRP DEVICE DATA FOR GET USER DATA buffer 9 PROG GRP USER DATA buffer 10 11 CRC16 After a certain delay from the get command acknowledgment the PLM module will send the following frame RESPONSE FRAME FOR DATA LINK STACK PARAMETERS GET COMMAND APP userdata t frame frame source SOURCE PLM Data source PLM frame type APP SERVICE FRAME frame len 52 frame error APP ERROR NONE frame broadcast FALSE frame group sender group Device the one been queried group frame address sender address Device the one been queried address frame data 0 SERVICE PARAM GET Command echo frame data 1 PROG GRP LL STACK PARAM Sub command echo frame data 2 3 PLM MIN SLOT Minimum backoff time frame data 4 5 PLM MAX SLOT Maximum backoff time frame data 6 7 PLM NTW P GLOBAL TX TO Timeout for global tx frame data 8 9 10 11 PLM NTW P BC GLOBAL TX TO Timeout for broadcast frame retransmission frame data 12 13 PLM NTW P ACTIVITY TO Timeout for network frame data 14 15 PLM NTW P WATCHDOG TO Watchdog timeout frame data 16 17 18 19 PLM NTW P DATATRANSFER TO Timeout for completing a transfer from source to target frame data 20
17. crisisen e hrs 26 REU TOW CHAM qe a canal ga te ances a pe eee eek dS ne a gee ae en Ale ne A 27 Active project selection 00 0 eee eee 28 Workspace structure 0 0 0 0 00 teen 29 Schematic diagrams 1 Of 3 0 0 eee 47 Schematic diagrams 2 Of 3 0 eee 48 Schematic diagrams 3 Of 3 0 0 eee 49 DoclD024383 Rev 1 Ky UM1619 Features Features e Configurable FSK power line modem interface with an embedded firmware stack for a complete power line communication management e 8user configurable general purpose input output pins e USART and SPI communication channel for module interfacing e Internal configurable RTC module with lithium backup battery e Programmable user data and PLM parameters Flash memory area e Remote firmware update e Embedded AES 128 encryption module with programmable AES Key DoclD024383 Rev 1 5 56 Hardware description UM1619 2 6 56 Hardware description The STEVAL IHPOO5V1 block diagram is shown in Figure 2 The general purpose power line modem module is based on an ST7540 FSK power line modem transceiver and an ARM 32 bit Cortex M3 core based STM32F103xB microcontroller The PLM module board is a fully functional communication module with 8 programmable I Os a real time clock and a Flash memory area for modem parameters and user data storage The firmware structure is made up of several layers each dealing with a different feature The applicatio
18. data from internal flash Clear data resetting the programming flag Device blank run mode impossible Device Data Link layer stack parameters User program Reset internal state machines Module hardware reset Set service parameters Get service parameters Get general purpose inputs pin status Set general purpose outputs pins value Get the stack and the module firmware release Set the internal time clock value Get the internal time clock value Set the general purpose input and output pins Get the general purpose input and output pins User defined service commands 0x0b to 0x7f Number of FEC correction to the sensed frame Frame with for a wrong postamble Frame with a wrong CRC Frame with a HOP overrun TRUE Frame rejected FALSE frame accepted Data Error Programming Result response to a query same as data frame ACK back ACK Ping Service Unknown type 33 56 Firmware description UM1619 6 6 6 6 1 34 56 The data type for the dongle h module stm32f10x_gpio module are listed hereafter LED TYPE typedef enum A_LED_ERROR A_LED_DATA A_LED_BOTH DH LedType t LED STATUS typedef enum A_LED_ON A_LED_OFF A_LED_FLASH DH_LedAction_t PIN VALUE typedef enum Bit_RESET 0 Bit_SET BitAction Firmware frame types This paragraph describes all the frame type that are implemented in this firmware In each field there is
19. frame broadcast FALSE frame group sender group Device the one been queried group frame address sender address Device the one been queried address 38 56 DoclD024383 Rev 1 Ly UM1619 Firmware description frame frame frame frame frame frame frame frame frame frame frame frame frame frame frame frame frame frame data 0 PROG CMD GET DATA data 1 PROG_GRP_LL_STACK_PARAM data 2 3 PLM_MIN_SLOT 4 data 4 5 PLM MAX SLOT data 6 7 PLM NTW P GLOBAL TX TO data 8 9 10 11 PLM_NTW_P_BC_GLOBAL_TX_TO data 12 13 PLM_NTW_P_ACTIVITY_TO data 14 15 PLM_NTW_P_WATCHDOG_TO data 16 17 18 19 PLM NTW P DATATRANSFER TO data 20 21 PLM NTW P BANDINUSE TO data 22 33 24 25 PLM NTW P FRAME TX TO Es data 26 27 28 29 PLM NTW P BCAST TX TO data 30 31 32 33 PLM NTW P ACK RX TO data 34 35 36 37 PLM_NTW_P_bACK_RX_TO Jl data 38 39 40 41 PLM NTW P FRM RX TO data 42 43 44 45 PLM NTW P NDX TO fE data 46 47 PLM_LL_MAX_ATTEMPT data 48 49 PLM LL MAX RPT ATTEMPT data 50 51 DEVICE_TIME_SYNC RESPONSE FRAME FOR MODULE PARAMETERS GET COMMAND APP_userdata_t frame source SOURCE_PLM type APP PROGRAMMING FRAME len 10 error APP ERROR NONE broadcast FALSE group sender group address sender address data 0 PROG CMD GET DATA Lf data 1 PROG G
20. level 3 3 V in this case the LED is red or a low level GND in this case the LED is green If the pin is configured as output the output x where x is the pin number is shown in the input status panel and the corresponding check box is unchecked A toggle pushbutton is than associated to each output indicating if the correspondent pin in the module must be set high 3 3 V in this case the pushbutton must be pressed before to press the set outputs button in the commands panel or must be set low GND releasing the pushbutton before press the set outputs button in the commands panel DoclD024383 Rev 1 17 56 Software GUI description UM1619 5 4 18 56 Figure 13 GUI dongle tab Bl Remote Console for GP 5T7540 power line modem module Rel 5 5 STMicroelectronics ABOUT CONFIGURATION DONGLE OPERATIONS PROGRAM SERVICE SNIFFER OPTIONS Time Node Time Commands Available Node list 0x00 0x 11 03 25 00 00 00 E emmes oe Set curet F seroursurs a SET IOCFG GETIOCFG GET TIME SET TIME Broadcast o o o o o o o o STOP Log Window Decimal view CLEAR LOG comi RUN MODE As soon as the pin configuration is set by the user checking or unchecking the corresponding check box the SET IO CFG button must be pressed before the configuration has effect After that each output can be set reset and each input can be checked All those operations can
21. only a single connector for power supply and control signals A lithium backup battery mounted on the module and a 32 KHz quartz allows use of the full functionality of the internal RTC of the microcontroller permitting precise time based operations DoclD024383 Rev 1 7 56 Hardware description UM1619 Figure 4 User interface connector 3 3V J4 12V CON24A SPI2 MOSI 1 2 PLM GPIO7 SPI2 MISO 3 4 PLM GPIO6 SPI2 SCK 5 6 PLM GPIO5 R28 OR SPI2 NSS 7 8 PLM GPIO4 USART1 RX RS232 RX 9 10 PLM GPIO3 USART1 TX RS232 TX 11 12 PLM GPIO2 USB D 13 14 PLM GPIO1 R29 OR USB D 15 16 PLM GPIOO 17 18 19 20 BOOTO 21 22 23 24 8 56 A three color LED allows the signaling of some module operations such as data transmission and reception programming phase and so on The user can also use these LEDs for his own application needs by means of dedicated APIs Finally a programming connector allows firmware download and debug even if it is possible to use the remote firmware update feature to remotely update the firmware using the PLM as described further in this user manual If the IAR JLINK JTRACE is used for the firmware downloading a simple JTAG adapter is necessary Figure 5 shows the adapter schematics Figure 5 Programming connector JTAG adapter DoclD024383 Rev 1 UM1619 Getting started 3 Getting started 3 1 Syst
22. 1 Node 1 F2 0x00 73 0x00 4 0x00 5 0x00 0x00 7 Ox00 8 0x00 Broadcast 9 0x00 d MEN stoe Log Window Y E E E Decimal view CLEAR LOG COML RUN MODE As previously described for other features the command to store data can be sent in broadcast or to a precise module listed in the AVAILABLE NODE LIST window by pressing the SET button The get button instead reads the stored data from the selected node DoclD024383 Rev 1 Ly UM1619 Software GUI description 5 6 Service tab The SERVICE tab is shown in Figure 16 This tab is dedicated to the test of all the special frames called service frames The first button in the commands panel is the PING button This is used to test if a module is connected to the power line if it is working properly and if itis reachable By pressing the PING button as soon as the target module replies to the ping command the target address and the ping time are shown in the Command window Figure 16 GUI service tab Wl Remote Console for GP ST7540 power line modem module Rel 5 5 STMicroelectronics ABOUT CONFIGURATION DONGLE OPERATIONS PROGRAM SERVICE SNIFFER OPTIONS PING FIRM REL PLM PARAM UPDATE FW Clear Message Window REMOVE NODE Log Window In order to know the firmware release both for the application layer and the link layer stack the FIRM REL button must be pressed after selec
23. 1A40 OxDC41 OxD641 0x1040 0x3240 OxF441 OxFE41 0x3840 OxEA41 0x2C40 0x2640 OxE041 0x6240 0xA441 OxAEA1 0x6840 OxBA41 0x7C40 0x7640 OxB041 0x9241 0x5440 Ox5E40 0x9841 0x4A40 0x8C41 0x8641 0x4040 BRK RK IK RRR RK RK KKK ko kk AR RR RAR RAR KK RK RK KK RK Function Name Description Input Return CalcCRC16 Calculate a 16 bit CRC Buffer pointer buffer length Calculated CRC X16 X15 X2 1 FIO IO II II ke kk e kk e kk ARA IOI IO I IO III III IOI I IO I k A IE Y uinti16 t CalcCRC16 uint8_t buf uinti t crc while crc return len 0 crc gt gt 8 TableCRC16 cre crc i DoclD024383 Rev 1 uint8 t len buf amp Oxff l 53 56 References UM1619 References UM1573 ARM based 32 bit MCU STM32F10x Standard Peripheral Library Rel 3 5 0 2011 ST7540 FSK power line transceiver datasheets 2006 AN3046 IAR Embedded Workbench IDE for STM32 microcontrollers Rel 6 3 documentation www iar com ak WN gt 54 56 DoclD024383 Rev 1 Ly UM1619 Revision history 7 Revision history Table 2 Document revision history Date 23 May 2013 Revision 1 Initial release Changes DoclD024383 Rev 1 55 56 UM1619 Please Read Carefully Information in this document is provided solely in connection with ST products STMicroelectronics NV and its subs
24. 21 PLM NTW P BANDINUSE TO Timeout for the band in use signal frame data 22 33 24 25 PLM NTW P FRAME TX TO Timeout for sending a frame through SPI frame data 26 27 28 29 PLM NTW P BCAST TX TO Timeout for repeat a broadcast frame frame data 30 31 32 33 PLM NTW P ACK RX TO Timeout for receiving an ACK frame frame data 34 35 36 37 PLM NTW P bACK RX TO Timeout for receiving a bACK frame frame data 38 39 40 41 PLM NTW P FRM RX TO Timeout for frame receptions frame data 42 43 44 45 PLM NTW P NDX TO Minimum delay before any frame data 46 47 PLM LL MAX ATTEMPT Max attempts if no activity is detected frame data 48 49 PLM LL MAX RPT ATTEMPT Max repetition attempts processed ID frame data 50 51 DEVICE TIME SYNC Timeclock update synchro frame interval RESPONSE FRAME FOR MODULE PARAMETERS GET COMMAND APP userdata t frame frame source SOURCE PLM Data source PLM frame type APP SERVICE FRAME frame len 10 frame error APP ERROR NONE 42 56 DoclD024383 Rev 1 Ly UM1619 Firmware description frame broadcast FALSE frame group sender group Device the one been queried group frame address sender address Device the one been queried address frame data 0 SERVICE PARAM GET Command echo frame data 1 PROG GRP DEVICE DATA Sub command echo frame data 2 E sender group frame data 4 6 7 sender address cu gourc
25. 2fl Ox_itc System files iL AESI28 c iD AES128 0 iB stk Lo as PLM driver El stk no i t application c E comm c IE dongle c i B twupdate c Po Application Engine i iap c i IE main c serc 2 2 72 User layer E misec X E stm32f1 0x_bkp c E stm32N 0x_exti c IE stm32f10x_flash c 30 stm32f10x apio c iE stm32f1 0x_iwdg c E El stm3211 Ox_pwr c penal STM32 Standard library IE stm32f10x rcc c i iE stm32f1 Ox_rte c IE stm32fl0x spi c E stm32f1 0x tim c mE stm32f1 x usartc IIIBLIIITILIALITTIAIITI t2 2 DoclD024383 Rev 1 UM1619 Firmware description At this level are available all the communication APIs and all the APIs for the application engine interfacing In the main file the following code is implemented for running the state machine engines main void System initialization APP ApplicationInit Infinite loop while 1 USER program execution defined in user c and user h files USER_Program Application stack engine APP StackUpdate j After the initialization the infinite loop calls two main functions the USER_Program and the APP_StackUpdate routine The latter is the application engine state machine which inside runs the PLM stack state machine while the first one calls the user program The user program implemented in this user manual im
26. AD STACK POINTER REGISTER WITH FIRST VECTOR TABLE ADDRESS LOAD VECTOR TABLE REGISTER WITH FIRST VECTOR TABLE LOAD VECTOR TABLE REGISTER WITH SECOND VECTOR TABLE JUMP TO NEW APPLICATION ADDRESS VECTOR TABLE REGISTER 4 uC RFU APPLICATION RUNNING RFU START COMMAND RECEIVED STORE CHECKSUM STORE TOTAL SIZE STORE SEGMENT IN THE SECOND IMAGE AT THE GIVEN ADDRESS OFFSET IS ADDED IN THE VECTOR TABLE NEW FIRMWARE SEGMENT RECEIVED STORE SEGMENT IN THE FIRST IMAGE AT THE GIVEN ADDRESS OFFSET IS ADDED IN THE VECTOR TABLE STORE THE SECOND CHECKSUM RFU SWAP d FIRST IMAGE ADRESS IN THE COMMAND IMAGE IS BOOTLOADER DATA RECEIVED CORRECT ACTIVE SEGMENT STORE THE FIRST IMAGE ADRESS IN THE BOOTLOADER DATA SEGMENT DoclD024383 Rev 1 Ly UM1619 Firmware description 6 3 Firmware download In the setup directory there are different workspaces stored in different directories In order to implement the remote firmware update feature it is necessary to download the project located in the workspace Firmware Application and Bootloader This workspace contains two different projects one is the bootloader and the other one is the application itself If the module has never been programmed this workspace must be downloaded before Open the IAR Embedded Workbench IDE for ST
27. ATA PROG_CMD_CLEAR_DATA PROG_CMD_DEVICE_BLANK APP PROG CMD t PROGRAMMING GROUPS typedef enum PROG_GRP_DEVICE_DATA PROG_GRP_LL_STACK_PARAM PROG_GRP_USER_DATA JAPP_PROG_GROUP_t SERVICE COMMANDS typedef enum 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x00 0x01 0x02 NATIVE SERVICE COMMANDS SERVICE SOFTWARE RESET SERVICE HARDWARE RESET SERVICE PARAM SET SERVICE PARAM GET SERVICE INPUTS GET SERVICE OUTPUTS SET SERVICE FW REL GET SERVICE PLM CLOCK SET SERVICE PLM CLOCK GET SERVICE IO CONFIG SET SERVICE IO CONFIG GET USER DEFINED SERVICE COMANDS SERVICE USER CMD xx APP SER CMD t 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x TRANSIT DATA SERVICE FLAGS typedef struct APP TF t type uint8 t FECcorrections bool wrongpostamble bool wrongCRC bool hopoverrun bool framerejected APP SER FLAGS t TRANSIT FRAME TYPE typedef enum 1 APP_TF_DATA 0x00 APP_TF_ERROR 0x01 APP_TF_PROGR 0x02 APP_TF_RES 0x03 APP_TF_ACK 0x04 APP_TF_bACK 0x05 APP_TF_PING 0x06 APP TF SERVICE 0x07 APP TF UNKNOWN 0x7f APP TF t DoclD024383 Rev 1 El Ll El 4 Il No command Enter the programming mode Exit from programming mode Write data into the internal flash Get
28. C COM 22uH 750R 5 10uF 3 AC IN L1 PAYA T a 1 IT AC IN N ca 9 4 7 L2 c3 c4 68nF X1 D1 220uH N M 6 8nF A CONS SM6T15CA 43 D2 c5 BAT54S Yi 1 10 10uF A 16MHz B t Lo Ti TRAFO 1 1 42V 12V c6 C7 33pF 33pF 5v VDC zl N R8 2 7K U1 E C8 c9 ST7540 100nF 10uH A C10 D4 3 CD PD 1 28 10nF 2 R9 2 R10 R11 CD PD TEST2 57 les 2 x 27 E Barsas t PESE EZ REG DATA TESTI LY NE L 68K 15K 1K1 RXD 4 GND VDC 25 RxD RX_IN RX TX 5 24 RxTx CL xpi TxD Vsense ES a 3 3V BUTHERM 7 BU ITHERM Xo 22 CLR T 8 21 97 CLRIT x1 2o VDD SVss 10 19 SUE MICRO T MCLK TX OUT He 4 145 RSTO PA IN 7 5V_VDC t 73 UART SPI Vcc Lig 4 1 12V Sk T 14 WD Vss 45 gt C15 C16 R13 PA IN EPPA OUT 100nF 10uF gt 2K7 C18 c19 C20 R15 i29 100nF 10uF 100pF 82K C17 1 eet 4 R16 R17 Pe AKT OR 638 l R20 2K49 R19 22pF 1K C28 R21 270pF N M c29 m J M I 100pF Ly DoclD024383 Rev 1 47156 Schematic diagrams and bill of material UM1619 Figure 26 Schematic diagrams 2 of 3 3 3V ai Q2 BC857 BC857 R5 10K R3 R4 82R 82R R6 1K E RED 1 3 GREEN Y V B
29. Command echo Sub command echo Data source PLM Device the one been queried group Device the one been queried address Command echo Sub command echo sender user data 39 56 Firmware description UM1619 6 6 6 40 56 Programming Frames The programming frames are frames containing service commands concerning both some native module features internal clock general purpose inputs and outputs etc and user defined service frames Native frames are managed directly by the application engine From the COMM interface module SPI USART USB etc uint8 t buffer buffer 0 n 11 buffer 1 APP_SERVICE_FRAME BROADCAST FLAG buffer 2 3 target module group buffer 4 5 6 7 target module address buffer 8 APP SER CMD t command buffer 9 9 n 1 service data n buffer 9 n 9 n 1 CRC16 Service frame payload length n 11 Service frame type Target device group 2 bytes Target device address 4 bytes Service command Service data CRC 16 BROADCAST FLAG 0x80 data sent in broadcast BROADCAST FLAG 0x00 data sent in unicast From to communication interface PLM SPI USART USB etc APP userdata t frame frame source SOURCE PLM frame type APP SERVICE FRAME frame len n 1 frame broadcast TRUE FALSE frame group target module group frame address target module address frame data 0 APP SER CMD t command frame data n s
30. EL check box allows to assign a hierarchical level to each module that is enabled to work also as a repeater Each time a data frame is repeated the hop is decremented by one Only the modules with lowest hop level will repeat the same frame Please refer to user manual UM1573 ST7540 power line modem firmware stack for more details on PLM protocol parameters DoclD024383 Rev 1 15 56 Software GUI description UM1619 16 56 e AES key The 128 bits of the AES key are set here in this panel In order to enable the AES key panel before to connect the module check the relative option USE ENCRYPTION AES 128 in the option tab e Dongle description This box is used to associate a description of the programmed module to the node address The description together with the module will be displayed everywhere in the GUI each time a node list is displayed The description is stored in a local database so if you run the GUI with a programmed node in another PC the description is missing The node list file is located in the directory C Program Data YSTMicroelectronics Remote Console 1 0 0 0 settings donglelist It is possible to manually edit this file using a text editor adding in each line the following text 0xg1 0xg0 0xa3 0xa2 0xa1 0xa0 gt description where g1 and 90 are the group byte values in hexadecimal and the a3 a2 a1 and a0 are the address byte values in hexadecimal The description is what will appear in the don
31. Licensed Software If you choose not to agree with these provisions do not download or install the enclosed Licensed Software and the related documentation and design tools By using the Licensed Software You are agreeing to be bound by the terms and conditions of this Agreement Do not use the Licensed Software until You have read and agreed 9 accept the terms of the license agreement do not accept the terms of the license agreement 3 In the next window click Install In the following window select the folder in which to install the software package By default the software is installed in the path C STMicroelectronics IHPO05 V1 Figure 8 Destination folder window STEVAL IHPOOSVI1 InstallShield Wizard Choose Destination Location Select folder where setup will install files Install STEVAL IHPODSV1 to C ASTMicroelectronicsNS TEVAL IHPDOSV1 2 10 56 DoclD024383 Rev 1 UM1619 Getting started 4 after selecting the folder and clicking the Next button installation of the software starts Figure 9 Installation status window STEVAL IHPOOSV1 InstallShield Wizard Setup Status The InstallShield Wizard is installing S TEVAL IHPOO5V1 Installing DC ASTM32F10x StdPeriph Driversincsstm32H 0x_pwr h Cancel 5 When installation is complete click Finish The GUI is located in the folder Software Re
32. M32 microcontrollers Rel 6 3 or a more recent release Click File Open Workspace and load the following workspace placed in the directory selected during the setup file installation Firmware Application and Bootloader EWARM Project eww Verify that the Application project is the active project the project name must be in bold otherwise select the active project in the list below the workspace Figure 23 Figure 23 Active project selection IEEE ag Project IAR Embedded Workbench IDE File Edit View Project Simulator Tools Window Help O Project BOOTLOADER E Project f Project GP PLM ST7540 BL APP Y ICjEWARMV6 ipse m Click Project Batch Build or press the key F8 in order to compile at the mean time the bootloader and the application After compiling is completed press Project Download and Debug or press CTRL D keys Both firmware downloads start As soon as the download is completed press F5 in order to run the application or exit from the debug mode pressing the keys CTRL SHIFT D and unplug the programmer If the procedure is done correctly the orange LED should be on indicating the module has never been set up before If it is not the case try first to erase the memory by clicking Project Download Erase Memory and download the firmware again as described previously Use the GUI interface in order to set up the module and connect it to the power line as de
33. OOTO R7 x Y D3 Ik t PLM7 GPIO BLLED PLM6_GPIO PLM5 GPIO 2 4 RSTIN 3 3V 1 TRST TDO TDI TCK 00 im co JLo t co O o o9 h BATT1 xr t st st sr t t ft t 02 02 e C11 C12 C13 t 00 O c0 O r o 10 t CO 10 t E I ez 4 TuF 16V 100nF 100nF on RRA 33N 3v ao fo ca 1 2 am 36 gt gt VBAT VDD 2 35 PC13 TAMPER RTC VSS 2 34 TMS g PC14 OSC32 IN PA13 L33 USB USBDP 5 PC15 OSC_OUT PA12 F32 USB USBDM Dena PDO OSC_IN PA11 FT USART RX 6 ot OSC QUT mE USART1_ RX 100nF Y2 o R38 Y3 i T BST T BAS USART1_TX 32 768KHz amp NM 8MHz R12 8 Yesa PAG ls g 390R 9 SPI2 MOSI 4 q0 VDDA PB15 SPI2 MISO HA pE PA0 WKUP u2 PB14 SPI2_SCK a 177 PA1 STM32F103CBT7TR PB13 SPD NSS Le a PA2 PB12 C21 C22 C23 C24 C25 ecu NFNONOTATONO 10pF 10pF 22pF 22pF 100nF a p p P P i EK EERPERRSS 33v Ez Tx is eo lt taco IN eo o lo fe lex eo t ejeje jejeje ajajajaja A REG_DATA CD PD BU THERM ojojojojo RX TX C5 65 65 6 C27 CLRIT elslgels 100nF TXD RXD ela aaa 48 56 DoclD024383 Rev 1 UM1619 Schematic diagrams and bill of material Figure 27 Schematic diagrams 3 of 3
34. PTION IS ENABLED 36 ENCRYPTION IS DISABLED 20 APP SERVICE FRAME target module group 6 7 target module address SERVICE PARAM SET buffer 9 PROG GRP DEVICE DATA buffer 10 11 new group buffer 12 13 14 15 new address buffer 16 uint8 t module working mode buffer 17 hop level IF AES ENCRYPTION IS ENABLED buffer 18 gt 33 AES_key_buffer buf 34 35 CRC16 rid AES ENCRYPTION IS DISABLED buf 18 19 CRC16 y e ii fer IF fer module working mode b7 b6 b5 b4 b3 b2 b1 b0 Reserved ACK frame requested bACK frame requested Dongle works also as a repetitor Static repeater behaviour Grouping filter enabled Encrypted data Reserved subnet DoclD024383 Rev 1 AES Key 0 to 15 oc a cr ES 16 bytes ACK frame not requested bACK frame not requested Dongle doesn t repead frames Repeat only frames with no response Grouping filter disabled Clear data 41 56 Firmware description UM1619 4 Set module parameters programming user parameters uint8 t buffer buffer 0 32 buffer 1 APP SERVICE FRAME buffer 2 3 target module group buffer 4 5 6 7 target module address buffer 8 SERVICE PARAM SET buffer 9 PROG GRP USER DATA buffer 10 gt 29 user data buffer buffer 30 31 CRC16 5 Get module parameters uint8 t buffer buffer 0 12 buffer 1 APP SERVICE FRAME buffer 2 3 target module group
35. RP DEVICE DATA data 2 3 sender group data 4 5 6 7 sender address data 8 source module_working_mode data 9 hop level frame frame frame frame frame frame frame frame frame frame frame frame frame frame RESPONSE FRAME FOR USER DATA GET COMMAND APP_userdata_t frame frame frame frame frame frame frame frame frame frame frame Source SOURCE PLM type APP PROGRAMMING FRAME len 22 error APP ERROR NONE broadcast FALSE group sender group address sender address data 0 PROG CMD GET DATA data 1 PROG GRP USER DATA data 2 USER SETTINGS SIZE 1 DoclD024383 Rev 1 Ke E Command echo Sub command echo Minimum backoff time Maximum backoff time Timeout for global tx Timeout for broadcast frame retransmission Timeout for network watchdog timeout Timeout for completing a transfer from source to target Timeout for the band in use signal Timeout for sending a frame through SPI Timeout for repeat a broadcast frame Timeout for receiving an ACK frame Timeout for receiving a bACK frame Timeout for frame receptions Minimum delay before any Max attempts if no activity is detected Max repetition attempts processed ID Timeclock update synchro frame interval Data source PLM Device the one been queried group Device the one been queried address
36. RPM Cm 54 7 REVISION history suas sd rr RARA RA 55 Ly DoclD024383 Rev 1 3 56 List of figures UM1619 List of figures Figure 1 Figure 2 Figure 3 Figure 4 Figure 5 Figure 6 Figure 7 Figure 8 Figure 9 Figure 10 Figure 11 Figure 12 Figure 13 Figure 14 Figure 15 Figure 16 Figure 17 Figure 18 Figure 19 Figure 20 Figure 21 Figure 22 Figure 23 Figure 24 Figure 25 Figure 26 Figure 27 4 56 STEVALSIEIPOOSV Tita ido E ates ES eS da 1 STEVAL IHPOO05V1 block diagraM oooocooooccoc lees 5 Three phase connection 0000 cee teeta 6 User interface connector 00000 ete ee 7 Programming connector JTAG adapter 0 0 0 ccc eae 7 Installation window 0 0000 ete eee 8 License window 0 2 00 c cee eee 9 Destination folder window llli 9 Installation status WINdOW ooooooo ne 10 RS232 connection o 11 GUl options tab pee ts Re E an eae On Phe a 12 GUI configuration tab essre eors reene eara nke Rm 14 GUIdongle tab 2 lu a n EROR de RE Rud E auem c 17 GUI operations tab 0 2 2 0 0 0 0c ete 18 GUI program tab sme gems m We PR um Rc el Pa eles uo RA eae ae 19 CIUIICI Uoc 20 PLM communication parameters window 00 0c e eee eee 21 GUI sniffer tab cote ERE uH Se ERRAT pO os ee ee Ser 22 Sniffer information o 23 Module firmware structure llli ns 25 Memory organization as erissai
37. S typedef enum APP_ERROR_NONE APP_ERROR_GENERIC APP_ERROR_COMM_TIMEOUT APP_ERROR_SERVICE_GRP_UNKNOWN APP_ERROR_SERVICE_CMD_ERROR APP_ERROR_COMMUNICATION APP_ERROR_ISOLATED_NODE APP_ERROR_HARDWARE APP_ERROR_WRONG_PROG_COMMAND APP_ERROR_WRONG_PROG_GROUP APP_ERROR_DEVICE_BLANK APP_ERROR_RTC_ERROR APP_ERROR_WATCHDOG_DISABLED APP_ERROR_NODE_INIT_FAILED APP_ERROR_RTC_DISABLED APP ERROR t USER COMMUNICATION FLAGS typedef enum 1 USER DATA TRANSMISSION START USER DATA TRANSMISSION END USER DATA ARRIVED USER DATA COMMUNICATION ERROR 0x00 0x01 0x02 0x03 0x04 0x05 FROM 0x00 TO Ox7F 0x00 Hf 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e DoclD024383 Rev 1 No error Generic communication error Communication timeout error Service group unknown error Service command error Communication error Node unreachable error Hardware error Wrong programming command error Wrong programming group error Device blank Error setting the system time Hardware reset impossible Node initialization failure Internal RTC disabled UM1619 Firmware description Ly USER DATA BUSY USER DATA IDLE APP userflag t PROGRAMMING COMMANDS typedef enum PROG_CMD_IDLE PROG_CMD_ENTER_PROG_MODE PROG_CMD_EXIT_PROG_MODE PROG_CMD_SET_DATA PROG_CMD_GET_D
38. also a description Data Frames Data frames are frames exchanged between two PLM modules or between a PLM module and an external device connected to the COMM interface From the COMM interface module SPI USART USB etc buffer 0 buffer buffer buffer buffer buffer n 10 2 3 target_module group 4 5 6 7 target_module address 8 8 n 1 user data n 8 8 n 8 n 1 CRC16 1 APP_DATA_FRAME BROADCAST FLAG Data frame payload length n 10 Data frame type Target device group 2 bytes Target device address 4 bytes User data n bytes at least 1 CRC 16 BROADCAST FLAG 0x80 gt data sent in broadcast BROADCAST FLAG 0x00 gt data sent in unicast From to communication interface PLM SPI USART USB etc frame source SOURCE PLM frame type APP SERVICE FRAME frame len n frame broadcast TRUE FALSE frame group target module group frame address target module address frame data n service data n DoclD024383 Rev 1 Data source PLM Data frame type Data frame payload length TRUE broadcast FALSE unicast Target device group 2 bytes Target device address 4 bytes User data n bytes 2 UM1619 Firmware description 6 6 2 6 6 3 4 Ping Frames This particular frame is used to ping a remote via PLM interface or a local via COMM interface module When a ping frame is received this is managed directly
39. ast FALSE frame group sender group frame address sender address frame data 0 SERVICE PLM CLOCK GET frame data 1 target module hours frame data 2 target module minutes frame data 2 target module seconds 12 Set module general purpose outputs value uint8 t buffer buffer 0 14 buffer 1 APP_SERVICE_FRAME buffer 2 3 target module group buffer 4 5 6 7 target module address buffer 8 SERVICE PLM CLOCK SET buffer 9 target module new hours buffer 10 target module new minutes buffer 11 target module new seconds buffer 12 13 CRC16 13 User defined service frame uint8 t buffer buffer 0 data buffer len buffer 1 APP SERVICE FRAME buffer 2 3 target module group buffer 4 5 6 7 target module address buffer 8 APP SER CMD t command buffer 9 n service data n buffer n 1 n 2 CRC16 DoclD024383 Rev 1 th Data source PLM Device the one been queried group Device the one been queried address Command echo User defined comand in the range 0x0b gt Ox7f User service data if any CRC 16 45 56 Firmware description UM1619 6 6 7 46 56 Embedded module features APIs The PLM module has some embedded features which can be used by the user some other are instead managed directly by the application engine General purpose input pins status get uint8 t DH GetInputs void General purpos
40. at data link layer and is not notified at the application and consequently at the user levels From the COMM interface module SPI USART USB etc buffer 0 10 buffer 1 APP_PING_FRAME buffer 2 3 target_module group buffer 4 5 6 7 target_module address buffer 8 9 CRC16 Ping Ping Target device group Target device address frame payload length n 11 frame type 2 bytes 4 bytes CRC 16 From to communication interface PLM SPI USART USB etc frame frame Source frame frame broadcast frame frame SOURCE PLM type APP PING FRAME len 0 FALSE group target module group address target module address Error Frames Data Ping Ping Ping Target device group Target device address source PLM frame type frame payload length frames can be sent only in unicast 2 bytes 4 bytes These can be considered data frames they are user error frames from user application level addressed to a target PLM module From the COMM interface module SPI USART USB etc uint8 t buffer buffer buffer buffer buffer buffer buffer 12 APP ERROR FRAME 3 target module group 4 5 6 7 target module address 8 9 user error code 10 11 CRC16 0 T 2 Error frame payload length Data Target device group Target device address User 12 frame type 2 bytes 4 bytes error code 2 bytes CRC 16 Fr
41. be done in different way in broadcast mode in this case if the BROADCAST check box in the commands panel is selected before press any button each set operation will be executed by each node connected in the same power line The command will be sent by the module connected to the GUI via the power line to all the other nodes In order to configure a single node a remote node or the one connected to the GUI the node must be selected in the AVAILABLE NODE LIST window before to press any command button In broadcast mode the get operations are not allowed Last the STOP button resets the connected dongle if some remote operations are ongoing and the user wants to interrupt the operation Be aware that the I O pins are not protected and directly wired with the microcontroller Poi s pins So if the pins are electrically connected in a wrong way a serious damage can be caused in the module Operations tab The OPERATIONS tab Figure 14 is the place where to test a communication between two modules connected to the same power line In the Message window is possible to write a text message select the target node in the available node list and send the message by pressing the SEND MSG button DoclD024383 Rev 1 Ly UM1619 Software GUI description Figure 14 GUI operations tab B Remote Console for GP 577540 power line modem module Rel 5 5 STMicroelectronics ABOUT CONFIGURATION DONGLE OPERATIONS PROGRAM SERVICE
42. bill of material UM1619 Table 1 Bill of material continued Qty Ref Part value Tol Voltage Watts Technology PA Manufact current information 2 66 67 33 pF 59 50 Vdc COG ceramic SMD 0603 Any capacitor C8 C12 C13 C14 C15 C18 C2 XTR ceramic 13 5 C27 C30 100 nF 10 50V capacitor SMD 0603 Any C31 C32 C3 3 C34 1 C10 10 nF 10 50V X7R ceramic SMD 0603 Any capacitor 1 c11 4 7uF 16V 10 16V X7R ceramic SMD 0805 Any capacitor 1 C17 15 pF 5 50 Vdc COG ceramic SMD 0603 Any capacitor 2 620 29 100 pF 5 50 Vdc COG ceramic SMD 0603 Any capacitor 2 21 c22 10 pF 5 50 Vdc COG ceramic SMD 0603 Any capacitor g C23 C24 C2 22 pF 5 50 Vdc COG ceramic sup 0603 Any 6 capacitor 1 C28 270 pF 5 50Vdc COG ceramic SMD 0603 Any capacitor 1 D1 SM6T15CA 15 VDC Transil diode SMD SMB ST Small signal SMD 2 D2 D4 BAT54S 40 V 300 mA Schottky diodes SOT23 ST LED SMD T BA Bg BICOLOR 322 7mm AU MM ies RED GRN nes 9 3 way right Through angle stripline hole Winslow 1 J1 CON3 connector 4 8 2 54mm Adaptic mm contacts itch length P 2 J2 NM low profile 1 133 PROG female strip line Trough Stelvio hole Kontek connector 24 way 2x12 right angle Through stripline hole Winslow ts GONZA connector 2 54mm Adaptic 4 8mm contacts pitch length 1 L1 22 uH 1096 2 1A Power inductor SMD EPCOS 50 56 DoclD024383 Rev 1 Ly UM16 19 Schematic diagrams
43. culated and compared with the one sent by the remote PLM and after the reset vector address of the new firmware is written in a dedicated Flash segment of the bootloader Lastly the microcontroller is self reset and the new firmware executed Figure 21 Memory organization BOOTLOADER BOOTLOADER 3Kb RESET VECTORS IMAGE 1 FIRMWARE ACTIVE IMAGE POINTER FIRMWARE rot used 2 bi IMAGE 1 Not used 32 bit 1Kb Not used 32 bit RESET VECTORS IMAGE 2 FIRMWARE IMAGE 2 The RFU protocol manages the RFU start get new firmware segment with the segment address and swap commands The protocol is not embedded in the bootloader hence it can be updated with the new firmware but the user must be careful with the modifications as any bug can compromise the RFU mechanism As soon as a new firmware segment is received the RFU manager checks if the address is within the firmware interrupt vector table If it is the case an offset depending on the free firmware image 1 or 2 allocation is added to each interrupt vector before being written in the free image flash area Figure 22 shows the RFU flow chart DoclD024383 Rev 1 27 56 Firmware description UM1619 28 56 Figure 22 RFU flow chart uC Startup bootloader uC RFU READ ACTIVE IMAGE ADDRESS YES NO FIRST IMAGE ADDRESS LOAD STACK POINTER REGISTER WITH SECOND VECTOR TABLE ADDRESS LO
44. e Figure 20 shows the firmware structure Figure 20 Module firmware structure USER CUSTOMIZABLE APPLICATION LAYER COM SPI RS232 USB USER DATA PARAMETERS RTC 1 Os LEDs FLASH MEMORY l The user program is located in the user c and user h file in the application project Remote firmware update RFU The remote firmware update RFU uses the power line modem as external communication channel for receiving a new firmware dump The firmware dump is placed in the internal flash memory of the microcontroller Hence the total memory size of the microcontroller must be at least the double of the estimated maximum size of the firmware application in DoclD024383 Rev 1 Ly UM1619 Firmware description this application is set to 60 Kbytes plus 4 Kb of additional memory for a bootloader Figure 21 shows the microcontroller memory organization The bootloader is loaded at startup and checks the active segment containing the actual firmware The implemented mechanism uses three partitions of the microcontroller s Flash memory one containing the bootloader and two containing the actual running firmware active image and the new firmware as soon as a RFU is needed As soon as the firmware transfer is completed a swap command sent from the remote PLM causes the target PLM to check first the integrity of the firmware dump actually a checksum is cal
45. e file is located in the folder C Program Data ST Microelectronics Remote ConsoleM 0 0 0 settings snifflog txt and as soon as the sniffing activity is completed it can be renamed and stored in a different location The GUI will create another sniffer file as soon as the start button is pressed again and the SAVE TO FILE option is checked The snifflog txt file can be read with any text editor and can be automatically erased from the GUI by pressing the DELETE LOG FILE button DoclD024383 Rev 1 23 56 Software GUI description UM1619 24 56 The STOP button stops data acquisition without to losing previously sniffed data appends new data as soon as the start button is pressed again The CLEAR button deletes all the sniffed data from the sniffer main window without deleting the sniffer file Each time a data frame is sniffed the log window is filled with some information concerning the sniffed frame as shown in the Figure 19 Figure 19 Sniffer information B Remote Console for GP ST7540 power line modem module Rel 5 5 STMicroelectronics ABOUT CONFIGURATION DONGLE OPERATIONS PROGRAM SERVICE SNIFFER OPTIONS 00 D 0x00 0x00 0x01 U A b R PNG S 0x00 0x oxo 0 0x00 D 0x00 0x00 0x00 0x01 U A b R 1D 001 FEC L oo o p x CAProgramDatalSTMicroelectronicsiRemote Console s 0 0 o settingslsnifflog txt Log Window E Decimal view COMI4 DONGLE NOT CONNECTED DELETE LOG FILE
46. e global output pins value change bit x 1 out x 1 void DH SetOutputs uint8 t outbuffer General purpose single output pin value change PinVal 1 out value set void DH SetOutput N uint8 t out BitAction PinVal Module system time clock value set and get 3 bytes buffer h m s void DH GetSysTime uint8 t timebuffer bool DH SetSysTime uint8 t timebuffer Delay in milliseconds function main loop blocking void DH Delay ms uinti16 t ms Get the system timestamp uint32 t DH Timestamp void Delay elapsed check function milliseconds max 60 sec comparison bool DH DelayElapsed uint32 t tstp uint16_t ms Timeout management 1 second sec 65536 seconds void DH SetTimeout uint16 t sec bool DH TimeoutElapsed void LED management void DH FlashLED DH LedType t nLTy DH LedAction t nLAct void DH ShowLED DH LedType t nLTy DH LedAction t nLAct DoclD024383 Rev 1 Ly UM1619 Schematic diagrams and bill of material Appendix A Schematic diagrams and bill of material Figure 25 Schematic diagrams 1 of 3 c1 R1 fi 5V VDC OR NM L1 R2 Ili A
47. e module working mode frame data 9 hop level RESPONSE FRAME FOR USER DATA GET COMMAND APP userdata t frame frame source SOURCE PLM Data source PLM frame type APP SERVICE FRAME frame len 22 frame error APP ERROR NONE frame broadcast FALSE frame group sender group Device the one been queried group frame address sender address Device the one been queried address frame data 0 SERVICE PARAM GET Command echo frame data 1 PROG GRP USER DATA Sub command echo frame data 2 USER SETTINGS SIZE 1 sender user data 6 Get module general purpose inputs outputs configuration uint8 t buffer buffer 0 11 buffer 1 APP SERVICE FRAME buffer 2 3 target module group buffer 4 5 6 7 target module address buffer 8 A SERVICE_IO_CONFIG_GET buffer 9 10 CRC16 After a certain delay from the get command acknowledgment the PLM module will send the following frame APP userdata t frame frame source SOURCE PLM Data source PLM frame type APP SERVICE FRAME frame len 2 frame error APP ERROR NONE frame broadcast FALSE frame group sender group Device the one been queried group frame address sender address Device the one been queried address frame data 0 SERVICE IO CONFIG GET Command echo frame data 1 sender configuration value bit x set reset IOx output input 7 Set module general pu
48. em requirements In order to use the GP PLM module demonstration board with a Windows operating System a recent version such as Windows XP or Windows 7 must be installed on the PC The version of the Windows OS installed on your PC may be determined by clicking on the System icon in the control panel 3 2 Software installation To install the PC GUI software Remote Console for GP ST7540 PLM module please download the STEVAL IHPOO5V1 Setup from www st com then follow the steps below The installed folders include the GUI executable file 1 Click the STEVAL IHP005V1_Setup exe icon The following window opens Figure 6 Installation window STEVAL IHPOO5V1 InstallShield Wizard D Welcome to the InstallShield Wizard for STEVAL IHP005V1 The InstallShield Wizard will install STEVAL IHPOOSV1 on pour computer To continue click Next Back Next gt Cancel ky DoclD024383 Rev 1 9 56 Getting started UM1619 2 Inthe customer information window insert the required customer data and click Next Read the license file and click the Yes button if you accept the license agreement Figure 7 License window STEVAL IHPOOSV1 InstallShield Wizard License Agreement Please read the following license agreement carefully SOFTWARE LICENSE AGREEMENT This Software License Agreement Agreement is displayed for You to read prior to downloading and using the
49. ervice data n Service commands list NATIVE SERVICE COMMANDS 0x00 SERVICE SOFTWARE RESET 0x01 SERVICE HARDWARE RESET 0x02 SERVICE PARAM SET 0x03 SERVICE PARAM GET 0x04 SERVICE INPUTS GET 0x05 SERVICE OUTPUTS SET 0x06 SERVICE FW REL GET 0x07 SERVICE PLM CLOCK SET 0x08 SERVICE PLM CLOCK GET 0x09 SERVICE IO CONFIG SET Ox0a SERVICE IO CONFIG GET USER DEFINED SERVICE COMANDS 0x SERVICE USER CMD xx Data source PLM Service frame type Service frame payload length TRUE broadcast FALSE unicast Target device group 2 bytes Target device address 4 bytes Service command Service data 1 Module reset software reset the state machines hardware reset the module using the watchdog uint8 t buffer buffer 0 11 buffer 1 APP SERVICE FRAME buffer 2 3 target module group buffer 4 5 6 7 target module address FOR SOFTWARE RESET buffer 8 SERVICE SOFTWARE RESET FOR HARDWARE RESET buffer 8 SERVICE HARDWARE RESET buffer 9 10 CRC16 DoclD024383 Rev 1 2 UM1619 Firmware description 2 Set module parameters data link stack parameters uint8 t buffer buffer 0 62 buffer 1 APP SERVICE FRAME buffer 2 3 target module group buffer 4 5 6 7 target module address buffer 8 SERVICE PARAM SET buffer 9 PROG GRP LL STACK PARAM STACK PARAMETERS buffer 10 11 PLM MIN SLOT M
50. fer 1 APP ACK FRAME buffer 2 3 target module group buffer 4 5 6 7 target module address buffer 8 APP ftype t ack group type buffer 9 command echo buffer 10 11 CRC16 Error frame payload length 12 ACK frame type Target device group 2 bytes Target device address 4 bytes Frame type to acknowledge Acknowledged command echo CRC 16 From to communication interface PLM SPI USART USB etc APP userdata t frame frame source SOURCE PLM frame type APP ACK FRAME frame len 2 frame broadcast FALSE frame group target module group frame address target module address frame data 0 APP ftype t ack group type frame data 1 command echo Programming Frames Data source PLM ACK frame type ACK frame payload length ACK frames are sent in unicast Target device group 2 bytes Target device address 4 bytes Frame type to acknowledge Acknowledged command echo service programming Programming frames are used to program the PLM module parameters as the static address the AESkey if encryption is used the data link stack working model and to clear or read programming parameters Normally these commands are sent locally to the module from an external device connected to the COMM peripheral SPI USART USB etc From the COMM interface module SPI USART USB etc uint8 t buffer buffer 0 n 11 buffer 1 APP PROGRAMMING FRAME buffer 2 3
51. fer 10 11 CRC16 10 Get module firmware release uint8 t buffer buffer 0 11 buffer 1 APP_SERVICE_FRAME buffer 2 3 target_module group buffer 4 5 6 7 target module address buffer 8 E SERVICE_FW_REL_GET buffer 9 10 CRC16 After a certain delay from the get command acknowledgment the PLM module will send the following frame APP userdata t frame frame source SOURCE PLM Data source PLM frame type APP SERVICE FRAME frame len 5 frame error APP ERROR NONE frame broadcast FALSE frame group sender group Device the one been queried group frame address sender address Device the one been queried address frame data 0 SERVICE FW REL GET Command echo frame data 1 2 target module firmware release Module firmware release x y frame data 3 4 target module stack release Stack firmware release x y 11 Get module time clock value uint8 t buffer buffer 0 11 buffer 1 APP SERVICE FRAME buffer 2 3 target module group buffer 4 5 6 7 target module address buffer 8 A SERVICE_PLM_CLOCK_GET buffer 9 10 CRC16 DoclD024383 Rev 1 Ly UM1619 Firmware description After a certain delay from the get command acknowledgment the PLM module will send the following frame APP userdata t frame frame source SOURCE PLM frame type APP SERVICE FRAME frame len 5 frame error APP ERROR NONE frame broadc
52. gle description panel and in all node list of the GUI e Hardware In the hardware panel there are the connection and disconnection buttons As soon as the CONNECT button is pressed if the module is connected the Programming Mode message will flash at the bottom of the window and the module enters programming mode The disconnect button disconnects the GUI from the COM port e Dongle mode As soon as the module is connected the two buttons RUN and PROGRAM of the dongle mode panel switches the module modes respectively in run mode and in programming mode e Commands In the commands panel the SET button is used to download the chosen configuration described previously while the GET button is used to get the configuration present in the module If a module has never been programmed before the group and the address field are filled with OxFF values and the run button will not have an effect As soon as the module is in run mode the set to remote address button is enabled This button is used to configure a remote node connected via power line working in the same manner as the SET button This procedure has effect only if the node has never been programmed before or if the remote address is set to OxFF both in the group and address box Of course only one module must be present with this address in the same power line otherwise the selected configuration and the chosen new address and group will be assigned to each of these nodes
53. hat data frame This is done by the sniffer device giving an idea of the line noise in the around where the sniffer is placed The FEC algorithm is the same as the one implemented in the module firmware LEN yyy Indicates the user data payload length HOP hhh This is the hop level of the received data frame DoclD024383 Rev 1 25 56 Firmware description UM1619 6 6 1 6 2 26 56 Firmware description Introduction The firmware structure is constituted of several layers each managing a different feature The application layer engine is the general interface between the user program and all the parts of the module It manages the communication ports the module peripherals such as RTC and l Os LEDs and timing management It is also the interface between the PLM stack and the user program The PLM stack itself constituted of several layers implements and manages the power line communication manages the conflicts timing and repetitions the addressing and so on Some features are managed directly by the application engine and are transparent to the user as well as the module programming and configuration which is done by particular programming or service commands managed and acknowledged directly by the application engine the RTC management the module parameter or the firmware update The user application can be interfaced to the application engine by simples APIs used for the data transfer and the module interfacing Th
54. ich is applied to the board using the J1 connector where pin 1 must be connected to the neutral wire and pin 3 to the phase wire refer to Appendix A Figure 2 STEVAL IHP005V1 block diagram 2 BACKUP BATTERY B DoclD024383 Rev 1 Ly UM1619 Hardware description Itis possible to connect the module in a three phase line in case of communication modules are connected in all three phases in this case an external capacitor of 68nF X1 must be connected to any additional phase and then the other side of capacitors together with the common pin 5 of the J1 connector following the schematic shown in the Figure 3 and the 0 Ohm resistor R1 must be mounted Figure 3 Three phase connection EX 68nF X1 PHASER Cy 68nFX1 A QST PHASES i i I T 1 PHASET SS NEUTRAL T1 TER TRAFO1 The GP PLM module is provided with a user interface J4 shown in Figure 4 where connected the SPI interface pins MOSI MISO SCK and NSS are the RS232 interface pins Tx and Rx the USB interface pins D and D and the user programmable general purpose I O pins Note that these pins are directly connected to the microcontroller so ensure that the insulation and protection is appropriate for the use of these pins It is possible to power the PLM using the 3 3 VDC pin 19 12 VDC pin 20 or 22 and GND pins 17 23 20 and 24 of this connector instead of the connector J2 using
55. idiaries ST reserve the right to make changes corrections modifications or improvements to this document and the products and services described herein at any time without notice All ST products are sold pursuant to ST s terms and conditions of sale Purchasers are solely responsible for the choice selection and use of the ST products and services described herein and ST assumes no liability whatsoever relating to the choice selection or use of the ST products and services described herein No license express or implied by estoppel or otherwise to any intellectual property rights is granted under this document If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein UNLESS OTHERWISE SET FORTH IN ST S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION OR INFRINGEMENT OF ANY PATENT COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT ST PRODUCTS ARE NOT AUTHORIZED FOR USE IN WEAPONS NOR
56. in SPITransferTO 01200 msec Fl ul GET SET DEFAULT E J L By default the PLM is configured to work properly Pressing the DEFAULT button the parameter boxes are populated with the default values Modify with care each parameter and press the SET button to send the parameters to the addressed node the selected node is shown in the top of the parameter window The UPDATE FW button implements the remote firmware update feature RFU The RFU allows the user to update the firmware of a module connected remotely in the same power line both in broadcast mode and in unicast mode by selecting a node in the AVAILABLE NODE LIST This feature works only with remote nodes because if the firmware of the module connected to the GUI needs to be updated it is necessary to use the programmer After pressing the UPDATE FW button a open window appears Locate the new firmware release in the Firmware Application standalone folder and then select the bin file A warning message will appear asking to confirm the firmware update operation As soon as the YES button is pressed the download starts The user can follow the status of the update in the log window and in the progress bar that appears immediately after DoclD024383 Rev 1 Ly UM1619 Software GUI description 5 7 Sniffer tab It is possible to use the GUI interface to check the data transiting on the power line This feature is useful when the PLM protoco
57. inimum backoff time buffer 12 13 PLM MAX SLOT Maximum backoff time buffer 14 15 PLM NTW P GLOBAL TX TO Timeout for global tx buffer 16 17 18 19 PLM NTW P BC GLOBAL TX TO Timeout for broadcast frame retransmission buffer 20 21 PLM NTW P ACTIVITY TO Timeout for network buffer 22 23 PLM NTW P WATCHDOG TO Watchdog timeout buffer 24 25 26 27 PLM NTW P DATATRANSFER TO Timeout for completing a transfer from source to target buffer 28 29 PLM NTW P BANDINUSE TO Timeout for the band in use signal buffer 30 31 32 33 PLM NTW P FRAME TX TO Timeout for sending a frame through SPI buffer 34 35 36 37 PLM NTW P BCAST TX TO Timeout for repeat a broadcast frame buffer 38 39 40 41 PLM NTW P ACK RX TO Timeout for receiving an ACK frame buffer 42 43 44 45 PLM NTW P bACK RX TO Timeout for receiving a bACK frame buffer 46 47 48 49 PLM NTW P FRM RX TO Timeout for frame receptions buffer 50 51 52 53 PLM NTW P NDX TO Minimum delay before any buffer 54 55 PLM LL MAX ATTEMPT Max attempts if no activity is detected buffer 56 57 PLM LL MAX RPT ATTEMPT Max repetition attempts for processed ID buffer 58 59 DEVICE TIME SYNC Timeclock update synchro frame interval buffer 60 61 CRC16 3 Set module parameters programming module parameters uint8 t buffer IF AES buffer 0 IF AES buffer 0 buffer 1 buffer 2 3 buffer 4 5 buffer 8 ENCRY
58. l parameters are tuned By sniffing the transiting data it is easy to determine the overall performance of the network Figure 18 GUI sniffer tab Bl Remote Console for GP ST7540 power line modem module Rel 5 5 STMicroelectronics mmm ABOUT CONFIGURATION DONGLE OPERATIONS PROGRAM SERVICE SNIFFER OPTIONS START STOP DELETE LOG FILE rogramData STMicroelectronicsiRemote Consolel o o olsettingsisnifflog txt Save to fle Y Log Window Decimal view CLEAR LOG COMI4 DONGLE NOT CONNECTED Before using the sniffer feature it is necessary to download into a GP PLM module the sniffer binary code provided in the setup packet and located in the folder Firmware Sniffer Open the IAR Embedded Workbench IDE for STM32 microcontrollers Rel 6 3 or a more recent release click FilelOpenWWorkspace and select the workspace Flasher eww Connect the Jlink Jtrace programmer into the programming connector of the module and press CTRL D or click Project Download amp Debug option Note that as soon as the sniffer bin file is downloaded in the module it will work only as a sniffer Connect the sniffer module to an available COM port of the PC open the GUI and select the SNIFFER tab Click on the button START to start the data sniffing Normally the data sniffed in the power line is also saved in a snifflog file This feature can be disabled just unchecking the SAVE TO FILE checkbox Th
59. lobal tx Timeout for broadcast frame retransmission Timeout for network Watchdog timeout Timeout for completing a transfer from source to target Timeout for the band in use signal for sending a frame through SPI for repeat a broadcast frame for receiving an ACK frame for receiving a bACK frame for frame receptions delay before any Max attempts if no activity is detected Max repetition attempts for processed ID Timeclock update synchro frame interval 4 Set module parameters programming module parameters uint8_t buffer IF AES ENCRYPTION IS ENABLED buffer 0 36 IF AES ENCRYPTION IS DISABLED buffer 0 20 buffer 1 APP_PROGRAMMING_FRAME buffer 2 3 target_module group buffer 4 5 6 7 target_module address buffer 8 PROG_CMD_SET_DATA DoclD024383 Rev 1 37 56 Firmware description UM1619 buffer 9 PROG GRP LL STACK PARAM buffer 10 11 new group buffer 12 13 14 15 new address buffer 16 uint8 t module working mode buffer 17 hop level IF AES ENCRYPTION IS ENABLED buffer 18 gt 33 AES key buffer AES Key 0 to 15 16 bytes buffer 34 35 CRC16 IF AES ENCRYPTION IS DISABLED buffer 18 19 CRC16 module working mode b7 b6 b5 b4 b3 b2 b1 b0 d d 1 Reserved 1 ACK frame requested 0 ACK frame not requested t 1 bACK frame requested 0 bACK frame not requested
60. mote Console 5 5 ky DoclD024383 Rev 1 11 56 Hardware installation UM1619 4 12 56 Hardware installation Connect a regulated dual DC power supply to the power connector J2 or use the power source pins of connector J4 as described previously and power the module In order to download the firmware plug the programmer adapter Figure 5 into the programming connector J3 and the IAR JLink programmer in the JTAG connector of the adapter Refer to Section 6 Firmware description for the firmware download procedure As soon as the application is launched the LEDs should quickly switch on and off sequentially and at the end the orange LED should be switched on indicating that the module needs to be configured In order to configure the module connect an RS232 DB9 female connector to one of the available PC COM ports and the J4 connector as indicated in Figure 10 Figure 10 RS232 connection J4 CON24A DB9 FEMALE RS232 CONNECTOR Run the Remote Console for GP ST7540 GUI Click the OPTIONS tab and select the correct COM port from the list shown in the COM port option box Figure 11 In the CONFIGURATION tab press the CONNECT button The orange LED of the module will flash twice and will stay switched on DoclD024383 Rev 1 Ly UM1619 Hardware installation Figure 11 GUI options tab B Remote Console for GP ST7540 power line modem module Rel 5 5 STMicroelectronics
61. n layer engine is the general interface between the user program and all the parts of the module It manages the communication ports the module peripherals such as SPI SCI RTC I Os LEDs and timing management It is also the interface between the PLM stack and the user program The PLM stack itself made up of several layers implements and manages the power line communication manages the conflicts timing and repetitions the addressing and so on Please refer to UM1573 for details on the firmware stack driver Some features are managed directly by the application engine and are transparent to the user such as the RTC management or the module parameter update as well as the module programming and configuration which is done by particular programming or service commands managed and acknowledged directly by the application engine Even the remote firmware update is managed by the application engine and allows the firmware module being update remotely by power line module The user layer is fully customizable by using some easy to use APIs available for user application implementation User data can be easily addressed to the PLM or to the other communication interface by simply changing the destination channel in the user data structure The STEVAL IHPOO5V1 is powered by a dual regulated DC power source 12 VDC pin 1 and 3 3 VDC pin 2 from the power supply connector J2 Pin 3 is the ground The communication is done via power line wh
62. om to communication interface PLM SPI USART USB etc APP userdata t frame frame frame frame frame frame frame frame Source SOURCE PLM type APP ERROR FRAME len 2 broadcast FALSE group target module group address target module address data 0 1 user error code Error code list 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d Ox0e APP ERROR APP ERROR GENERIC APP ERROR COMM TIMEOUT APP ERROR SERVICE GRP UNKNOWN APP ERROR SERVICE CMD ERROR APP ERROR COMMUNICATION APP ERROR ISOLATED NODE APP ERROR HARDWARE APP ERROR WRONG PROG COMMAND APP ERROR WRONG PROG GROUP APP ERROR DEVICE BLANK APP ERROR RTC ERROR APP ERROR WATCHDOG DISABLED APP ERROR NODE INIT FAILED APP ERROR RTC DISABLED DoclD024383 Rev 1 Data source PLM Error frame type Error frame payload length Error frames are sent in unicast Target device group Target device address User 2 bytes 4 bytes error code 2 bytes 35 56 Firmware description UM1619 6 6 4 6 6 5 36 56 Acknowledgment Frames These frames are particular data frames sent to an external device connected to the COMM module not allowed to be sent via PLM They are used by the GUI interface to acknowledge the commands sent to the module From the COMM interface module SPI USART USB etc uint8 t buffer buffer 0 12 buf
63. plements a bridge between the power line communication and the COM port each data received from the COM port addressed to another PLM module is sent via PLM and vice versa each data received from PLM is sent back to the COM port It is necessary that the user program does not stop the core operations looping instructions without calling the application engine All the firmware configurations are contained in the interfaceconfig h file Here the user can define the default working mode and all the default values of the module parameters The following paragraphs list all the data types and the APIs used in the application engine that can be modified by the user if different needs arise DoclD024383 Rev 1 31 56 Firmware description UM1619 6 5 32 56 Firmware data types The data type found in the application h module are listed below USER FRAME STRUCTURE typedef struct APP_source_t source APP_ftype_t type bool broadcast ul6 group u32 address u8 len u8 data USER_PAYLOAD SIZE MAX PAYLOAD SIZE 100 bytes APP_ERROR_t error JAPP_userdata_t PERIPHERAL SOURCE TYPE typedef enum SOURCE_COMM SOURCE_USB SOURCE_SPI SOURCE_PLM APP source t APPLICATION FRAME TYPE typedef enum APP_DATA_FRAME APP_SERVICE_FRAME APP_PING_FRAME APP_ERROR_FRAME APP_PROGRAMMING_FRAME APP_ACK_FRAME lt gt MAX ALLOWED TYPE RANGE JAPP_ftype t APPLICATION ERROR
64. rpose inputs outputs configuration uint8 t buffer buffer 0 12 buffer 1 APP SERVICE FRAME buffer 2 l target module group buffer 4 6 7 target module address c SERVICE IO CONFIG SET MULA target configuration value bit x 1 IOx output bit x 0 IOx input buffer 10 11 CRC16 8 Get module general purpose inputs value uint8 t buffer buffer 0 11 buffer 1 APP SERVICE FRAME buffer 2 3 target module group DoclD024383 Rev 1 43 56 Firmware description UM1619 44 56 buffer 4 5 6 7 target module address buffer 8 SERVICE INPUTS GET buffer 9 10 CRC16 After a certain delay from the get command acknowledgment the PLM module will send the following frame APP userdata t frame frame source SOURCE PLM Data source PLM frame type APP SERVICE FRAME frame len 2 frame error APP ERROR NONE frame broadcast FALSE frame group sender group Device the one been queried group frame address sender address Device the one been queried address frame data 0 SERVICE INPUTS GET Command echo frame data 1 sender inputs value bit x set reset input x set reset 9 Set module general purpose outputs value uint8 t buffer buffer 0 12 buffer 1 APP SERVICE FRAME buffer 2 a target_module group buffer 4 6 7 target module address cd SERVICE OUTPUTS SET eU en target outputs value buf
65. scribed in the dedicated paragraph As soon a bootloader has been installed in the module it is possible to remotely via power line update the firmware using the RFU feature Each new firmware version has to be programmed using the workspace Firmware Application standalone WARMWProject eww The bin file produced by this workspace that is located in the folder Firmware Application standalone EWARMIPLM_HID_STANDALONE bin can be directly loaded using the GUI interface The difference of this application with the one contained in the workspace with the bootloader is mainly in the stm32f10x flash icf linker file and some workspace parameters that are not used in the application without the bootloader as multiple build simultaneous debug mode etc DoclD024383 Rev 1 29 56 Firmware description UM1619 6 4 30 56 The setup folder contains also the Firmware Bootloader folder where inside there is the bootloader firmware and the folder Firmware Sniffer which contains the sniffer workspace to download in a PLM module useful if the data sniffing feature of the interface is used In this case the PLM module will work only as a sniffer Firmware description The structure of the workspace is divided in different sections as shown in the Figure 24 The user program must be developed in the user c and user h files Figure 24 Workspace structure Files A La O Project GP PLM ST7540 tm3 2t10x flesh icf stm3
66. target module group buffer 4 5 6 7 target module address buffer 8 APP PROG CMD t command buffer 9 9 n 1 programming data n NONU MR 9 n 1 CRC16 Programming frame payload length n 11 Programming frame type Target device group 2 bytes Target device address 4 bytes Programming command Programming data CRC 16 From to communication interface PLM SPI USART USB etc APP userdata t frame frame source SOURCE PLM frame type APP PROGRAMMING FRAME frame len n 1 frame broadcast TRUE FALSE frame group target module group frame address target module address frame data 0 APP PROG CMD t command frame data n programming data n Programming commands list 0x01 PROG CMD ENTER PROG MODE DoclD024383 Rev 1 Data source PLM Programming frame type Programming frame payload length TRUE broadcast FALSE unicast Programming device group 2 bytes Programming device address 4 bytes Programming command Programming data 2 UM1619 Firmware description 0x02 PROG CMD EXIT PROG MODE 0x03 PROG CMD SET DATA 0x04 PROG CMD GET DATA 0x05 PROG CMD CLEAR DATA 0x06 PROG CMD DEVICE BLANK 1 Enter in programming mode uint8 t buffer buffer 0 11 buffer 1 APP PROGRAMMING FRAME buffer 2 3 target module group buffer 4 5 6 7 target module address buffer 8 CMD ENTER PROG MODE buffer 9 10 2 Exit from programming mode
67. ting the target node in the AVAILABLE NODE LIST Both the releases are then shown in the command window It is possible to modify some parameters that fine tune the power line modem communication protocol This operation can affect the overall communication performance so it must be done with great attention Please refer to UM1573 for a detailed description of the communication protocol parameters Select the node for which the parameters should be checked or modified then press the PLM PARAM button A windows prompting to insert a password appears Insert the password syslab and then press the Enter key A list of the available communication parameters appears at the right side of the GUI overlapping the available node list with three buttons at the bottom side Figure 17 In order to know the preset PLM communication parameters press the GET button DoclD024383 Rev 1 21 56 Software GUI description UM1619 22 56 Figure 17 PLM communication parameters window 3RAM SERVICE SNIFFER OPTIONS NODE ADDRESS 0x00 0x00 0x00 0x00 0x00 0x00 Backoff MIN 00300 usec ACK Rx TO 00250 msec Backoff MAX 00050 msec bACK Rx TO 00250 msec Global Tx TO 00010 sec Frame Rx TO 00000 sec gt BcastTxBUTO 00015 sec TxDelMIN 00010 msec M Broadcast Tx 00012 sec Inact Att pt 00005 n wo WatchdesTxTO 00060 sec Repet Att pt 00000 n Datatransfer TO 00003 sec NTW Inact 00002 sec j BU Stucked TO 00000 usec Time sync 00000 m
68. xC181 0x0140 0xC301 0x0780 0xC741 0x0500 0x0D80 0xCD41 OxOFO00 OxCB81 0x0B40 0xC901 0x1980 0xD941 0x1B00 OxDF81 0x1F40 OxDDO1 0xD581 0x1540 OxD701 0x1380 0xD341 0x1100 0x3180 0xF141 0x3300 OxF781 0x3740 OxF501 OxFD81 0x3D40 OxFFO1 0x3B80 OxFB41 0x3900 0xE981 0x2940 OXEBO1 0x2F80 OxEF41 0x2D00 0x2580 0xE541 0x2700 0xE381 0x2340 OxE101 0x6180 0xA141 0x6300 0xA781 0x6740 OxA501 OxAD81 0x6D40 OxAFO1 0x6B80 OxAB41 0x6900 0xB981 0x7940 OxBBO1 0x7F80 OxBF41 0x7D00 0x7580 0xB541 0x7700 0xB381 0x7340 OxB101 0x9181 0x5140 0x9301 0x5780 0x9741 0x5500 0x5D80 0x9D41 Ox5F00 0x9B81 0x5B40 0x9901 0x4980 0x8941 0x4B00 0x8F81 0x4F40 0x8D01 0x8581 0x4540 0x8701 0x4380 0x8341 0x4100 CRC function 0x03C0 0xC5C OxCFC 0x09CO OxDBC Ox1DCO 0x17C0 OxD1C OxF3C 0x35C0 Ox3FCO OxF9C Ox2BCO OxEDC OxE7C 0x21C0 OxA3C 0x65CO0 Ox6FCO OxA9C 0x7BCO OxBDC OxB7C 0x71CO0 0x53C0 0x95C Ox9FC Ox59C0 0x8BC Ox4DCO 0x47C0 0x81C D D 1 D D D r D D D D D D D D 1 0x0280 0xC48 OxCE8 0x0880 OxDA8 0x1C80 0x1680 OxD08 OxF28 0x3480 0x3E80 0xF88 0x2A80 OxEC8 OxE68 0x2080 0xA28 0x6480 0x6E80 0xA88 0x7A80 OxBC8 OxB68 0x7080 0x5280 0x948 Ox9E8 0x5880 0x8A8 0x4C80 0x4680 0x808 D 0xC241 0x0440 Ox0E40 0xC841 Ox

Download Pdf Manuals

image

Related Search

Related Contents

Instruction Manual  manual_escora-texto novo.indd    Instruction Manual DOV 707 H - OVD 706 H - RDI 705 H  取扱説明書(PDF/239KB)    GN 6210  東日本大震災で露呈した エコキュート不良工事の実態  CMM-ML1A - pb ピービー  Vdpdp134 GB-NL-FR-ES-D  

Copyright © All rights reserved.
Failed to retrieve file