background image

Product

Name 

Version

Doc No

Date

Page

S76S/S78S SDK Manual

C

May 3, 2017

0 of 33

Document History

Date

Revised Contents

Revised

by

Versi

on

S76S/S78S 

SDK Manual

S76S/S78S SDK Manual

C

May 3, 2017

Document Name 

Version

Doc No

Date

Содержание S76S

Страница 1: ...Version Doc No Date Page S76S S78S SDK Manual C May 3 2017 0 of 33 Document History Date Revised Contents Revised by Versi on S76S S78S SDK Manual S76S S78S SDK Manual C May 3 2017 Document Name Version Doc No Date ...

Страница 2: ... C May 3 2017 1 of 33 Oct 13 2016 Mar 29 2017 May 3 2017 Initial version LoRaWAN migration infomation added FTP information removed Leo Tseng Leo Tseng Leo Tseng A B C Index 1 Overview 2 Hardware Interface 2 1 Connections between MCU SX1276 2 2 Pin definition ...

Страница 3: ...ct ST Link 3 2 1 Disconnect ST Link 3 3 Download Firmware via ST LINK V2 3 4 Prerequisite for ULINK2 3 5 Connection Disconnection via ULINK2 3 5 1 Setup debugger as ULINK2 4 Developer Environment 4 1 Installation 4 2 Set up Only for ST LINK V2 4 3 Edit Source and Build 5 SDK Features 5 1 Features 5 1 1 UART Debug Logger 5 1 2 Ping Pong Demonstration 5 1 3 Power Saving 5 2 Flow Chart 5 2 1 Flow Cha...

Страница 4: ... yields industry leading link budget making it optimal for any low data rate application requiring range or robustness STM32L073X is a high performance but low power MCU running at 32 MHz maximum that provides multiple interfaces like UART GPIO ADC SPI I2C JTAG interfaces It allows customer has lots of flexibility to develop their own products In this document we have introduced and detailed descr...

Страница 5: ...Product Name Version Doc No Date Page S76S S78S SDK Manual C May 3 2017 4 of 33 Figure 1 1 Take S76S as example Figure 1 2 S76S Block Diagram Figure 1 3 S78S Block Diagram ...

Страница 6: ...an already operate well on AcSiP s default configuration As the figure 2 2 tells STM32L073X MCU and SX1276 are packaged as SiP System in Package and named as S76S S78S which is located in the center of the EK S76SXB EK S78SXB board the center part of figure 2 2 2 2 Pins definition 2 2 1 XB board Peripheral List The supporting peripheral interface important endpoint on XB board area listed below Fi...

Страница 7: ...al Pins Pin1 to Pin10 j XB External Pins Pin11 to Pin20 k XB Additional Breakout Pin1 to Pin10 l XB Additional Breakout Pin1 to Pin10 Pins definition reference is located at 2 2 2 UART1 TX PA9 RX PA10 pins UART4 TX PA0 RX PA1 pins UART2 TX PA2 RX PA3 pins UART5 TX PC12 RX PD2 pins Three standard serial port pins UART2 4 5 for debugging message input or output or data pins UART1 TX RX pins converts...

Страница 8: ... None pin10 No connection None pin11 No connection RST pin12 MCU_RESET PA0 for ADC USART4 TX pin13 PA0 GND pin14 GND GND pin15 GND PA2 for ADC USART2 TX pin16 PA2_TXD_A PA3 for ADC USART2 RX pin17 PA3_RXD_A PA4 for SPI1 NSS USART2 CK pin18 PA4_SPI1_NSS PA5 for SPI1 SCK ADC pin19 PA5_SPI1_SCK PA6 for SPI1 MISO ADC pin20 PA6_SPI1_MISO PA7 for SPI1 MOSI ADC pin21 PA7_SPI1_MOSI PC4 for ADC pin22 PC4 P...

Страница 9: ...LK pin51 PA14_SWCLK PC10 for USART4 TX pin52 PC10 PC11 for USART4 RX ADC pin53 PC11 PC12 for USART5 TX USART4 CK pin54 PC12 PD2 for USART5 RX pin55 PD2 PB5 for USART5 RTS SPI1 MOSI pin56 PB5 PB6 for USART1 TX I2C1 SCL pin57 PB6_SCL PB7 for I2C1 SDA USART1 RX USART4 CTS pin58 PB7_SDA BOOT0 pin59 BOOT0 PB8 for I2C1 SCL pin60 PB8_IO_LED_FCT GND pin61 GND GND pin62 GND 2 3 Usable Interface of EK S76 7...

