Home
UM1818 User manual - STMicroelectronics
Contents
1. 8 4 1 Introduction 8 4 2 Remote firmware update RFU 8 4 3 Firmware download 10 4 4 Firmware 11 4 5 Firmware data 1 13 4 6 Firmware frame 15 4 6 1 Communication frames types 15 4 6 2 Ping amnes s vun ea ex EEA NR CHEAP 16 4 6 3 Error frames escasas irem V dee ege P d ra ce dedi ae 16 4 6 4 Service Tralmies dad ge o x IARE RR e 17 Appendix 24 Appendix Schematic diagrams and bill of material 35 B 1 Schematic diagrams essa ese se 35 2 37 Appendix CRC 16 calculation 43 5 MUTTER 45 6 Revision history 46 2 47 DoclD026935 Rev 2 0 1818 Features Features e Configurable PSK power line modem interface with an embedded firmware stack for a complete power line communication management e 8 user configurable general purpose input output pin
2. Schematic diagrams and bill of material UM1818 Table 1 Bill of material continued Part MI A type code Design Footprint Description Qty Manufact code Part number code 2 Inductor 10u 2n L4 E 2 0A 1 74454010 74454010 74454010 100 Inductor B82462A4 15 IND 6x6 100u 350mA 1 104K 495 8032 HSM LED Bicolor F LD1 LD2 2 Verde Rosso 2 pr 486 0430 C155 SMD N channel Q1 SOT23 Trench MOS 1 2N7002 112 5526 02 7 NPN 45 V 100 mA 2 0 icc Q2 SOT23A general 1 BC847 445 2023 purpose transistors R2 R7 R8 R9 016 R10 R12 Resistor 10K CRG0402 10 7 R13 R14 0 0625W 1 F10K 66778848 R17 R20 R38 Resistor R4 R6 CRG0603 560R R39 R40 0603S_R 4 F560R 213 2238 Resistor 330R R5 R16 0402 R 330R 2 pua 667 8646 0 0625W Resistor 1M CRG0402 1M R11 0402 R 0 0625W 1 F1MO 667 9065 Resistor 130R R15 0402 R 130R 1 667 8618 0 0625W CRCW12 33K R18 R25 2065 Pesistor33K 3 6 679 2055 R26 0 33W 1 KEA Resistor 22K CRG0402 22K R19 R29 0402 R 0 0625W 1 2 22 667 8892 Resistor 33K CRG0402 33K R21 R30 0402 R 0 0625W 2 667 8933 Resistor MIO22 08056 R 1 04908081 223 0691 0 125W 196 40 47 00 10026935 Rev 2 0 1818 Schematic diagrams and bill of material Table 1 Bill of material continued Part M
3. gaksRAc 264 4595 7 10 0603 1 C36 06035 C Capacitor 1 83 5 ir ind SN 766 5392 18n 50V TU 38 47 DoclD026935 Rev 2 Ly 0 1818 Schematic diagrams and bill of material Table 1 Bill of material continued Part MI Order type code Design Footprint Description Qty Manufact coda Part number code 2 STT DIODO H1LO Di 00214 FAST 1 om 8165505 STTH1LOGA 485 8500 6A RECOVERY LOW DROP STP POWER 5113 2 SMAPIO 2 STPSILS 485 8061 5 581130 4976577 RECTIFIER 1A 30V 0 3V SM6 TRANSIL T15C 4 SMB Diode 15V 1 2 436 9757 600W Diode TVS SMA Bi J5 0 D5 00214 Directional 1 764 5568 SMAJ5 0CA TR 5V 400W 00214 Connector 9012 Male 90121 pe J2 0765 pitch SIL RA 0108 FKV12LN 8312 J8 J4 STRIP 2 1 MIRROR BLM EMI Filter 11 08055 100 1 BLM21PG 6300 3005 1 MHz 0805 SN1 BLM EMI Filter 21P BLM21PG G331 L2 0805S rd 1 331SN1 724 1545 SN1 BLM EMI Filter e L1 0805S 30R 100 1 BLM21PG 6300 3005 1 MHz 0805 SN1 BLM EMI Filter 21P BLM21PG G331 L2 0805S m 1 331SN1 724 1545 SN1 Pen EMI Filter 1016 BLM18AG G102 0 L3 0603S 100MHz 1 102SN1D 230 3783 SN1 400mA D DoclD026935 Rev 2 39 47
4. epplication c Ha comm c i D dongle c Ha Application Engine Ha D stm32tl Ox_tte c D 1 8 wrepper c 577580 Sernal20 c 15175860 BSP Board Support Package EAAS omi pepe i CISTM32F10x StdPeriph Driver Ha misc c i Ha stm32f10x_bkp c a stm32f1 0x exti c stm32f10x flash c i i Space 5 32 Standard library Ha stm32f10x i2c c Ha stm32f1 0 iwdg c stm32t10x pwr c i Ha stm32f10x_rec c i stm32f10x spi c E stm32f1 0 tim c D stm32fl 0x usart c i Configuration layer i Ha La 3210 _ ExSpjOupu 7 77777777777 At this level all the communication APIs and all the APIs for the application engine interface are available In the main file the following code is implemented for running the state machine engines while 1 DL FSM PLM Main Loop APP StackUpdate USART State machine USER Program PLM State machine ifdef USE STM32 Window Watchdog IWDG ReloadCounter endif ifdef KEEP ALIVE PLM Keep Alive systems Check KA Timeout endif After the initialization the infinite loop calls three main functions the DL FSM USER_Program and the APP_StackUpdate routine 4 DoclD026935 Rev 2 0 1818 Firmware description 4 5 The DL FSM is the PLM stack main loop this manage t
5. 1015 1 apacitor 0402YG1 16V 6 C19 C20 0402 C 100n 16V 17 047 2 698 3190 C24 C28 0402 C29 C31 C37 C38 C39 Ceramic 10p MIO20 Capacitor 04025A10 50V 7 C3 C6 0402 C 10p 50V 2 ODAT2A 698 3065 7 5 ky DoclD026935 Rev 2 37 47 Schematic diagrams and bill of material UM1818 Table 1 Bill of material continued Part MI Order type code Design Footprint Description Qty Manufact code Part number code 2 22p Ceramic GRM1555 50V C5 C9 0402 Capacitor 2 C1H220J 624 2187 22 50V Z01D Ceramic C8 C11 GRM21B 10u MIO13 08058 Capacitor 6 1 1 723 6039 16V 6 Gat 10 16 KE15L 5 10 C16 08058 C 1 R61C475 723 6041 16V 4u7 16V KASSE 0805 15 Ceramic 100p C17 C22 Capacitor 04023A10 25V c25 c34 0402 100 2 4 1 2 698 3055 0402 GRM1555 27 26 0402 c Capacitor 4 C1H270J 723 5402 50V 27p 50V 0402 27 0402 1 C1H4R7B 723 5436 50V 4 7p 50V 0402 10 S MSA 500 C30 1210 758 3486 1210 7 Metallized 220n Polyester x2 RADX2 Film ECQU2A2 250V 32 152 Dielectric 1 24ML 1198297 220 250 pitch 15mm Ceramic in Capacitor 1n 04025C10 EON C33 0402 C akaroa 698 3131 10 10 Capacitor 0603 1 C35 0603S_C
6. 2 7 source module address 8 0x67 9 0x06 fi 10 input_voltage_h 11 input voltage 1 12 13 16 BOARD TEMPERATURE 0 14 1 APP DATA FRAME 1 APP DATA FRAME 8 0x67 9 0x07 10 board temperature h 11 board temperature 1 12 13 6 OF POWER ON 0 14 1 2 7 source module address 8 0x67 9 0x08 10 power on n 11 power on n 1 12 13 6 DoclD026935 Rev 2 Data frame payload length Data frame type Source device address Response 46 command 6 bytes Get command ascii value High byte of power supply voltage Low byte of power supply voltage CRC 16 Data frame payload length Data frame type Source device address Response 47 command 6 bytes Get command ascii value C C High byte of board temperature Low byte of board temperature CRC 16 Data frame payload length Data frame type Source device address Response 48 command 6 bytes Get command ascii value High byte of number of lamp power on Low byte of number of lamp power on CRC 16 4 0 1818 HID commands GET buffer buffer buffer buffer buffer buffer buffer buffer GET buffer buffer buffer buffer 8 buffer buffer 1 buffer 1 buffer 1 buffer 1 buffer 1
7. 0 1818 Description Figure 3 Three phase connection 220nFX1 PHASER i 220nFX1 PHASES 1 PHASET 7 L1 10uH C2 220nF X1 D1 NEUTRAL SM6T15CA T1 TRAFO 1 1 The GP PLM module is provided of a user interface J3 shown in Figure 4 where there are connected the SPI interface pins MOSI MISO SCK and NSS the RS232 interface pins Tx and Rx the USB interface pins D and D and the user programmable general purpose pins Remark that those pins are directly connected to the microcontroller so be careful to provide the correct insulation and protection depending on the use those pins are addressed It is possible to power the PLM using the 3 3VDC pin 19 12VDC 20 or 22 and GND pins 17 23 20 and 24 of this connector instead of the connector J2 using only a single connector for power supply and control signals A lithium backup battery mounted on the board and 32 KHz quartz allows the use of the full functionality of the internal RTC of the microcontroller allowing precise time based operations Figure 4 User interface connector PLM GPIO7 SPI MOSI GPIO6 SPI GPIO5 SPI SCK PLM GPIO4 SPI NSS PLM GPIO3 USART PLM GPIO2 USART TX GPIO4 USB DP PLM GPIOO USB DM vcc VDDIO GSPG23072015DI1045 A two color LED allows the signaling the board operations data tra
8. TAE 0402 0805 x24 72 GND_A 100n 16 10 16 REsEN _ 790 EN an 27 VDD REG 8 5 VBDIO VDD 11 REG 26 7 cg VoD 4 PA OUT gt 55 LOUT qq 10K 100n 16 2 8 XN i MSS 21 30081 c12 ci 0402 0402 2 e pp 49 0805 100n 16V 10u 16V F4 a o L 3 9286 9 0402 0805 gt 8 SER GND_A m VDD PLL vcc Transceiver Module C16 C19 C17 c20 18 4u7 16V 100n 16V 100p 25V 100n 16V 10 16V 0805 0402 0402 0402 0805 GND A ees E l C21 C24 c2 R16 10u 16V 100n 16V 100p 26V 330R 0805 0402 0402 0402 R17 GNDA 10K LN 0402 1 CL L 2 Q1 2N7002 Current Limit Setting i GSPG25092014D11530 DoclD026935 Rev 2 35 47 Schematic diagrams and bill of material UM1818 Figure 13 Schematic diagram 2 of 5 LD2 VDDIO 839 5605 0603 VDDIO R40 560R 0603 Host Catroller R14 10K HSMF C155 U1 0402 LEDSMD LED RED 18 10 LED GREEN 19 11 BOOT1 20 E XBOOTI par 1 PLC RXD Tx TDO pag PLC _ uP Rx x
9. buffer 0 12 Frame payload length buffer 1 APP ACK FRAME ACK frame type buffer 2 7 target module address Target device address 6 bytes buffer 8 APP PING FRAME Ping frame type buffer 9 command echo Echo buffer 10 11 CRC16 CRC 16 4 6 3 Error frames Can be considered as data frames they are user error frames from user application level addressed to a target PLM module From to communication interface PLM USART buffer 0 12 Error frame payload length buffer 1 APP ERROR FRAME Target device address 6 bytes buffer 2 7 target module address Ping frame type buffer 8 9 user error code Echo buffer 10 11 CRC16 CRC 16 Error code list 0x0000 APP ERROR NONE 0x0001 APP ERROR GENERIC 0x0002 APP ERROR COMM TIMEOUT 0x0003 APP ERROR SERVICE GRP UNKNOWN 0x0004 APP ERROR SERVICE CMD ERROR 0x0005 APP ERROR COMMUNICATION 0x0006 APP ERROR ISOLATED NODE 0x0007 APP ERROR HARDWARE 0 0008 APP ERROR WRONG PROG COMMAND 0 0009 APP ERROR WRONG PROG GROUP 0 000 APP ERROR DEVICE BLANK 0 000 APP ERROR ERROR 0 000 APP ERROR WATCHDOG DISABLED 0 0004 APP ERROR NODE INIT FAILED 0x000e APP ERROR RTC DISABLED 3 16 47 DoclD026935 Rev 2 0 1818 Firmware description 4 6 4 buffer buffer buffer 2 buffer buffer buffer buffer buffer buffer buffer buffer buffer 4 user er
10. v UM1818 y umm User manual Street lighting power line modem evaluation board based on 517580 PLM 5 32 microcontroller Introduction This document explains how to use and set up the firmware and the software designed for the STEVAL IHP007V1 board and all the necessary setup for using the hardware The system is based to the ST7580 data link protocol firmware data link protocol described in the application note AN4018 ST7580 data link protocol firmware is organized in a layer structure A dedicated layer allows the user to design its own application interfacing to the evaluation board features with very simple and easy to use APIs Dedicated software graphic user interface GUI allows the user to use all the embedded features interfacing the PLM evaluation board with the PC via an RS232 communication port This firmware is developed using STM32F1 0x standard peripherals library Rel 3 5 0 and IAR Embedded Workbench IDE for STM32 microcontrollers Rel 6 50x The STEVAL IHP007V1 hardware evaluation board embeds an ARM 32 bit Cortex M3 core based STM32F103xB and an ST7580 PSK multi mode power line networking system on chip Figure 1 STEVAL IHP007V1 evaluation board July 2015 DoclD026935 Rev 2 1 47 www st com Contents UM1818 Contents 1 Features M 3 2 DESCHPIION MOT 4 3 Hardware installation 7 4 Firmware description
11. 0 10 HID response error Ox11 HID command unknown 0x12 HID board response timeout 0x13 HID packet delivery impossible 34 47 DoclD026935 Rev 2 Error frame payload length Error frame type Target device address 6 bytes HID board error code 2 bytes CRC 16 3 0 1818 Schematic diagrams and bill of material Appendix Schematic diagrams and bill of material B 1 Schematic diagrams Figure 12 Schematic diagram 1 of 5 VDDIO VDDIO VDDIO okolo alr hohe R2 2 R1 oR 10K 4x 10K 4 x 10K 0402 0402 16 4 CAT16 J4 R3 QR 0402 Nes s LD1 T o VDDIO gu PLRX ON 560R VDDIO VDDIO 100n 16V 0608 042 PL TX 560R 02 0603 R8 R38 1o t f I N ST7580 WV 10K 210 VFQFFNA8 VDDIO 0402 0402 HSMF C155 888284 58889 LEDSMD o uuSg uuuCcmm 0402 gt gt gt gt gt Ix 1 Fey uL CL SEL 100n 16V VDDIO PLERXD 2 p 88 is m 139 d c 3 voDio 3S R10 100 46V 5 ern oo 3 27 01 10K 0402 26 IMS K C7 C8 0402 7
12. 1 624 7687 1 2 6 2 ESD Protection MC Crystal 306 X1 TPSM32A 32 768 KHz 1 MC 306 667 6117 rox m SDL x2 2 Crystal 30 50 693 8869 F 08 8 000 MHz 0 20 40 85 18 pF ATF T604 03 Signal T60403 T60403 K502 ZT1 Transformer 1 K5024 K5024 4 1 1 044 X044 X044 42 47 0026935 Rev 2 ky 0 1818 CRC 16 calculation Appendix CRC 16 calculation 3 16 is based on the X16 X15 X2 1 polynomial Used CRC 16 table const uintl6 t TableCRC16 256 0 0000 0 0 1 0 601 0 06 0 0 01 0 0 0 0 0 00 0 1 OxD801 0 18 0 0 1 00 OxDEC1 0 1400 OxD4Cl1 0 0201 0 12 0 OxFOO1 0 30 0 0x3600 6 1 0 3 00 OxFCCI1 OxFAO1 0x3ACO 0x2800 OxES8CI1 OxEEO1 Ox2ECO 0 401 0 24 0 0x2200 0 201 0 001 0 60 0 0x6600 6 1 0 6 00 OxACCI1 OXAA01 0 6 0x7800 0 8 1 OxBEO1 Ox7ECO OxB401 0 74 0 0x7200 0 201 0 5000 0 90 1 0 9601 0 56 0 0 9 01 0 5 0 0 5 00 0 9 1 0 8801 0 48 0 0 4 00 0 8 1 0 4400 0 84 1 0 8201 0 42 0 function 0 181 0 0780 OxOD80 OxCB81 0x1980 OxDF81 OxD581 0x1380 0x3180 OxF781 OxFD81 0x3B80 OxE981 0 2 80 0 2580 0 81 0 6180 0 781 OxAD81 Ox6B80 OxB981 Ox7F80 0x7580 OxB381 0x9181 0x5780 Ox5D80 Ox9B81 0x49
13. buffer 1 buffer 1 buffer 1 buffer buffer buffer buffer 4 LAMP LIFETIME Hours 0 14 Data frame payload length 1 APP DATA FRAME Data frame type 2 7 source module address Source device address 6 bytes 8 0x67 Get command g ascii value 9 0x09 Response to g9 command 10 lamp lifetime h High byte of lamp lifetime hours 11 lamp lifetime 1 Low byte of lamp lifetime hours 12 13 CRC16 CRC 16 LL PARAMETERS 0 36 Data frame payload length 1 APP DATA FRAME Data frame type 2 7 source module address Source device address 6 bytes 8 0x67 Get command g ascii value 9 0x0a Response to 410 command 10 hardware release xx Hardware release xx yy xx yy bcd format 11 hardware release yy Hardware release xx yy xx yy bcd format 12 bus voltage h High byte of bus voltage before the failure 13 bus voltage 1 Low byte of bus voltage before the failure 14 lamp voltage h High byte of lamp voltage before the failure 15 lamp voltage 1 Low byte of lamp voltage before the failure 16 hardware status h High byte of hardware status before the failure 17 hardware status 1 Low byte of hardware status before the failure 18 lamp power h High byte of lamp power 19 lamp power 1 Low byte of lamp power 20 last hardware status h High byte of hardware status befor
14. 8 0 67 9 0x00 10 hardware release xx 11 hardware release yy 12 13 CRC16 BUS VOLTAGE 0 14 1 APP DATA FRAME 2 7 source module address 8 0 67 9 0x02 10 lamp_voltage_h 11 lamp voltage 1 12 13 CRC16 HARDWARE STATUS 0 14 1 APP DATA FRAME 2 7 source module address 8 0x67 9 0x03 10 hardware status h JA 11 hardware status 1 12 13 6 DoclD026935 Rev 2 Data frame payload length Data frame type Source device address 6 bytes Get command g ascii value Response to 40 command Hardware release xx yy xx yy bcd format Hardware release xx yy xx yy bcd format CRC 16 Data frame payload length Data frame type Source device address 6 bytes Get command g ascii value Response to g2 command High byte of lamp voltage Low byte of lamp voltage CRC 16 Data frame payload length Data frame type Source device address 6 bytes Get command g ascii value Response to g3 command High byte of hardware status Low byte of hardware status CRC 16 3 0 1818 HID commands hardware status value 0x00 IDLE 0 01 0 02 0 03 STARTUP 0 04 0 05 WARMUP 0 06 RUN 0 07 WAIT 0x08 FAILURE GET LAMP POWER buffer 0 14 Data frame payload length buffer 1 APP DATA FRAME Data frame type buffer 2 7 source
15. DATA FRAME Data frame type buffer 9 2 0x73 Command char s buffer 10 11 CRC16 CRC 16 00 10026935 Rev 2 25 47 HID commands buffer buffer buffer buffer buffer buffer UM1818 Get HID parameter From the COMM interface USART Source Concentrator and To the COMM interface USART Destination HID ballast 0 12 Data frame payload length 1 APP DATA FRAME Data frame type 2 7 target module address Target device address 6 bytes 8 0x67 command set char g 9 param to get HID Param Value 10 11 CRC16 CRC 16 param to get value 0x00 HARDWARE VERSION 0 01 BUS VOLTAGE 0x02 LAMP VOLTAGE 0x03 HARDWARE STATUS 0x04 LAMP POWER 0x05 LAST FAILURE 0x06 POWER SUPPLY VOLTAGE 0x07 BOARD TEMPERATURE 0x08 9 OF POWER ON 0x09 LAMP LIFETIME Hours 0 0 GET ALL PARAMETERS From the COMM interface USART Destination HID Ballast GET HARDWARE VERSION buffer 0 5 Data frame payload length buffer 1 0x67 Get command g ascii value buffer 2 0x00 HARDWARE VERSION buffer 3 hardware release xx Hardware release xx yy xx yy bcd format buffer 4 hardware release yy Hardware release xx yy xx yy bcd format 26 47 00 10026935 Rev 2 0 1818 HID commands GET BUS VOLTAGE buffer 0 buffer 1 buffer 2 buffer 3 buffer 4 5 0x67 0x01 bus_voltage_h
16. Data Link layer stack parameters User program SERVICE SOFTWARE RESET 0x00 SERVICE HARDWARE RESET 0x01 SERVICE PARAM SET 0x02 Set SERVICE PARAM GET 0x03 Get SERVICE INPUTS GET 0x04 Get SERVICE OUTPUTS SET 0x05 Set value SERVICE FW REL GET 0x06 Get release SERVICE PLM CLOCK SET 0x07 Set 14 47 DoclD026935 Rev 2 Reset internal state machines Module hardware reset Service parameters Service parameters general purpose inputs pin status general purpose outputs pins the stack and the module firmware the internal time clock value Ly 0 1818 Firmware description SERVICE PLM CLOCK GET 0x08 Get the internal time clock value SERVICE IO CONFIG SET 0x09 Set the general purpose input and output pins SERVICE IO CONFIG GET 0x0a Get the general purpose input and output pins SERVICE NET DISCOVER REQ 0 0 SERVICE RFU SET IMG HEADER 0x0c SERVICE RFU SET IMG DATA SERVICE RFU SWAP IMG 0 0 SERVICE SN SET OxOf SERVICE SN GET 0x10 USER DEFINED SERVICE COMANDS SERVICE USER CMD xx Ox User defined service commands 0 0 to Ox7f APP SER CMD t 4 6 Firmware frame types This paragraph describes all the frame types that are implemented in this firmware In each field there is also the description 4 6 1 Communication frames types Frames exchanged between two PLM modules or between a PLM module and an external dev
17. Rev 2 0 1818 IMPORTANT NOTICE PLEASE READ CAREFULLY STMicroelectronics NV and its subsidiaries ST reserve the right to make changes corrections enhancements modifications and improvements to ST products and or to this document at any time without notice Purchasers should obtain the latest relevant information on ST products before placing orders ST products are sold pursuant to ST s terms and conditions of sale in place at the time of order acknowledgement Purchasers are solely responsible for the choice selection and use of ST products 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 products with provisions different from the information set forth herein shall void any warranty granted by ST for such product ST and the ST logo are trademarks of ST All other product or service names are the property of their respective owners Information in this document supersedes and replaces information previously supplied in any prior versions of this document 2015 STMicroelectronics All rights reserved DoclD026935 Rev 2 47 47
18. TRST 40 PBAJNIRST 44 PLC RESEIN 41 pas als 1 PLM 22 PES 216 2 0402 GPO7 43 pp Bas GP3 GPO4 45 29 8MHZ MCO 5 2 USART TX PL RX ON Gaia 1227 USART RX PL TX ON 22 pg PA 222 STM32 USB DM C3 SPINSS 5 32 USB SEISUK 262 ppi3 PAI3UTMSISWDIO 224 JTAG TMS SPI MISO 27 opis 10 50V SPI MOSI 28 338 TDI X1 0402 c PB15 PA18JTDI 88 Mae mI IMC 306 22 50 FOXSDLF 080 20 5 OSC NIPDO PCI3TAMPER 42 2 C6 L y2 m OSCOUT PD1 PC14 OSC32 3 4 4M 1509 32 OUT gt 10p 60V an 0402 22 50 1 VBAT BOOTO d POS E 80079 up R12 0402 4 NRST VDDIO 10K BT1 VEAT m VDD 1 88 1 23 0402 Yoo VSS2 47 CR2032 HF 9 378 0402 100 16V VDDIO VDDA VSSA eine JUS 13 32 1032 7 2 10 16V 100n 16V 0805 0402 7 7 VDDIO 5 C23 C37 C38 C39 10u 16V 100n 16V 100n 16M 100 16V 0805 0402 0402 0402 36 47 GSPG25092014D11535 Figure 14 Schematic diagram 3 of 5 1 ZC IN VCC A VCC A R19 22K 0402 4 p C29 3 2 IN 100 16 R30 0402 33K 0402 R32 10M 0402 Q2 BC847 SOT23 GND A
19. address Target device address 6 bytes buffer 8 APP DATA FRAME Data frame type buffer 9 command echo Echo buffer 10 11 CRC16 CRC 16 24 47 DoclD026935 Rev 2 Ly 0 1818 HID commands Case Software reset buffer 0 12 Data frame payload length buffer 1 APP ACK FRAME ACK frame type buffer 2 7 target module address Target device address 6 bytes buffer 8 APP DATA FRAME Data frame type buffer 9 2 0x73 Command char s buffer 10 11 CRC16 CRC 16 Lamp dimming From the COMM interface USART Source Concentrator and To the COMM interface USART Destination HID ballast buffer 0 13 Data frame payload length buffer 1 APP DATA FRAME BROADCAST FLAG Data frame type buffer 2 7 target module address Target device address 6 bytes buffer 8 0x73 command set char s buffer 9 0x01 HID board command identify Dimming buffer 10 dimming value Dimming value 0 100 0 100 buffer 11 12 CRC16 CRC 16 From the COMM interface USART Destination HID ballast buffer 0 2 Data frame payload length buffer 1 APP DATA FRAME Data frame type buffer 2 0x73 Char s To the COMM interface USART Source Concentrator buffer 0 12 Data frame payload length buffer 1 APP ACK FRAME ACK frame type buffer 2 7 target module address Target device address 6 bytes buffer 8 APP
20. of lamp voltage before the failure Low byte of lamp voltage before the failure High byte of hardware status before the failure Low byte of hardware status before the failure High byte of lamp power Low byte of lamp power High byte of hardware status before the failure Low byte of hardware status before the failure High byte of bus voltage before the failure Low byte of bus voltage before the failure High byte of lamp voltage before the failure Low byte of lamp voltage before the failure High byte of power supply voltage Low byte of power supply voltage DoclD026935 Rev 2 29 47 HID commands UM1818 buffer buffer buffer buffer buffer buffer GET buffer buffer buffer buffer buffer buffer buffer buffer GET buffer buffer buffer buffer buffer buffer buffer buffer GET buffer buffer buffer buffer buffer buffer buffer buffer 30 47 22 21 23 24 25 26 board temperature h board temperature 1 power on n h power on n 1 lamp lifetime h lamp lifetime 1 High byte of board temperature Low byte of board temperature C High byte of number of lamp power on Low byte of number of lamp power on High byte of lamp lifetime hours Low byte of lamp lifetime hours To the COMM interface USART source concentrator HARDWARE VERSION 0 14 1 APP DATA FRAME 2 7 source module address
21. payload buffer 1 APP ACK FRAME ACK frame type buffer 2 7 target module address Target device address buffer 8 APP SERVICE FRAME Service frame type buffer 9 command echo Echo buffer 10 11 CRC16 CRC 16 Get module firmware release From the COMM interface USART buffer 0 11 Service frame payload buffer 1 APP SERVICE FRAME Service frame type buffer 2 7 target module address Target device address buffer 8 SERVICE FW REL GET Service command buffer 9 10 CRC16 CRC 16 3 DoclD026935 Rev 2 length 6 bytes length 6 bytes length 6 bytes length 6 bytes 21 47 Firmware description UM1818 From to communication interface PLM USART buffer 0 15 Service frame payload length buffer 1 APP SERVICE FRAME Service frame type buffer 2 7 target module address Target device address 6 bytes buffer 8 SERVICE FW REL GET Service command buffer 9 10 target module firmware release Module firmware release x y buffer 11 12 target module stack release Stack firmware release x y buffer 13 14 CRC16 CRC 16 Get module time clock value From the COMM interface USART buffer 0 11 Service frame payload length buffer 1 APP SERVICE FRAME Service frame type buffer 2 7 target module address Target device address 6 bytes buffer 8 SERVICE PLM CLOCK GET Service command buffer 9
22. 0 4 0 7 4 0 764 0 04 0 924 0 544 0 5 4 0 984 0 4 4 0 8 4 0x864 0x404 ORF RP Hm 43 47 CRC 16 calculation UM1818 BR KR RRR k k RR RK RR kk RR ke e k k Sk Sk RR ke ke ke ke KK KKKKKK Function Name CalcCRC16 Description Calculate a 16 bit CRC X16 X15 X2 1 Input Buffer pointer buffer length Return Calculated CRC kkkkkxkkkkkkkkkkkkkkkkkkk kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk kkkkkk kkkkkkkx k 911616 t CalcCRC16 uint8 t buf uint8 t len uintl6 t crc 0 while 1 crc cre gt gt 8 TableCRCi6 crc buf amp Oxff return crc 3 44 47 DoclD026935 Rev 2 0 1818 Reference 5 Reference 1 ARM based 32 bit MCU STM32F10x standard peripheral library Rel 3 5 0 2011 2 ST7580FSK PSK multi mode power line networking SoC datasheets 2012 3 UMO0932 ST7580 FSK PSK multi mode power line networking SoC user manual 2013 4 4018 data link protocol for ST7580 PLM 5 embedded workbench IDE for STM32 microcontrollers Rel 6 3 documentation www iar com DoclD026935 Rev 2 45 47 Revision history UM1818 6 46 47 Revision history Table 2 Document revision history Date Revision Changes 29 May 2015 1 Initial release 29 Jul 2015 2 Figure 4 has been updated DoclD026935
23. 03 APP PROGRAMMING FRAME 0x04 APP ACK FRAME 0x05 APP MIB FRAME 0x06 ftype t DoclD026935 Rev 2 13 47 Firmware description UM1818 APPLICATION ERRORS 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 PROGRAMMING GROUPS typedef enum PROG DEVICE DATA PROG GRP LL STACK PARAM PROG GRP USER DATA PROG GROUP t SERVICE COMMANDS typedef enum NATIVE SERVICE COMMANDS 0x00 0x01 0x02 0x00 0 01 0 02 0 03 0 04 0 05 0 06 0 07 0 08 0 09 Ox0a OxOb 0 0 0 04 0 0 Generic communication error Communication timeout error Service group unknown error Service command error Communication error Node unreachable error Hardware error Wrong programming command Wrong programming group error Device blank Error setting the system time Hardware reset impossible Node initialization failure Internal RTC disabled Device
24. 10 CRC16 CRC 16 From to communication interface PLM USART buffer 0 14 Service frame payload length buffer 1 APP SERVICE FRAME Service frame type buffer 2 7 target module address Target device address 6 bytes buffer 8 SERVICE PLM CLOCK GET Service command buffer 9 target module hours Hours buffer 10 target module minutes Minutes buffer 11 target module seconds Seconds buffer 12 13 CRC16 CRC 16 Set module time clock value From the COMM interface USART buffer 0 14 Service frame payload length buffer 1 APP SERVICE FRAME BROADCAST FLAG Service frame type buffer 2 7 target module address Target device address 6 bytes buffer 8 SERVICE PLM CLOCK SET Service command buffer 9 target module new hours Hours buffer 10 target module new minutes Minutes buffer 11 target module new seconds Seconds buffer 12 13 CRC16 CRC 16 22 47 DoclD026935 Rev 2 ky 0 1818 Firmware description buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer 3 From to communication interface USART DoclD026935 Rev 2 0 12 Service frame payload length 1 APP ACK FRAME Service frame type 2 7 target module address Tar
25. 5 Rev 2 Service frame payload length Service frame type Target device address 6 bytes Service command Type command Program Data CRC 16 19 47 Firmware description UM1818 Get module general purpose inputs outputs configuration From the COMM interface USART buffer 0 11 Service frame payload length buffer 1 APP SERVICE FRAME Service frame type buffer 2 7 target module address Target device address 6 bytes buffer 8 SERVICE IO CONFIG GET Service Command buffer 9 10 CRC16 CRC 16 From to communication interface PLM USART buffer 0 12 Service frame payload length buffer 1 APP SERVICE FRAME Service frame type buffer 2 7 target module address Target device address 6 bytes buffer 8 SERVICE IO CONFIG GET Service command buffer 9 sender configuration value input output configuration buffer 10 11 CRC16 CRC 16 Set module general purpose inputs outputs configuration From the COMM interface USART buffer 0 12 Service frame payload length buffer 1 APP SERVICE FRAME Service frame type buffer 2 7 target module address Target device address 6 bytes buffer 8 SERVICE IO CONFIG SET Service command buffer 9 target configuration value bit x 1 gt IOx output bit x 0 gt input buffer 10 11 CRC16 CRC 16 From to communication interface PLM USART buffer 0 12 Service frame p
26. 7580 communication protocol features and application services provided Some features are managed directly by the application engine and are transparent to the user such as the RTC management or the board parameter update as well as the board 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 being update remotely by power line modem The STEVAL IHP007V1 is powered by a dual regulated DC power source 12VDC pin 1 and 3 3 VDC pin 2 from the power supply connector J2 pin is the ground The communication is done via power line which is applied to the board using the J1 connector where the pin 1 must be connected to the neutral wire while the pin 3 to the phase wires refer to the Appendix A Figure 2 STEVAL IHP007V1 block diagram C z 5 gt o PROGRAMMINGE It is possible to connect the evaluation board in a three phase line in case of communication modules are connected in all three phases in this case an external capacitor of 220 nF X1 must be connected to any additional phase and then the other side of capacitors together with the common pin 5 of the J2 connector following the schematic shown in the Figure 3 and the 0 O resistor R1 must be mounted 4 47 DoclD026935 Rev 2 Ly
27. 80 Ox8F81 0x8581 0x4380 0x0140 0xC301 OxC741 0x0500 OxCD41 OxOFO00 0 0 40 0 901 0 0941 0 1 00 0 1 40 OxDDO1 0 1540 OxD701 0 0341 0 1100 OxF141 0x3300 0x3740 OxF501 0 3040 OxFFO01 0 41 0x3900 0x2940 01 OxEFA1 0 2 00 OxE541 0x2700 0x2340 0 101 OxA141 0x6300 0x6740 OxA501 0 6 40 OxAFO01 OxAB41 0x6900 0x7940 OxBBO1 0 41 0 7 00 OxB541 0x7700 0x7340 OxB101 0 5140 0x9301 0x9741 0 5500 0 9041 0 5 00 0 5 40 0x9901 0 8941 0 48 00 0 4 40 0 8 01 0 4540 0 8701 0 8341 0 4100 DoclD026935 Rev 2 0 03 0 0 5 1 0 1 0 09 0 OxDBC1 0 1 0 17 0 OxD1C1 0 1 0 35 0 Ox3FCO OxF9CI1 Ox2BCO OxEDC1 0 7 1 0 21 0 1 0 65 0 Ox6FCO OxA9CI1 Ox7BCO OxBDCI1 OxB7C1 0 71 0 0 53 0 0 95 1 0 9 1 0 59 0 Ox8BC1 0 4 0 47 0 0 81 1 0 0280 0 481 0 81 0 0880 OxDAS81 0x1C80 0x1680 0 0081 OxF281 0x3480 0 3 80 0 881 0 2 80 0 81 OxE681 0x2080 0 281 0 6480 0 6 80 0 881 0 7 80 81 OxB681 0x7080 0x5280 0x9481 0 9 81 0 5880 0 8 81 0x4C80 0 4680 0 8081 0 24 0 044 0 0 4 0 84 0x144 OxDC4 OxD64 0 104 0 324 0 44 OxFEA 0x384 0 4 0 2 4 0 264 0 04 0 624 0 44 OxAEA 0x684
28. FU feature Each new firmware version has to be programmed using the workspace Firmware Application standalone EWARM Project eww The bin file produced by this workspace that is located in the folder Firmware Application standalone EWARM PLM_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 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 architecture The structure of the workspace is divided in different sections as shown in the Figure 11 DoclD026935 Rev 2 11 47 0 1818 Firmware description 12 47 Figure 11 Workspace structure Workspace x EVALST 7580 Files 22 85 E CJ EVALST7580 EVALST7580 1 5 98 Datalink Layer 1 ra D channel eccess c i Ha 0 csmacac i Data Link Files Ha 0 di_mat20 c dl secure services c ma D di services c H 0000000000077
29. GND A HCPL 181 000E D1 R18 L 33K 1206 STTH1LOGA DO 214AC R22 100K 2 0805 R25 R26 N 33K 33K 1206 1206 Isolated ZeroCrossing DoclD026935 Rev 2 GSPG25092014D11545 0 1818 Schematic diagrams and bill of material Figure 15 Schematic diagram 4 of 5 TX QUT i Be SIPS 130A rA 7 m 0402 A 0402 C31 T RGB 7 10 6 COMM anl im al ps i 046 Rat 03 8 1 1 1 E T L 0402 lt 830402 Lcas 042 24K 7 OIG d0U 220nX2 25 47K 1n 50V 100p 25V 0402 DO 214AC 9MA 18x8x16 TL Te Eh m RX IN 2i Power Line Coupling Section cm xdi 0603 a ms 90121 0765 GSPG25092014D11550 Figure 16 Schematic diagram 5 of 5 JTAG Interface o o VDDIO N co 4 x 10K CAT16 J4 JTAG TRST 1 5 _ 4 5 5 4 JTAG 6 RESET uP 1 R7 8 10K ue 90120 0768 GSPG25092014D11555 0402 B 2 Bill of material BOM Table 1 Bill of material Part MI 22 Order Order type code Design Footprint Description Qty Manufact code Part number code 2 C1 C2 C4 C7 C10 C12 3 C13 C15 100
30. I Order type code Design Footprint Description Qty Manufact Part number code 2 Resistor 24K CRG0402 24K R23 R31 0402 R 0 0625W 1 2 F24K 667 8909 Resistor 47K 47K R24 R33 0402 R 0 0625W 2 ao 667 8943 F47K 0 1 Resistor 1K5 CRG0402 1K5 R27 R85 0402 R 0 063W 1 2 1 5 667 8707 CRCWO04 5k1 Res o402 R ResistorSkt 4 025K10F 678 9478 0 0625W 196 KED Resistor CRCW04 10M R32 0402 R 10M 1 0210MOF 667 8709 0 0625W KED Resistor 150R R34 06035 150R0 1w 1 0890603 545 2165 1 F150R Resistor 22R CRG0402 22R R36 R37 0402 R 0 063W 1 2 F2oR 667 8558 Respack 4 006 RP1 RP2 16 16 10K 9 RP3 _ SMD4x10K 103J4LF 522 5412 103J4LF 1770124 _16 0 25 5 STM32 ARM based IC 32 bit MCU STM with 64 2 1 Ut Kbytes 1 714 7689 03CB Flash 36 pin T7 VFQFPN Industrial Temperature B FSK B PSK Q PSK 8 PSK ST75 U2 VFQFPN4 Multi Mode 1 80 8 7x7x1 Power Line Networking System on Chip HCP CE U3 SO 4 Optocoupler 1 HCPL 181 693 5277 181 n 000E SMD Mini Flat Type Ly DoclD026935 Rev 2 41 47 Schematic diagrams and bill of material UM1818 Table 1 Bill of material continued Part MI A Order Order type code Design Footprint Description Qty Manufact code Part number code 2 USB Very USB Low LC6 027 04 SOT666 Capacitance
31. OTLOADER FIRMWARE 3Kb RESET VECTORS IMAGE 1 ACTIVE IMAGE ADDRESS 32 bit ACTIVE IMAGE POINTER Not used 32 bit Not used 32 bit Not used 32 bit 1Kb Not used 32 bit FIRMWARE IMAGE 2 RFU protocol manages the RFU start 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 bust the user must be careful in the modifications as any bugs 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 In the Figure 8 is shown the RFU flowchart DoclD026935 Rev 2 9 47 Firmware description UM1818 4 3 10 47 Figure 8 RFU flowchart 10f 2 uC Startup bootloader READ ACTIVE IMAGE ADDRESS LOAD STACK POINTER YES FIRST IMAGE ADDRESS REGISTER WITH FIRST VECTOR TABLE ADDRESS LOAD STACK POINTER REGISTER WITH SECOND 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 Figure 9 RFU flowc
32. are status h hardware status 1 bus voltage h bus voltage 1 lamp voltage h lamp voltage 1 POWER SUPPLY VOLTAGE 0 67 0 07 board temperature h board temperature 1 C 55 0x67 0x07 board temperature h board temperature 1 Data frame payload length Get command g ascii value LAMP POWER High byte of lamp power Low byte of lamp power Data frame payload length Get command g ascii value LAST FAILURE High byte of hardware status before the failure Low byte of hardware status before the failure High byte of bus voltage before the failure Low byte of bus voltage before the failure High byte of lamp voltage before the failure Low byte of lamp voltage before the failure Data frame payload length rg BOARD TEMPERATURE Get command ascii value High byte of board temperature C Low byte of board temperature C Data frame payload length BOARD TEMPERATURE Get command ascii value High byte of board temperature Low byte of board temperature 3 DoclD026935 Rev 2 UM1818 HID commands GET N buffer 0 buffer 1 buffer 2 buffer 3 buffer 4 GET LAMP buffer 0 buffer 1 buffer 2 buffer 3 buffer 4 GET buffer 0 buffer 1 buffer 2 buffer 3 buffer 4 buffer 5 bu
33. ayload length buffer 1 APP FRAME ACK frame type buffer 2 7 target module address Target device address 6 bytes buffer 8 APP SERVICE FRAME Service frame type buffer 9 command echo Echo buffer 10 11 CRC16 CRC 16 Get module general purpose inputs value From the COMM interface USART buffer 0 11 Service frame payload length buffer 1 APP SERVICE FRAME Service frame type buffer 2 7 target module address Target device address 6 bytes buffer 8 SERVICE INPUTS GET Service command buffer 9 10 CRC16 CRC 16 20 47 DoclD026935 Rev 2 Ly 0 1818 Firmware description From to communication interface PLM USART buffer 0 12 Service frame payload buffer 1 APP SERVICE FRAME Service frame type buffer 2 7 target module address Target device address buffer 8 SERVICE INPUTS GET Service command buffer 9 sender inputs value Read GPIO Input value buffer 10 11 CRC16 CRC 16 Set module general purpose outputs value From the COMM interface USART buffer 0 12 Service frame payload buffer 1 APP SERVICE FRAME Service frame type buffer 2 7 target module address Target device address buffer 8 SERVICE OUTPUTS SET Service command buffer 9 target outputs value Set GPIO output value buffer 10 11 CRC16 CRC 16 From to communication interface PLM USART buffer 0 12 Service frame
34. bus voltage 1 GET LAMP VOLTAGE buffer 0 buffer 1 buffer 2 buffer 3 buffer 4 5 0x67 0x02 lamp_voltage_h lamp voltage 1 GET HARDWARE STATUS buffer 0 buffer 1 buffer 2 buffer 3 buffer 4 0x67 0x03 hardware status h hardware status 1 hardware status value 0 00 IDLE 0x01 0x02 0x03 STARTUP 0x04 0x05 WARMUP 0 06 RUN 0 07 WAIT 0 08 FAILURE 3 Data frame payload length Get command g ascii value BUS VOLTAGE High byte of bus voltage Low byte of bus voltage Data frame payload length Get command g ascii value LAMP VOLTAGE High byte of lamp voltage Low byte of lamp voltage Data frame payload length Get command g ascii value HARDWARE STATUS High byte of hardware status Low byte of hardware status DoclD026935 Rev 2 27 47 HID commands UM1818 GET LAMP buffer 0 buffer 1 buffer 2 buffer 3 buffer 4 GET LAST buffer buffer buffer buffer buffer buffer buffer buffer buffer FF W NY ll GET buffer 0 buffer 1 buffer 2 buffer 3 buffer 4 GET BOARD TEMPERATURE buffer 0 buffer 1 buffer 2 buffer 3 buffer 4 28 47 POWER 5 0 67 0 04 lamp power h lamp power 1 FAILURE 9 0x67 0x05 hardw
35. e the failure 21 last hardware status 1 Low byte of hardware status before the failure 026935 Rev 2 33 47 HID commands UM1818 buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer 22 last bus voltage h 23 last bus voltage 1 24 last lamp voltage h 25 last lamp voltage 1 26 input voltage h 27 input voltage 1 28 board temperature 1 29 board temperature 1 30 power on n h 31 power on n 1 32 lamp lifetime h 33 lamp lifetime 1 34 35 CRC16 High byte of bus voltage before the failure Low byte of bus voltage before the failure High byte of lamp voltage before the failure Low byte of lamp voltage before the failure High byte of power supply voltage Low byte of power supply voltage High byte of board temperature Low byte of board temperature C High byte of number of lamp power on Low byte of number of lamp power on High byte of lamp lifetime hours Low byte of lamp lifetime hours CRC 16 If an error occurs from the HID board or from the network the following frame throughout the COMM will be sent ERROR FRAME RESPONSE buffer 0 12 buffer 1 APP ERROR FRAME buffer 4 5 6 7 target module address buffer 8 9 HID error code buffer 10 11 CRC16 HID error code value
36. ffer 6 buffer 7 buffer 8 buffer 9 buffer 10 buffer 11 buffer 12 buffer 13 buffer 14 buffer 15 buffer 15 buffer 17 buffer 18 buffer 19 buffer 20 Ly OF POWER ON 5 0 67 0 08 power on n h power on n 1 LIFETIME Hours 0 67 0 09 lamp lifetime h lamp lifetime 1 ALL PARAMETERS 5j 0x67 0x0a hardware release xx hardware release yy bus voltage h bus voltage 1 lamp voltage h lamp voltage 1 hardware status h hardware status 1 lamp power h lamp power 1 last bus voltage h last bus voltage 1 last lamp voltage h last lamp voltage 1 input voltage input voltage 1 last hardware status h last hardware status 1 Data frame payload length Get command g ascii value N OF POWER ON High byte of number of lamp power on Low byte of number of lamp power on Data frame payload length LAMP LIFETIME hours Get command ascii value High byte of lamp lifetime hours Low byte of lamp lifetime hours Data frame payload length 5g GET ALL PARAMETERS Get command ascii value Hardware release xx yy xx bcd format YY YY High byte of bus voltage before the failure Hardware release xx yy xx bcd format Low byte of bus voltage before the failure High byte
37. get device address 6 bytes 8 APP SERVICE FRAME Service frame type 9 command echo Echo 10 11 CRC16 CRC 16 GET PLM Module SNR ratio From the COMM interface USART 01 Xi Service frame payload length 1 APP SERVICE FRAME Service frame type 2 7 target module address Target device address 6 bytes 8 SERVICE SN GET Service command 9 10 CRC16 CRC 16 From to communication interface PLM USART 0 12 Service frame payload length 1 APP SERVICE FRAME Service frame type 2 7 target module address Target device address 6 bytes 8 SERVICE SN GET Service command 9 sender sn value SNR Ratio from 0 to 31 10 11 CRC16 CRC 16 Set PLM Module SNR ratio From the COMM interface USART 0 12 Service frame payload length 1 APP SERVICE FRAME Service frame type 2 7 target module address Target device address 6 bytes 8 SERVICE SN SET Service command 9 target sn value SNR Ratio from O to 31 10 11 CRC16 CRC 16 From to communication interface PLM USART 0 12 Service frame payload length 1 APP ACK FRAME ACK frame type 2 7 target module address Target device address 6 bytes 8 APP SERVICE FRAME Service frame type 9 command echo Echo 10 11 CRC16 CRC 16 23 47 HID commands UM1818 Appendix HID commands HID frames are data frames where the payload is customized fo
38. hart 2 of 2 APPLICATION RUNNING RFU START COMMAND RECEIVED STORECHECKSUM STORETOTAL SIZE STORE SEGMENT IN THE FIRST SECOND IMAGE AT THE IMAGE IS GIVEN ADDRESS ACTIVE OFFSET 15 ADDED IN THE VECTOR TABLE STORE SEGMENT IN THE FIRST IMAGE AT THE GIVEN ADDRE 55 OFFSET 15 ADDED IN THE VECTOR TABLE NEW FIRMWARE SEGMENT RECEIVED FIRST YES STORE THE SECOND IMAGEIS IMAGE ADRESS IN THE BOOTLOADER DATA ACTIVE SEGMENT STORE THE FIRST IMAGE ADRESS IN THE BOOTLOADER DATA SEGMENT RFU SWAP COMMAND RECEIVED CHECKSUM 15 CORRECT 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 board has never been programmed this workspace must be downloaded before Open the IAR Embedded Workbench IDE for STM32 microcontrollers Rel 6 50 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 projec
39. he PLM low level communication The application engine APP StackUpdate is the state machine which runs inside the PLM application state machine this uses the data link service provided from DL Service layer The user program implemented in this user manual realizes a bridge between the power line communication and the COM port all data arriving from the COM port addressed to another PLM module is sent via PLM and in turn all 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 hardware configurations are contained in the board support package file and the file DL SimpleNodeConf contains the data link configuration parameters and the PLM modem configuration value frequency modulation zero crossing delay etc The next paragraph lists all the data types and the APIs used in the application engine that can be modified by the user if different needs arise Firmware data types The data type found in the wrapper h module are listed hereafter USER FRAME STRUCTURE typedef struct APP ftype t type bool broadcast u8 address 6 u8 len u8 data USER PAYLOAD SIZE MAX PAYLOAD SIZE 100 bytes bool EnableTX APP frame t APPLICATION FRAME TYPE typedef enum APP DATA FRAME 0x00 APP_SERVICE_FRAME 0x01 APP_PING FRAME 0x02 APP_ERROR_FRAME 0x
40. ice connected to the COMM interface From the COMM interface module USART buffer 0 n 10 Data frame payload length n 10 buffer 1 DATA FRAME TYPE BROADCAST FLAG Data frame type buffer 2 7 target module address Target device address 6 bytes buffer 8 8 n 1 user data n User data n bytes at least 1 buffer 8 n 8 n 1 CRC16 CRC 16 BROADCAST FLAG 0x80 gt data sent in broadcast BROADCAST FLAG 0x00 data sent in unicast From to communication interface PLM USART frame type DATA FRAME TYPE Data frame type frame len n Data frame payload length frame broadcast TRUE FALSE TRUE broadcast FALSE unicast frame address target module address Target device address 6 bytes frame data n service 0 User data n bytes 3 DoclD026935 Rev 2 15 47 Firmware description UM1818 4 6 2 Ping frames This particular frame is used to ping a remote via PLM interface or a local via COMM interface module When the ping frame is received this is managed directly at the data link layer and is not notified at the application and consequently the user levels From the COMM interface module USART buffer 0 10 Ping frame payload length buffer 1 APP PING FRAME Ping frame type buffer 2 7 target module address Target device address 6 bytes buffer 8 9 CRC16 CRC 16 From to communication interface PLM USART
41. low from to the PLM physical and from to the UART side 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 this application is set to 60 Kbytes plus 4 Kb of additional memory for a bootloader The Figure 7 shows the microcontroller memory organization The bootloader is loaded at the startup and checks the active segment containing the actual firmware The implemented mechanism uses three partitions of the microcontroller s Flash DoclD026935 Rev 2 Ly 0 1818 Firmware description 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 calculated 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 Last the microcontroller is self reset and the new firmware executed Figure 7 Memory organization BOOTLOADER gt BO
42. meters SERVICE INPUTS GET 0x04 Get general purpose inputs pin status SERVICE OUTPUTS SET 0 05 Set general purpose outputs pins value SERVICE FW REL GET 0x06 Get the stack and the module firmware release SERVICE PLM CLOCK SET 0x07 Set the internal time clock value SERVICE PLM CLOCK GET 0x08 Get the internal time clock value SERVICE IO CONFIG SET 0x09 Set the general purpose input and output pins SERVICE IO CONFIG GET 0 Get the general purpose input and output pins SERVICE NET DISCOVER OxOb SERVICE RFU SET IMG HEADER 0 0 SERVICE RFU SET IMG DATA SERVICE RFU SWAP IMG 0x0e SERVICE SN SET OxOf SERVICE SN GET 0x10 USER DEFINED SERVICE COMANDS SERVICE USER CMD xx PLM reset software hardware From the COMM interface USART buffer 0 11 Service frame payload length buffer 1 APP SERVICE FRAME Service frame type buffer 2 7 target module address Target device address 6 bytes FOR SOFTWARE RESET buffer 8 SERVICE SOFTWARE RESET FOR HARDWARE RESET buffer 8 SERVICE HARDWARE RESET buffer 9 10 CRC16 CRC 16 Note Any response from PLM module 18 47 00 10026935 Rev 2 0 1818 Firmware description buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer buffer b
43. module address Source device address 6 bytes buffer 8 0x67 Get command g ascii value buffer 9 0x04 Response to g4 command buffer 10 lamp power h High byte of lamp power buffer 11 lamp power 1 Low byte of lamp power buffer 12 13 CRC16 CRC 16 GET LAST FAILURE buffer 0 18 Data frame payload length buffer 1 APP DATA FRAME Data frame type buffer 2 7 source module address Source device address 6 bytes buffer 8 0x67 Get command g ascii value buffer 9 0x05 Response to g5 command buffer 10 hardware status h High byte of hardware status before the failure buffer 11 hardware status 1 Low byte of hardware status before the failure buffer 12 bus voltage h High byte of bus voltage before the failure buffer 13 bus voltage 1 Low byte of bus voltage before the failure buffer 14 lamp voltage h High byte of lamp voltage before the failure buffer 15 lamp voltage 1 Low byte of lamp voltage before the failure buffer 16 17 CRC16 CRC 16 3 DoclD026935 Rev 2 31 47 HID commands UM1818 GET buffer buffer buffer buffer buffer buffer buffer buffer GET buffer buffer buffer buffer buffer buffer buffer buffer GET buffer buffer buffer buffer buffer buffer buffer buffer 32 47 POWER SUPPLY VOLTAGE 0 14 1
44. nsmission and reception Ly DoclD026935 Rev 2 5 47 Description UM1818 Finally a programming connector allows the 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 The Figure 5 shows the adapter schematics Figure 5 Programming connector JTAG adapter J1 gt Co PO gt 10K 20 19 10K 10K JTAG 6 47 DoclD026935 Rev 2 Ly 0 1818 Hardware installation 3 Hardware installation Connect a regulated dual DC power supply to the power source pins of the connector J3 as described previously and power the board In order to download the firmware plug the programmer adapter Figure 5 in the programming connector J1 and the IAR J Link programmer in the JTAG connector of the adapter Refer to the chapter firmware description paragraph 6 3 for the firmware download procedure As soon as the application is launched the LEDs should quickly switch on indicating that the board has to be configured Ly DoclD026935 Rev 2 7 47 Firmware description UM1818 4 4 1 4 2 8 47 Firmware description Introduction The firmware structure is constituted of several layers each of it
45. r the HID ballast application From the COMM interface USART buffer 0 n 10 Data frame payload length n 10 buffer 1 APP DATA FRAME BROADCAST FLAG Data frame type buffer 2 7 target module address Target device address 6 bytes buffer 8 8 n 1 user data n User data n bytes at least 1 buffer 8 n 8 n 1 CRC16 CRC 16 BROADCAST FLAG 0x80 gt data sent in broadcast BROADCAST FLAG 0x00 data sent in unicast From to communication interface PLM USART buffer 0 n 10 Data frame payload length n 10 buffer 1 APP DATA FRAME Data frame type buffer 2 7 target module address Target device address 6 bytes buffer 8 n HID DATA HID data buffer n 1 n 2 CRC16 CRC 16 HID board reset From the COMM interface USART buffer 0 13 Data frame payload length buffer 1 APP DATA FRAME Data frame type buffer 2 7 target module address Target device address 6 bytes buffer 8 0x73 command set char s buffer 9 0x00 HID board command identify reset buffer 10 reset type Software reset Hardware reset 0 0 buffer 11 12 CRC16 CRC 16 From to communication interface PLM USART Case hardware reset the PLM set the reset GPIO pin to reset the HID ballast GPIO Port A Pin 6 buffer 0 12 Data frame payload length buffer 1 APP ACK FRAME ACK frame type buffer 2 7 target module
46. ror code APP ERROR t buffer 8 lt lt 8 buffer 9 Service frames 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 USART 0 11 Service frame payload length 11 1 APP SERVICE FRAME BROADCAST FLAG Service frame type 7 target module address Target device address 6 bytes 8 APP SER CMD t command Service command 9 9 n 1 service data nl Service data 9 9 1 CRC16 CRC 16 BROADCAST FLAG 0x80 gt data sent in broadcast BROADCAST FLAG 0x00 data sent in unicast From to communication interface PLM USART 0 11 length 1 DATA FRAME Service or ACK frame type 2 7 target module address Target device address 6 bytes 8 APP SER CMD t command APP ACK FRAME Service command ACK 9 n service data n Command Echo Service data or Command echo n 1 n 1 n 2 CRC16 DoclD026935 Rev 2 17 47 Firmware description UM1818 Service command list NATIVE SERVICE COMMANDS SERVICE SOFTWARE RESET 0x00 Reset internal state machines SERVICE HARDWARE RESET 0x01 Module hardware reset SERVICE PARAM SET 0x02 Set service parameters SERVICE PARAM GET 0x03 Get service para
47. s e USART communication channel for evaluation board interfacing e Internal configurable RTC evaluation board with lithium backup battery Programmable user data parameters Flash memory area e Remote firmware update Embedded AES 128 encryption evaluation board with programmable AES Key DoclD026935 Rev 2 3 47 Description UM1818 2 Description The STEVAL IHP007V1 block diagram is shown in Figure 2 The general purpose power line modem evaluation board is based on an ST7580 x PSK power line modem device and an ARM 32 bit Cortex M3 core based STM32F103xB microcontroller The PLM evaluation board is a fully functional communication evaluation board 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 application layer engine is the general interface between the user program and all the parts of the evaluation board It manages the communication ports the evaluation board peripherals such as SCI 1 LEDs and timing management It is also the interface between the PLM communication protocol and the user application layer The PLM communication protocol 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 4018 for details on the 51
48. t the project name must be in bold otherwise select the active project in the list below the workspace Figure 10 DoclD026935 Rev 2 Ly 0 1818 Firmware description 4 4 Figure 10 Active project selection 28 Project IAR Embedded Workbench IDE File Edit View Project Simulator Tools Window Help Workspace ject EVALST 7580 Project LEVALST 7580 Project BOOTLOADER AIN Prier 3 EYALST7580 EVALST7580_ Click Project Batch Build or press the key F8 in order to compile at the mean time the bootloader and the application After the compiling is completed press Project Download and Debug or press the keys CTRL D The both firmware download starts 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 board 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 again the firmware as described before Use the GUI interface in order to setup the board and connect it to the power line as described in the dedicated paragraph As soon as bootloader has been installed in the evaluation board is possible to remotely via power line update the firmware using the R
49. taking care of a different feature The application layer engine is the general interface between the user program and all the parts of the module It takes care of the communication ports the board peripherals as and and timing management It is also the interface between the communication protocol and the user program The PLM communication protocol itself constituted by 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 board programming and configuration which is done by particular programming or service commands managed and acknowledged directly by the application engine the RTC management the board 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 evaluation board interface The Figure 6 shows the firmware structure Figure 6 Firmware structure USER CUSTOMIZABLE APPLICATION LAYER APPLICATION ENGINE i I I I SPI RS232 USB FLASH MEMORY I 1 PLM 817580 DRIVER PHY SICAL DEVICE RTC 105 LEDs 1 1 FIRMWARE UPDATE LOCAL REMOTE VIA PL H POWER LINE JE The file user c h and application c h are the owner of application management this manage the data f
50. uffer buffer buffer buffer buffer 3 2 2 01 11 81 91 10 42 0 1 8 9 10 0 1 8 9 10 0 1 8 9 10 42 Set module parameters programming user parameters From the COMM interface USART 44 APP SERVICE FRAME BROADCAST FLAG 7 target module address SERVICE PARAM SET PROG USER DATA gt 41 user data buffer 43 16 Service frame payload length Service frame type Target device address 6 bytes Service command Type command Program data CRC 16 From to communication interface PLM USART 12 APP ACK FRAME 7 target module address APP SERVICE FRAME command echo 11 16 Service frame payload length ACK frame type Target device address 6 bytes Service frame type Echo CRC 16 Get module parameters programming user parameters From the COMM interface USART 12 APP SERVICE FRAME 7 target module address SERVICE PARAM GET PROG USER DATA 11 CRC16 Service frame payload length Service frame type Target device address 6 bytes Service command Type command CRC 16 From to communication interface PLM USART 44 APP SERVICE FRAME 7 target module address SERVICE PARAM GET PROG USER DATA gt 41 user data buffer 43 CRC16 DoclD02693
Download Pdf Manuals
Related Search
Related Contents
Mora VDIS 642 FF Liste des titres - Ville de Sainte PDFカタログ Model 6000 Wireless Bar Code Decoder Model 6200 Wireless Host Manual Instruções Motor 3 e 4 cilindros warning - Hitachi Power Tools Avaya SIP Software Release 3.0 Notice Copyright © All rights reserved.
Failed to retrieve file