DSGW-030 SDK Quick Start Guide V1.5发表时间:2022-08-20 11:08
SDK Quick Start Guide Product Name: Smart Router Gateway Model Name: DSGW-030
Revision History
Approvals
1. IntroductionThis Quick Start Guide explains the basics: how to connect and set up your target on the network; how to install the SDK; and how to build the firmware images. The Linux Software Developer's Kit (SDK) is an embedded hardware and software suite that enables Linux developers to create applications on Dusun's DSGW-030 gateway.
2. Gateway Information2.1 Basic informationProcessor: MTK7688 (MIPS24KEc(580MHZ)) Supply: DC-5V ZigBee: EFR32MG1B232F256G Z-Wave: ZGM130S037HGN Bluetooth: ERF32BG21 RAM: DDR2 128MB NAND Flash: 16MB
2.2 Interface
3. Target SetupThis section describes how to connect the gateway into your host computer and network. 3.1 Connecting a gateway - Power3.1.1 Make sure that the power adapter is 5V/2A. 3.1.2 Select the appropriate power plug adaptor for your geographical location. Insert it into the slot on the Universal Power Supply; then plug the power supply into an outlet. 3.1.3 Connect the output plug of the power supply to the gateway 3.2 Connecting a gateway – LAN portConnect gateway to a router for loging
Figure3-1. Connecting a gateway via Ethernet port 4. UART connection to gatewayBefore you set up your development test bed, please connect the PCB serial port to your develop PC via USB-to-serial bridge.
PCB serial port on Gateway
USB-to-serial bridge.
Serial port setting: Baud rate: 57600 Bits: 8 Stop Bits: 1 Hardware flow control: None
5. Compile the Environment to Build5.1 OpenWrt VersionTake OpenwWRT19.07 as an example 5.2 PC Compile the Environment to BuildCompilation environment: ubuntu Linux Openwrt's compilation tool is automatically generated by SDK built, no additional installation is required 5.3 OpenWrt configuration and compilationGet the source code from Dusun FTP server or github and uncompress it under your work directory. Github link: https://github.com/openwrt/openwrt.git Checkout to correct branch after clone, take OpenWRT19.07 as an example, git checkout openwrt-19.07 git branch –a
4.3.1 DTS file About DTS file for connecting to Dusun gateway’s hardware, please download in Dusun FTP server. Then move it to the right directory mv DSI0177.dts target/linux/ramips/dts/ c) Add the component in file vi target/linux/ramips/image/mt76x8.mk
4.3.2 Configure compilation options a) Configure compilation options There is already a default configuration in the SDK, which satisfies the basic functions of routing. Customers could also customize the configuration according to their own needs. Command: cd <work_dir>/openwrt/ make menuconfig Choose system (MediaTek Ralink MIPS)
Select Subtarget MT76x8 based boards
Choose target profile DSI0177
If user want to change kernel configuration make kernel_menuconfig
b) Change network configuration i. Change LAN configuration to avoid the conflict vi package/base-files/files/bin/config_generate In line 104, change the IP to 192.168.66.1
vi target/linux/ramips/base-files/etc/board.d/02_networkIn line 489, set the interface name to wlan0 and eth0,
In line 53, add the code in following picture to disable Firewall,
Just use command 'make V=16', the image built will take a long time.
The target image will be under ./openwrt/bin/targets/ramips/mt76x8/ Image used for update is openwrt-ramips-mt76x8-DSI0177-squashfs-sysupgrade.bin
d) Flash firmware to gateway following section 11 System firmware upgrade Then log in gateway using ssh,
6. Openwrt restore to factory settingCommand: umount /dev/mtdblock6; firstboot Press 'y' to confirm and then reboot system.
7. Openwrt Add kernel patchesThe tool Quilt can be used to add patches. For detailed steps to add patch to the linux kernel, please follow the guide of tool.
8. Change partitions in the systemUser can edit file in vi ./ target/linux/ramips/dts/DSI0177.dts to change partitions in the system.
9. Add APP component in OpenwrtTake openwrt-sdk/package/dusun/lib_dusun as an example, If user want to add a new user lever application into openwrt SDK, just follow the example. After code is ready, you still need to add it to config file by "make menuconfig", and select Dusun
Select libdusun package,
Exit and save config, 'make V=99' again, you can get the image with libdusun 10. uboot build and upgrade1. uboot configuration and build
On development PC: cd Uboot make You get uboot.img 2. uboot upgrade Setup tftp server on the development PC, and put uboot.img under tftp root directory.
Make sure connect the board to PC via serial port, reset board and press '9' when current uboot is booting up. Follow the steps in the console:
The uboot.img will be downloaded to the board and upgraded, then automatically reset to boot new uboot:
11. Communication between zigbee moduleUser can obtained the zigbee module’s NCP program in simplicity studio, the module number is EFR32MG1B232F256G
For detailed information to flash image to the zigbee module, please refer to document ZIGBEE MODULE FLASH FIRMWAREv1.0 For SDK to develop program in gateway, please refer to document API Reference for EmberZNet PC Host It can be found in the ss5’s directory of C:\SiliconLabs\SimplicityStudio\v4_3\developer\sdks\gecko_sdk_suite\v2.7\protocol\zigb ee\documentation
12. System firmware upgradea) Using sysupgrade in gateway scp user@serverip:~/openwrt-ramips-mt7688-mt7688-squashfs-sysupgrade.bin /tmp/ sysupgrade -n /tmp/openwrt-ramips-mt7688-mt7688-squashfs-sysupgrade.bin b) Using LUCI web server in gateway
c) Using Uboot method Please refer to document update gateway using uboot.pdf
13. OthersFor more information, please visit OpenWRT official website.
声明:此篇为东胜物联原创文章,转载请标明出处链接:https://www.hzdusun.com/h-nd-48.html
|