Страница 10: ...igital converter is embedded and performing conversions in the single continuous scan and discontinuous mode In scan mode automatic conversion is performed on a selected group of analog inputs The analog watchdog feature allows the application to detect if the input voltage goes outside the user defined higher or lower thresholds The detailed reference about ADC is located in this below link http ...

Страница 11: ...S76S S78S SDK Manual C May 3 2017 10 of 33 NRST can trigger an external reset to MCU system reset when VNRST is low A system reset sets all registers to their reset values except for the RTC RTC backup registers and control status registers ...

Страница 12: ... LINK V2 3 1 1 Hardware Preparation HW component See Figure 3 1 USB Port x 2 on PC NB site ST Link V2 unit x1 EK S76SXB EK S78SXB board x1 Mini USB cable x 1 and Micro USB cable x1 Figure 3 1 Connect HW component as Figure 3 2 Connect S EK S76SXB EK S78SXB Abbr XB board to ST LINK ST Link Pin7 SWDIO on XB board ST Link Pin9 SWCLK on XB board ST Link Pin12 GND on XB board ST Link Pin1 ST Link Pin19...

Страница 13: ...rd A to mini B cable Connect XB board to PC NB USB port with USB standard A to micro B cable 3 1 2 Software preparation SW component See Figure 3 4 STM32 ST Link Utility Figure 3 4 3 1 2 1 STM32 ST LINK V2 USB Driver Installation Install ST LINK V2 USB Driver for PC NB Connect to www st com In the search tab part number look for ST LINK V2 ...

Страница 14: ...mer for STM8 and STM32 link In DEVELOPMENT TOOL SOFTWARE page to download STM32 ST LINK utility Extract the contents of the downloaded zip file To execute setup exe and follow the on screen prompts to install 3 2 Connection Disconnection via ST LINK V2 3 2 1 Connect ST LINK After installing ST32 LINK V2 USB driver and STM32 ST LINK Utility to execute STM32 ST LINK Utility If HW SW installation com...

Страница 15: ...this follow these steps 1 Click on Target Program or Target Program Verify if the user wants to verify the written data to open the Open file dialog box as shown in Figure 3 7 If a binary file is already opened go to step 3 2 Select a hex file and click on the Open button Figure 3 7 3 Specify the address from which to start programming as shown in Figure 3 8 it may be a Flash or RAM address Option...

Страница 16: ...verification method which reads all the programmed memory zone after the program operation ends and compares it with the file content 5 At last click on the Start button to start programming a If Target Program Verify is selected in the first step a check is done during the programming operation b If Reset after programming box is checked an MCU reset will be launched 3 4 Prerequisite for ULINK2 3...

Страница 17: ...ULINK2 JTAG RESET Pin15 RST on XB board ULINK2 JTAG GND Pin12 GND on XB board ULINK2 JTAG VCC Pin1 3 3V on XB board Figure 3 10 Figure 3 11 Figure 3 12 Connect ULINK2 to PC with USB standard A to mini B cable See Figure 3 9 Connect XB board to PC NB USB port with USB standard A to micro B cable See Figure 3 9 3 4 2 Software Preparation Please follow chapter 4 1 to complete KEIL installation first ...

Страница 18: ...d press right button of you mouse Click Options for Target on the toolbar and select the Debug tab Verify that the correct debug adapter of the XB board ULINK2 ME Cortex Debugger is selected as Figure 3 14 Figure 3 14 After selecting ST Link Debugger click Setting button and then will see the Debug tab if ULINK2 Serial No is seen and SWDIO in SW Device is shown the connection is fine See Figure 3 ...

Страница 19: ...ashing and debugging our own code which is based on SW SDK provide by AcSiP MDK Core MDK Core includes all the components that you need to create build and debug an embedded application for Cortex M processor based microcontroller devices The Pack Installer manages Software Packs that can be added any time to MDK Core This makes new device support and middleware updates independent from the toolch...

Страница 20: ...irements MDK has the following minimum hardware and software requirements A PC running Microsoft Windows 32 bit or 64 bit operating system 4 GB RAM and 8 GB hard disk space 1280 x 800 or higher screen resolution a mouse or other pointing device Install MDK Core Download MDK ARM v5 from www keil com download Product Downloads and run the installer Follow the instructions to install the MDK Core on ...

Страница 21: ...ion but also can be run from μVision using the menu item Project Manage Pack Installer To get access to devices and example projects you should install the Software Pack related to your target device or evaluation board EK S76SXB EK S78SXB board is using this type STM32L073RZ We can update the related packs from Device All Devices STMicroelectronics STM32L0 Series STM32L073 STM32L073RZ STM32L073RZ...

Страница 22: ...May 3 2017 21 of 33 Figure 4 4 4 2 Set up Only for ST LINK V2 Open AcSiP s SDK project in this path Keil AcsipNode ping pong Ping Pong L0 uvprojx Explain how to download in following chapter by launching uVision5 and looks similar to the picture below Figure 4 5 ...

Страница 23: ...ct debug adapter of the XB board ST Link Debugger is selected as Figure 4 6 Figure 4 6 After selecting ST Link Debugger click Setting button and go to Flash Download tab In Programming Algorithm please add a STM32L0 192kB Flash in the dialog just like the below Figure 4 7 Figure 4 7 4 3 Edit Source and Build When uVision5 start and loads with the correct setting mentioned above we can load AcSiP S...

Страница 24: ...oad progress as Figure 4 8 Figure 4 8 2 Download the application typically to on chip Flash ROM of a device 3 Run the application on the target hardware using ST Link debugger 4 Click Run on the debug toolbar to start executing the SDK The detailed information of this chapter can be checked from the below link http www2 keil com docs default source default document library mdk5 getting started pdf...

Страница 25: ...th PC NB by micro USB port we can start to receive UART debug logger messages through micro USB port directly Figure 5 1 The related UART setting please follow these below settings Baud rate 115200 Data bits 8 Stop bits 1 Parity none Flow Control none Forward none 5 1 2 Ping Pong Demonstration Ping Pong can demonstrate two LoRa devices communication behavior and measure the signal strength varying...

Страница 26: ...receives Ping signal as Figure 5 4 Figure 5 4 Eventually the two S76S S78S XB board devices can communicate each other and shows RSSI and SNR information on PC NB terminal by USB interface transferred from UART See Figure 5 5 Figure 5 5 5 1 3 Power Saving User can be well aware that the importance of when a LoRa device can save its power is curial for a mature product So the SDK also provide a dem...

Страница 27: ...rval of power saving mode is given by this parameter POWER_SAVING_INTERVAL therefore user can modify this MARCO value as well to change the default 6 seconds to other value Changeable Parameters in SDK for Power Saving POWER_SAVING_DEMO 1 Enable Power Saving Mode POWER_SAVING_DEMO 0 Disable Power Saving Modes POWER_SAVING_INTERVAL 6 Seconds When S76S S78S entered power saving stop mode the total p...

Страница 28: ... to send receive logs to from PC or sensor board Application can call the related public functions in board c inside AcSiPNode Or AcSiPNode can directly operate LoRa RF interface by calling SX1276 driver functions As mentioned above S76S S78S is using STM32L073 MCU so ST provides the corresponding HAL Hardware Abstractive Layer driver for AcSiPNode board files calling The physical peripheral imple...

Страница 29: ...Product Name Version Doc No Date Page S76S S78S SDK Manual C May 3 2017 28 of 33 Figure 5 8 ...

Страница 30: ...y the network The detailed introduction related resource of LoRaWANTM can be found by these links a https www lora alliance org What Is LoRa LoRaWAN White Papers b https www lora alliance org portals 0 documents whitepapers LoRaWAN101 pdf Please read them first for reviewing some basic LoRa LoRaWAN foundation 6 2 LoRaWAN Open Source For reducing LoRaWAN protocol stack deployment time there re some...

Страница 31: ...ject it always starts from Application layer so user can execute customized peripheral behavior like LoRa ping pong or simple sensor read write data in main c inside src app folders LoRaMac node project provides LoRaWAN stack implementation which is included in LoRaMac c inside src mac folder It implements all LoRaWAN bands behavior like Class A C or different bands EU868 or US915 By the descripti...

Отзывы: