WO2022227411A1 - 一种嵌入式终端远程在线开发系统 - Google Patents

一种嵌入式终端远程在线开发系统 Download PDF

Info

Publication number
WO2022227411A1
WO2022227411A1 PCT/CN2021/122780 CN2021122780W WO2022227411A1 WO 2022227411 A1 WO2022227411 A1 WO 2022227411A1 CN 2021122780 W CN2021122780 W CN 2021122780W WO 2022227411 A1 WO2022227411 A1 WO 2022227411A1
Authority
WO
WIPO (PCT)
Prior art keywords
embedded terminal
program
bios
user
development
Prior art date
Application number
PCT/CN2021/122780
Other languages
English (en)
French (fr)
Inventor
王宜怀
施连敏
章晓芳
姚望舒
刘强
Original Assignee
苏州大学
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 苏州大学 filed Critical 苏州大学
Priority to US17/761,793 priority Critical patent/US20240045672A1/en
Publication of WO2022227411A1 publication Critical patent/WO2022227411A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/77Software metrics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3636Software debugging by tracing the execution of the program
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/37Compiler construction; Parser generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/544Remote

Definitions

  • the invention relates to the technical field of software development and debugging, in particular to an embedded terminal remote online development system.
  • the Internet of Things technology is the product of the collision of computer technology, Internet technology and sensor technology. It connects any item with the Internet through information sensing equipment and according to the agreed protocol to exchange and communicate information to achieve intelligence.
  • a network that identifies, locates, tracks, monitors and manages, and is an extension and extension of the Internet.
  • IoT applications have enabled various complex terminal devices with different application requirements to access the Internet. These terminals are the "source of IoT" of the IoT, and embedded terminals generally have better pertinence, computing power and reliability. It is often small in size and has good tailorability, so it is often the first choice for IoT development terminals. With the increasing demand for remote deployment of terminals, in recent years, the development mode of embedded terminals has shifted from local development to remote development. However, there are few studies on the remote online development system of embedded terminals, and there is a lack of complete systems that can be compatible with different communication modules and embedded terminal types.
  • the software and hardware design of embedded terminals often has a high technical threshold, mainly in the following aspects: software and hardware co-design is required, involving software, hardware and multi-industry domain knowledge; some systems have high real-time requirements; many IoT smart products It must have strong anti-interference and stability; in the development process, it is necessary to continuously carry out joint testing of software and hardware. Therefore, product development based on embedded terminals will have problems such as high cost, long cycle, and difficult to guarantee stability, which also puts forward higher requirements for the comprehensive development ability of technical personnel. In order to integrate common elements in embedded terminal development to improve development efficiency, an efficient hardware and software framework is urgently needed.
  • MCU Microcontroller Unit
  • the present invention aims to solve the problem of high threshold for embedded terminal development, provide a general software and hardware framework, design a remote program update and remote software debugging scheme that can be compatible with different communication modules, and get rid of software debugging and additional hardware. Dependencies, and give a general and efficient integrated development environment.
  • the present invention provides an embedded terminal remote online development system, including:
  • an embedded terminal a cloud forwarding platform and an integrated development environment module
  • the cloud forwarding platform and the integrated development environment module establish a communication connection through the Internet
  • the cloud forwarding platform and the communication module of the embedded terminal establish a connection through a communication base station
  • the The integrated development environment module and the embedded terminal are connected by wire.
  • the hardware platform of the embedded terminal includes a minimum system of a main control chip, a communication module and its peripheral circuits, a power conversion circuit, and an access sensor.
  • both the embedded terminal and the integrated development environment module perform data uplink and downlink with the cloud forwarding platform with a fixed IP address, and the cloud forwarding platform is responsible for data forwarding, thereby completing the connection between the embedded terminal and the integrated development environment module.
  • Information exchange is responsible for data forwarding, thereby completing the connection between the embedded terminal and the integrated development environment module.
  • the integrated development environment module has functions of code editing, code analysis, program compilation, software debugging, software updating, and memory reading and writing.
  • the cloud forwarding platform is responsible for data forwarding between the embedded terminal and the integrated development environment.
  • the cloud forwarding platform includes a cloud server and a developer computer, the server side of the intranet penetration software fast reverse proxy is run on the cloud server, and the intranet penetration software fast reverse proxy is run on the developer computer.
  • the client and cloud forwarder of the reverse proxy map the address and port of the cloud server to the developer's computer.
  • the code editing function includes: writing and deleting of code, line comment and segment comment of code, text search and replace in file, text search and replace in project, code format alignment, variable/function declaration and Jump between definitions.
  • the program compiling function includes: using the GCC compiler that supports multi-language compatibility and target device expansion as a tool, and adopts the GNU cross-compilation mode to complete the program compilation.
  • the integrated development environment module can perform remote update of embedded terminal software, including:
  • the dynamic command function is called by default in the BIOS startup process; in the dynamic command, the program running state is first modified to complete the BIOS residency; secondly, the initialization and interrupt enable of the user serial port are completed; and the corresponding user serial port in the BIOS program interrupt vector table is set.
  • the address of the interrupt service routine is a dynamic command function; finally, the host computer is informed that the relevant initialization steps have been executed, and the program update is started;
  • the host computer starts to send the user program data frame to the user serial port, and the terminal completes the receiving, checking and writing through the dynamic command of the user serial port;
  • the integrated development environment module can perform remote debugging of embedded terminal software, including:
  • the dynamic loading of the software debugging program is realized through the dynamic command system in the BIOS project, and the specific implementation of the necessary functions for debugging is given in the dynamic command;
  • the present invention combines the cloud platform to construct an embedded terminal remote online development system with good universality and flexibility, in order to reduce the development difficulty of the embedded terminal, reduce the repetitive work in the development, shorten the development cycle, and reduce the development cost to help.
  • FIG. 1 shows a structural diagram of an embedded terminal remote online development system according to an embodiment of the present invention.
  • FIG. 2 shows an overall block diagram of an embedded terminal measurement and control system according to an embodiment of the present invention.
  • FIG. 3 shows a schematic diagram of a cloud forwarding program model according to an embodiment of the present invention.
  • FIG. 4 shows a topology diagram of FRP intranet penetration according to an embodiment of the present invention.
  • FIG. 5 shows a schematic diagram of the functional support of the RO-IDE according to an embodiment of the present invention.
  • the integrated development environment is the main development site for developers, and the embedded terminal is the main development object, which are two important parts of the remote online development architecture of embedded terminal.
  • the embedded terminal remote online development system of the present invention is proposed (Embedded Terminals Remote Online Development System, ET-RODS), the architecture is shown in Figure 1, which is mainly divided into three parts: embedded terminal, cloud forwarding platform and integrated development environment.
  • the cloud forwarding platform and the integrated development environment establish a communication connection through the Internet, and establish a connection with the communication module of the embedded terminal through a communication base station, thereby completing the communication between the integrated development environment and the embedded terminal.
  • the cloud forwarding platform and the integrated development environment establish a communication connection through the Internet, and establish a connection with the communication module of the embedded terminal through a communication base station, thereby completing the communication between the integrated development environment and the embedded terminal.
  • it in order to be compatible with the local development mode, it also supports the connection between the integrated development environment and the embedded terminal through wired methods such as serial communication to realize local online development.
  • the hardware platform of the embedded terminal is generally composed of the minimum system of the main control chip, the communication module and its peripheral circuits, the power conversion circuit and other auxiliary circuits.
  • the software part of the embedded terminal generally takes the microcontroller as the core, and the developers design and realize the specific functions, and complete the functions of data acquisition, transmission, storage, control and operation together with the hardware.
  • the cloud forwarding platform is a bridge for data transmission, connecting the embedded terminal and the integrated development environment. It is not only responsible for issuing the instructions of the integrated development environment to the embedded terminal, but also responsible for feeding back the execution of the received instructions by the embedded terminal to the integrated development environment. .
  • the introduction of the cloud forwarding platform is largely due to the fact that the integrated development environment is difficult to connect with the embedded terminal with a fixed IP address. Once the IP address of the integrated development environment changes, it means that the embedded terminal software needs to be updated to a large extent. . It is to solve this problem that the cloud forwarding platform is introduced as a data forwarding server with a fixed IP address. With this bridge, both embedded terminals and integrated development environments can exchange data with the cloud forwarding platform with a fixed IP address. Uplink and downlink, the cloud forwarding platform is responsible for data forwarding, thereby completing the information exchange between the embedded terminal and the integrated development environment.
  • the integrated development environment is the main place for the development of embedded terminal software. It generally has functions such as code editing, code analysis, program compilation, software debugging and program updating. Under the special background of remote online development, functions such as software debugging and program update need to establish a communication connection with the cloud forwarding platform, so as to transmit data to the embedded terminal and complete the corresponding functions.
  • the construction of the hardware platform and the design of the software architecture are the two core parts of the embedded terminal design.
  • the hardware platform provides the basic operating environment for the software architecture, and the software architecture realizes the full utilization of hardware resources through communication with the hardware.
  • the main control chip, the power conversion circuit and the communication-related modules are mainly used to construct the hardware platform, and the external interface design of the hardware components is supplemented to complete the design of the basic measurement and control system.
  • the main control chip of the embedded terminal selects the STM32L431RC chip.
  • the external power supply of the embedded terminal is generally 5V.
  • the most typical power supply method is USB (Universal Serial Bus) power supply, while the working voltage of the chip STM32L432RC is 3.3V, and the power supply voltage of most communication modules also supports 3.3V, so it is necessary to introduce 5V to 3.3V power conversion chip.
  • the present invention selects a low-power power conversion chip TPS70933 with an enable pin.
  • the communication module selected ME3616NB-IoT communication module.
  • the related circuits of the communication module include the minimum system of the communication module, the UART level conversion circuit, the eSIM card circuit, the main antenna and the GNSS antenna circuit, etc. Through the integration of these circuits, the interaction between the MCU and the communication module, and the interaction between the communication module and the remote server is realized.
  • ME3616 minimum system circuit. There are various communication methods between ME3616 and MCU. UART is selected as the communication interface of AT command for data transmission; at the same time, it is connected with eSIM card and antenna, and has firmware upgrade debugging and debugging interface.
  • the working voltage of the UART module of the ME3616 communication module is 1.8V, while the working voltage of the UART module of the corresponding STM32L431RC chip is 3.3V, so a circuit is designed for conversion to realize data communication between serial ports.
  • the ME3616 communication module does not contain a SIM card, and an additional circuit needs to be designed to connect to the communication module.
  • the eSIM card is used as a fixed component to connect to the communication module.
  • the ME3616 communication module has a main antenna and a GNNS antenna module, which are used to enhance signal strength and positioning accuracy, and promote core network attachment, data communication and GPS positioning.
  • the present invention takes the microcontroller as the core, combines the ME3616 communication module to provide the function of remote information transmission, and is supplemented by a power conversion circuit to form a hardware platform.
  • the peripheral interface it is necessary to use the peripheral interface to support the access of sensors and actuators to realize the input and output of signals, so as to realize the measurement and control of the measurement and control system, as shown in Figure 2.
  • the input and output of analog quantity and switch quantity together constitute the realization of the information collection and control function of the measurement and control system.
  • the interface circuit can be designed directly. If only unpackaged sensors or executive equipment components are selected, the packaging design of the corresponding circuit should be completed according to the component design concept, and then the interface circuit design should be carried out to ensure the portability and reproducibility of the peripheral modules. usability.
  • the LCD screen in the external device mainly exchanges information with the MCU through SPI communication, while the communication module in the hardware platform exchanges information with the MCU through serial communication (UART). way to design the corresponding interface circuit.
  • analog input and output devices and switch input and output devices adopt three-wire connection mode in hardware wiring, which are power pins, ground and function pins respectively. parameters of the pin.
  • the LCD liquid crystal display module exchanges data through SPI communication with the MCU.
  • the MISO, MOSI and CLK pins of the SPI, the BLK, DC, and RES pins are also required to connect the GPIO function leads in the MCU. It realizes the reset, backlight, data/command selection and other functions of the LCD liquid crystal display, plus the power line and the ground line to form an eight-pin peripheral interface.
  • the software architecture design of the embedded terminal in the present invention adopts the design idea of the GEC software architecture.
  • the following describes the design of the GEC software framework under the STM32L431RC chip from three aspects: engineering division, space division and function division.
  • the GEC software framework is divided into two parts: BIOS project and User project.
  • BIOS works.
  • the BIOS project is a relatively fixed and complete project, and developers do not need to care about its specific implementation, nor can they interfere with the BIOS project.
  • the BIOS project provides a stable environment that can be rolled back for the User project.
  • BIOS engineering is also the basis for the operation of the rich functions of the GEC framework. Table 5-1 lists the BIOS project structure and the main meaning of each folder.
  • the User project is a developed project in the true sense, and the developer can program it directly without being aware of the existence of the BIOS.
  • the User project is just a general project with a clear folder structure and rich optional functions reserved.
  • the inheritance operation of the interrupt vector table in the BIOS project is also performed.
  • the main steps are as follows:
  • the storage space of the MCU is mainly divided into two parts: Flash and SRAM, so the space division of the GEC software framework is also explained from the two parts of Flash and SRAM.
  • the Flash of the chip is mainly divided into BIOS area and User area.
  • BIOS area is mainly divided into five parts: interrupt vector table, main code area, dynamic command area, component function list area, component function code area;
  • User area is mainly divided into interrupt vector area Table and main code area.
  • the interrupt vector table of the BIOS mainly stores the address of the interrupt service routine function corresponding to each interrupt;
  • the main code area is the Flash space occupied by the conventional project, which mainly includes functions and necessary data in the project;
  • the dynamic command is a reserved Flash space , which is used to dynamically inject temporary code, which is part of the dynamic command system;
  • the component function list area is used to store the calling addresses of each function in the dynamic component library, and the component function code area is used to store the specific implementation of these functions. Both belong to Part of the dynamic component library.
  • the interrupt vector table and main code area in User correspond to the interrupt vector table and main code area in BIOS, and the functions are the same.
  • the SRAM space in the chip is also shared by BIOS and User.
  • the SRAM space is divided into data segment, bss segment, heap segment and stack segment.
  • the data segment stores global variables and static variables that are initialized and whose value is not 0;
  • the bss segment stores uninitialized or initialized global variables and static variables whose value is 0;
  • the heap segment is generally dynamically allocated and released by the programmer
  • the malloc and free functions in C language can be used to dynamically apply and release space in the heap area;
  • the stack segment is automatically allocated by the compiler to save the local variables and parameters in the function.
  • the data segment, bss segment and heap are arranged from low address to high address, and the stack segment is allocated from the high address down.
  • the SRAM space of the microcontroller is relatively limited, and it is also affected by the allocation method of the SRAM space fields, to ensure that the SRAM space of the BIOS and the User is zero-crossed, the SRAM space has to be divided into two parts, but this not only increases the size of the SRAM space.
  • the difficulty of BIOS design seeking the smallest SRAM occupancy in the BIOS) will inevitably lead to the waste of SRAM in the BIOS.
  • the temporary variables in the heap segment and the stack segment in the SRAM space of the BIOS lose their meaning, and due to the dependence of functions such as User program update, the data segment and the bss segment still need to be reserved.
  • the allocation of SRAM space is designed. That is, the BIOS still occupies the entire SRAM space, and the User's SRAM start address is set after the bss segment of the BIOS. In this way, before the BIOS jumps to the User, since the User program is not running at this time, the BIOS can indeed monopolize all the SRAM space; after the BIOS jumps to the User, the BIOS no longer uses the heap segment and stack segment, and the User makes full use of it. SRAM space that is no longer used by the BIOS. Thus, the most full utilization of the SRAM space is achieved.
  • GEC framework The function division of GEC framework is mainly divided into two parts: BIOS project and User project.
  • BIOS project The function of BIOS project.
  • the function of BIOS project is mainly divided into two parts. One is the injection and operation of dynamic functions based on the dynamic command system. The second is to update, reset, terminate and guide the local program for the User project.
  • the local program update of the User project means that the BIOS obtains the machine code of the User project through a certain communication method (usually refers to serial communication), and after erasing the old version of the project, starts writing from the starting address of the specified User program area to Flash. In most cases, the program cannot update itself when it is running. Therefore, when the User project needs to be updated, the operating environment of the system will be switched from the User project to the BIOS project, and the BIOS project will be responsible for subsequent machines. Code reception, verification, and writing. Taking the GEC framework of STM32 as an example, the main steps of updating the local program of the User project are:
  • the integrated development environment (hereinafter referred to as IDE, Integrated Development Environment) sends a handshake signal to the serial port of the target chip; the target chip responds to the IDE's handshake signal; IDE sends the main information of this update to the target chip, after the target chip receives it, do Terminate and erase the preparations such as the current User, and give feedback; IDE starts to send data frames to the target chip, and only continues to send the next data frame after receiving the feedback from the target chip on the current frame; Check after the end data frame of the special mark, and then perform a hot reset after the check is correct, and the BIOS project will guide the subsequent User project.
  • IDE Integrated Development Environment
  • the first is the jump and resident of the BIOS.
  • the serial port interrupt will modify the variables used to mark the update status in the BIOS, and call the soft reset function that comes with the kernel to pull the chip back to the BIOS, and execute the regular User program jump.
  • the gcUpdateFlag variable would be detected, thereby giving up the jump to reside in the BIOS to run.
  • the second is the data frame retransmission mechanism.
  • the current frame may fail to be verified due to factors such as unstable communication.
  • the terminal will re-request the current frame to the IDE to try again until the verification passes or the number of errors exceeds Send error warning after cap.
  • serial port update data frame format is given. As shown in Table 5-3.
  • the main method is to give a cycle composed of After the delay of about one second, you must press the next reset button within this second. Otherwise, after this delay, if the total number of resets is less than six times, the number of resets will be cleared and will not reside in the BIOS. Otherwise, stay.
  • the booting of the User project means that at the initial stage of the target chip's operation, the operating environment of the chip is in the BIOS project. After the BIOS project detects the existence of the User project, or after the BIOS project has just completed a download or update of the User project, the BIOS project will skip. Go to the User project to run. In addition to the variables that update the state with the help of flags, it is also necessary to read the first 32-bit constant in the starting address of the User project (Main Stack Pointer, MSP) and compare it with the maximum value of the chip SRAM space, if it is the same, it means that the User project has been written and can be jumped.
  • MSP Mainn Stack Pointer
  • the function of the User project is a project directly programmed by the developer, and its functions are naturally determined by the developer. Common functions in embedded development include the acquisition and storage of sensor data, the connection and data transmission and reception of the cloud forwarding platform, and the operation of hardware actuators.
  • the cloud forwarding platform completes the forwarding of data, and the program running on the cloud forwarding platform is called the cloud forwarding program.
  • the model of the cloud forwarding program is shown in Figure 3.
  • the cloud forwarding program mainly involves two ports, which are respectively oriented to the embedded terminal and the integrated development environment.
  • the main function of the cloud forwarding program is to forward data between the embedded terminal and the integrated development environment without any data processing.
  • the present invention frees up ten ports from 7000 to 7009 for the cloud server "116.62.63.164" with a fixed IP address to serve these developers. It is used to support developers who use the ET-RODS model of the present invention to conduct initial testing of system construction.
  • the server side of the intranet penetration software Fast Reverse Proxy (FRP) is run, and the address and port of the cloud server are mapped to the developer's computer, so that the developer's computer can act as a temporary cloud forwarder The role of the platform.
  • FRP Fast Reverse Proxy
  • the network principle of using FRP intranet penetration can be understood from Figure 4. Developers can install the cloud forwarding program on their own computer, and at the same time install the FRP client software on this computer, and the FRP client software can establish a connection with the FRP server software on the cloud server.
  • the FRP server software maps the cloud forwarding program of the internal network to the public network IP of the cloud server.
  • the developer computer connected to the external network and the cloud server together form a new cloud forwarding platform, which provides embedded terminals and integrated development environments. Serve. At this point, both the embedded terminal and the integrated development environment can access the cloud forwarding program running on the developer's computer just like accessing the public network IP.
  • Table 5-4 shows the configuration file description of the FRP client.
  • the present invention develops a remote online integrated development environment RO-IDE based on the ET-RODS model.
  • the following design methods will be given from four aspects: function support, basic function design, core function design and extended function interface design.
  • An integrated development environment refers to a collection of modules related to software development functions.
  • An integrated development environment for embedded application development often needs to have functions such as project management, cross-compilation, cross-debugging, and program download.
  • the existing integrated development environment often has the problems of difficult configuration, poor chip versatility and poor compiling adaptability, and the solutions provided for remote online development of different chips of different communication modules are even less. Therefore, the present invention
  • a remote online integrated development environment RO-IDE for embedded application development is proposed.
  • the functional support of RO-IDE is also divided into corresponding three parts: the main function support provided by the general computer-side RO-IDE software framework, the operation execution support provided by the embedded terminal BIOS program, and the cloud forwarding program provided
  • the remote communication support is shown in Figure 5.
  • the software framework of the general computer side can directly exchange information with the embedded terminal through wired connections such as serial communication, so as to carry out local development; it can also use the cloud forwarding program of the cloud forwarding platform as a bridge to perform remote wireless communication with terminal nodes. Information exchange.
  • the RO-IDE software framework on the general computer side is mainly divided into three parts: basic functions, core functions and extended functions.
  • the basic functions mainly include code editing, program compilation and memory reading and writing;
  • the core functions are mainly composed of program update functions and software debugging functions;
  • the extended functions are mainly composed of extended function interfaces to complete the access to additional functions.
  • the cloud forwarding program of the cloud forwarding platform serves as the information exchange bridge between RO-IDE and the terminal node BIOS program. transfer.
  • the BIOS program in the terminal node reserves an interface for interacting with RO-IDE, which is responsible for assisting RO-IDE to perform functions such as memory read and write, program update and software debugging for user programs.
  • RO-IDE is a graphical software written in C# language. Its basic functions mainly refer to completing some basic functions of embedded application development, including project importing and closing, code editing, project directory management, program compilation, memory read and write, etc. The design details of the three parts of code editing, program compilation and memory reading and writing are described below.
  • Code editing functions mainly include code writing and deletion, code line comments and segment comments, text search and replace in files, text search and replace in projects, code format alignment, and jumping between variable/function declarations and definitions. Turn and wait.
  • the present invention based on the use of the open source control ICSharpCode, combines the background requirements of embedded application development, and modifies functions such as text search and replacement, declaration and definition jumping, etc. Considering the nested macro definitions of a huge number of embedded registers during the development of embedded applications, multithreading is used to improve search efficiency when searching for specified text, and regular expressions are used to achieve case sensitivity and whole-word matching query, etc.
  • RO-IDE to support multi-language compatible and target device extended GCC (GNU Compiler Collection) compiler is a tool that uses GNU cross-compilation mode to complete program compilation.
  • GNU suite provides the Make tool to shield GCC instructions and rely on Makefiles instead.
  • the Makefile defines the compilation rules and linking rules, specifies the compilation order of different files, and controls the generation process of the underlying program from the code source file to the executable file.
  • the Makefile also specifies the object files, dependency files and corresponding control instructions generated by compilation.
  • RO-IDE eliminates the disadvantage of reconfiguration every time the project file changes, instead of traversing the project file before each compilation. way to realize the automatic configuration of files contained in each directory.
  • Makefile file directory of the precompiled project call the "make all" command through the cmd window under the Windows system to achieve one-click automatic compilation. And feedback to users in the form of hyperlinks, so that the program can jump to the specific location where errors and warnings are generated after compilation.
  • Memory read and write is a practical tool for developers to check the storage space of the current embedded terminal, and it is also a simple application of dynamic commands. Its main operation logic is: after the general computer software and the embedded terminal BIOS program establish a connection, the host computer software sends the dynamic command package of memory read and write to the BIOS program, and requests the current embedded terminal to access the storage space from the BIOS program. After receiving the address range, the host computer feeds it back to the graphical interface. At this time, the user can start to issue read and write requests to check or modify the content of the corresponding storage space.
  • RO-IDE The core functions of RO-IDE mainly include remote update and remote debugging of embedded terminal software.
  • Remote update methods for embedded terminal software include:
  • the dynamic command function is called by default in the BIOS startup process; in the dynamic command, the program running state is first modified to complete the BIOS residency; secondly, the initialization and interrupt enable of the user serial port are completed; and the corresponding user serial port in the BIOS program interrupt vector table is set.
  • the address of the interrupt service routine is a dynamic command function; finally, the host computer is informed that the relevant initialization steps have been executed, and the program update is started;
  • the host computer starts to send the user program data frame to the user serial port, and the terminal completes the receiving, checking and writing through the dynamic command of the user serial port;
  • the remote debugging methods of embedded terminal software include:
  • the dynamic loading of the software debugging program is realized through the dynamic command system in the BIOS project, and the specific implementation of the necessary functions for debugging is given in the dynamic command;
  • RO-IDE selects the Hex file as the target machine code file.
  • the Hex file has the advantages of small size, easy transmission and easy analysis.
  • the record form of the Hex file is in line units, and each line starts with a colon, followed by the length, offset, record type, valid data, and checksum.
  • Table 5-7 combines specific examples to illustrate the way of parsing Hex files.
  • RO-IDE provides extended function interfaces to realize external tools. call directly. Drawing on the idea of shortcuts, users only need to complete the path configuration of external tools to realize direct invocation in RO-IDE, which improves the scalability of the program to a certain extent.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Stored Programmes (AREA)

Abstract

本发明公开了一种嵌入式终端远程在线开发系统,主要分为嵌入式终端、云转发平台和集成开发环境三部分。在远程在线开发背景下,云转发平台与集成开发环境通过互联网建立通信连接,与嵌入式终端的通信模组通过通信基站等方式建立连接,由此完成集成开发环境与嵌入式终端的通信。同时为了兼容本地开发模式,同样支持集成开发环境与嵌入式终端通过诸如串行通信等有线方式建立连接,实现本地在线开发。结合云平台构建具有良好普适性和灵活性的嵌入式终端远程在线开发系统,为降低嵌入式终端开发难度、减少开发中的重复劳动、缩短开发周期、降低开发成本提供帮助。

Description

一种嵌入式终端远程在线开发系统 技术领域
本发明涉及软件开发与调试技术领域,具体涉及一种嵌入式终端远程在线开发系统。
背景技术
物联网技术是计算机技术、互联网技术和传感器技术等发展碰撞下的产物,它是通过信息传感设备,按照约定的协议,把任何物品与互联网连接起来,进行信息交换和通信,以实现智能化识别、定位、跟踪、监控和管理的一种网络,是互联网基础上的延伸和扩展。
物联网应用的普及使得各种纷繁复杂、具有不同应用需求的终端设备接入互联网,这些终端是物联网的“物联源头”,而嵌入式终端普遍具有较好的针对性、运算能力和可靠性,并且往往体积小、可裁剪性好,因此常常作为物联网开发终端的首选。随着终端远程部署需求的提升,近年来嵌入式终端的开发模式,出现了由本地开发向远程开发转变的趋势。然而针对嵌入式终端远程在线开发系统的研究较少,且缺乏能够兼容不同通信模组和嵌入式终端类型的完备系统。
嵌入式终端的软硬件设计往往具有较高的技术门槛,主要表现在:需要软硬件协同设计,涉及软件、硬件及多行业领域知识;一些系统具有较高的实时性要求;许多物联网智能产品必须具有较强的抗干扰性与稳定性;开发过程中需要不断的进行软硬件联合测试等。因此基于嵌入式终端的产品开发会有成本高、周期长、稳定性难以保证等困扰,对技术人员的综合开发能力也提出了更高的要求。为了整合嵌入式终端开发中的公共要素以提高开发效率,一种高效的软硬件框架正被迫切需要。
国内的嵌入式应用开发中,大部分使用进口的微处理器(Microcontroller Unit,MCU),而嵌入式集成开发环境往往具有芯片相关性,这就给嵌入式开发又增加了新的难题。针对不同MCU的嵌入式开发,开发人员往往需要重新适应不同的集成开发环境。此外嵌入式集成开发环境往往难以提供通用而高效的底层应用支撑,尤其是其针对底层寄存器的配置等问题往往过程繁琐,可操作性差。编译适应性差和程序更新方式单一也是当前嵌入式集成开发环境的两大弊病。
技术问题 技术解决方案
本发明的目的是通过以下技术方案实现的。
基于上述情况,本发明旨在针对嵌入式终端开发门槛高的问题,给出通用的软硬件框架,设计出能够兼容不同通信模组的远程程序更新和远程软件调试方案,摆脱软件调试对额外硬件的依赖,并给出通用而高效的集成开发环境。
具体的,本发明提供了一种嵌入式终端远程在线开发系统,包括:
嵌入式终端、云转发平台和集成开发环境模块;所述云转发平台与集成开发环境模块通过互联网建立通信连接,所述云转发平台与嵌入式终端的通信模组通过通信基站建立连接;所述集成开发环境模块与嵌入式终端通过有线方式建立连接。
进一步地,所述嵌入式终端的硬件平台包括主控芯片最小系统、通信模组及其外围电路、电源转换电路、和接入传感器。
进一步地,所述嵌入式终端和集成开发环境模块都和固定IP地址的云转发平台进行数据的上行和下行,由云转发平台负责数据的转发,由此完成嵌入式终端与集成开发环境模块的信息交互。
进一步地,所述集成开发环境模块具有代码编辑、代码分析、程序编译、软件调试、软件更新、和内存读写功能。
进一步地,所述云转发平台负责数据在嵌入式终端和集成开发环境之间进行数据转发。
进一步地,所述云转发平台包括云服务器和开发者计算机,在所述云服务器上运行内网穿透软件快速反向代理的服务器端,在所述开发者计算机上运行内网穿透软件快速反向代理的客户端和云转发程序,将云服务器地址与端口映射至开发者计算机上。
进一步地,所述代码编辑功能包括:代码的写入与删除、代码的行注释与段注释、文件内的文本查找与替换、工程内的文本查找与替换、代码格式对齐、变量/函数声明和定义之间的跳转。
进一步地,所述程序编译功能包括:以支持多种语言兼容和目标设备扩展的GCC编译器为工具,采用GNU交叉编译模式完成程序的编译。
进一步地,所述集成开发环境模块能够进行嵌入式终端软件的远程更新,包括:
向用户串口发送动态命令数据,并由用户程序写入;
向用户串口发送程序跳转的系统指令,用户程序在接收到指令后,跳转至BIOS;
BIOS启动过程中默认调用动态命令函数;在动态命令内首先修改程序运行状态,完成BIOS的驻留;其次完成用户串口的初始化和中断使能;并设置BIOS程序中断向量表内对应于用户串口的中断服务例程地址为动态命令函数;最后告知上位机,相关初始化步骤已执行完毕,开始程序更新;
上位机开始向用户串口发送用户程序数据帧,终端通过用户串口的动态命令完成接收、校验和写入;
当用户串口的动态命令完成最后一帧数据的处理工作时,修改程序运行状态,复位BIOS,由BIOS基础运行流程完成针对用户程序的后续引导。
进一步地,所述集成开发环境模块能够进行嵌入式终端软件的远程调试,包括:
通过BIOS工程内的动态命令体系实现软件调试程序的动态加载,并在动态命令内给出调试必要函数的具体实现;
借助闪存地址重载及断点单元完成断点的相关设置,并在负责捕获断点的调试监控异常内完成相应调试信息的输出;
通过全速运行、逐语句运行、逐过程运行和暂停模式进行远程软件调试。
有益效果
本发明的优点在于:本发明结合云平台构建具有良好普适性和灵活性的嵌入式终端远程在线开发系统,为降低嵌入式终端开发难度、减少开发中的重复劳动、缩短开发周期、降低开发成本提供帮助。
附图说明
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
附图1示出了根据本发明实施方式的一种嵌入式终端远程在线开发系统结构图。
附图2示出了根据本发明实施方式的一种嵌入式终端测控系统整体框图。
附图3示出了根据本发明实施方式的云转发程序模型示意图。
附图4示出了根据本发明实施方式的FRP内网穿透拓扑图。
附图5示出了根据本发明实施方式的RO-IDE的功能支撑示意图。
本发明的实施方式
下面将参照附图更详细地描述本公开的示例性实施方式。虽然附图中显示了本公开的示例性实施方式,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施方式所限制。相反,提供这些实施方式是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
通过分析嵌入式终端的远程在线开发方式可知,集成开发环境作为开发者的主要开发场所,嵌入式终端作为主要的开发对象,是嵌入式终端远程在线开发架构中重要的两部分。而在远程在线开发的背景下,除了需要在嵌入式终端设备中嵌入通讯模组以外,还需要引入云转发平台来连接嵌入式终端与集成开发环境。由此提出本发明一种嵌入式终端远程在线开发系统(Embedded Terminals Remote Online Development System,ET-RODS),架构如图1所示,主要分为嵌入式终端、云转发平台和集成开发环境三部分。在远程在线开发背景下,云转发平台与集成开发环境通过互联网建立通信连接,与嵌入式终端的通信模组通过通信基站等方式建立连接,由此完成集成开发环境与嵌入式终端的通信。同时为了兼容本地开发模式,同样支持集成开发环境与嵌入式终端通过诸如串行通信等有线方式建立连接,实现本地在线开发。
(1)嵌入式终端。嵌入式终端的硬件平台一般由主控芯片最小系统、通信模组及其外围电路、电源转换电路和其他辅助电路组成,与接入传感器一同构成具有信息采集控制功能的硬件实体。嵌入式终端的软件部分一般以微控制器为核心,由开发者进行具体功能的设计与实现,并联合硬件一同完成数据采集、传输、存储、控制和运算等功能。
(2)云转发平台。云转发平台是数据传输的桥梁,连接着嵌入式终端与集成开发环境,既负责将集成开发环境的指令下达给嵌入式终端,又负责将嵌入式终端对接收指令的执行情况反馈给集成开发环境。云转发平台的引入,很大程度上是由于集成开发环境很难以固定的IP地址与嵌入式终端进行连接,一旦集成开发环境的IP地址发生改变,很大程度上意味着嵌入式终端软件需要更新。正是为了解决这一问题,云转发平台才作为一个具有固定IP地址的数据转发服务器被引入,借助这一桥梁,嵌入式终端和集成开发环境都可以和固定IP地址的云转发平台进行数据的上行和下行,由云转发平台负责数据的转发,由此完成嵌入式终端与集成开发环境的信息交互。
(3)集成开发环境。集成开发环境是嵌入式终端软件开发的主要场所,一般具有代码编辑、代码分析、程序编译、软件调试和程序更新等功能。在远程在线开发的特殊背景下,软件调试和程序更新等功能需要与云转发平台建立通讯连接,以此来将数据传输至嵌入式终端,完成相应的功能。
1 嵌入式终端的设计
硬件平台的搭建和软件架构的设计是嵌入式终端设计的两大核心部分。硬件平台为软件架构提供程序的基本运行环境,软件架构则通过与硬件的沟通实现硬件资源的充分利用。
1.1 嵌入式终端的硬件平台搭建
本发明将以主控芯片、电源转换电路和通信相关模组为主进行硬件平台的搭建,辅以硬件构件的对外接口设计完成基础测控系统的设计。
1. 主控芯片的选型
嵌入式终端的主控芯片选取STM32L431RC芯片。
2. 电源转换电路
嵌入式终端的外部供电一般为5V,最典型的供电方式为USB(Universal Serial Bus)供电,而芯片STM32L432RC的工作电压为3.3V,且多数通信模组的供电电压也支持3.3V,因此需要引入5V转3.3V的电源转换芯片。本发明选取的是具有使能引脚的低功耗电源转换芯片TPS70933。
3. 通信模组选型及电路设计
通信模组选择了ME3616NB-IoT通信模组。通信模组相关电路包含通信模组最小系统、UART电平转换电路、eSIM卡电路及主天线和GNSS天线电路等。通过这些电路融合,实现MCU与通信模组的交互,通信模组与远程服务器之间的交互。
(1)ME3616最小系统电路。ME3616与MCU之间存在多种通信方式,选用UART作为AT指令的通信接口,用于数据传输;同时与eSIM卡和天线进行连接,并具有固件升级调试和调试接口。
(2)UART电平匹配电路。ME3616通信模组的UART模块的工作电压为1.8V,而与之对应的STM32L431RC芯片UART模块的工作电压为3.3V,故设计一个电路进行转换,实现串口之间的数据通信。
(3)eSIM卡电路。ME3616通信模组中不包含SIM卡,需额外设计电路接入通信模组,同时为缩小尺寸,使用eSIM卡作为固定部件接入通信模组中。
(4)主天线和GNSS电路。ME3616通信模组中具有主天线和GNNS天线模块,用于增强信号强度和定位精度,促进核心网附着、数据通信与GPS定位。
4. 基础测控系统的设计
基于前文的硬件选型与设计,本发明以微控制器为核心,结合ME3616通信模组提供远程信息传输的功能,辅以电源转换电路共同构成硬件平台。此外还需借助外设接口对传感器与执行机构接入的支持,实现信号的输入与输出,从而实现测控系统的测量与控制,如图2所示。
模拟量和开关量的输入输出共同构成了测控系统的信息采集与控制功能的实现,在考虑与外接设备的对接时,如果所选取的传感器或执行设备封装完善,则可以直接进行接口电路的设计,若选取的只是未封装的传感器或执行设备元器件,则应按照构件化设计思想,完成相应电路的封装设计,再进行接口电路的设计,以此保证外设模块的可移植性和可复用性。
此外,外接设备中的LCD屏幕主要通过SPI的通信方式与MCU进行信息交互,而硬件平台中的通信模组则通过串行通信(UART)与MCU进行信息交互,二者均需要根据对应的通信方式设计相应的接口电路。
除去集成在硬件平台中的通信模组以外,其余外接设备的接入均需要设计一定的对外接口,以便于各模块的组合应用。由测控系统整体框图可以得知这些外接设备主要包含了模拟量输入输出设备、开关量输入输出设备和LCD屏幕。
其中模拟量输入输出设备和开关量输入输出设备在硬件接线上都采取三线连接方式,分别为电源引脚、地和功能引脚,此外还要考虑这些设备供电需求的不同,合理的设计各供电引脚的参数。而LCD液晶显示屏模块,则通过与MCU之间的SPI通信进行数据交互,除去SPI的MISO、MOSI和CLK三引脚外,还需要BLK、DC、RES三引脚连接MCU中的GPIO功能引脚,实现对LCD液晶显示屏的复位、背光、数据/命令选择等功能的设置,加上电源线和地线,构成八引脚的外设接口。
1.2 嵌入式终端的软件架构设计
本发明针对嵌入式终端的软件架构设计将采用GEC软件架构的设计思想,以下将从工程划分、空间划分和功能划分三个方面阐述STM32L431RC芯片下GEC软件框架的设计。
1. 通用嵌入式计算机框架(General Embedded Computer)GEC软件框架的工程划分
如前文所述,GEC软件框架分为BIOS工程和User工程两部分。
(1)    BIOS工程。BIOS工程是一个相对固定和完备的工程,开发者无需关心其具体实现,也无法干预BIOS工程。作为User工程的前导工程,BIOS工程为User工程提供了一个可以回退的稳定环境。BIOS工程也是GEC框架丰富功能的运行基础。BIOS工程结构及各文件夹主要含义如表5-1所示。
Figure 848782dest_path_image001
(2)User工程。User工程结构及各文件夹主要含义如表5-2所示。
Figure dest_path_image002
User工程是真正意义上的被开发工程,开发者可直接编程,且无需感知BIOS的存在。对开发者而言,User工程只是一个预留了清晰的文件夹结构和丰富的可选功能的一般工程。
特别的,不同于正常的芯片启动步骤,在User工程进行完一系列的系统初始化、转向主函数运行前,还要进行对BIOS工程中中断向量表的继承操作。以STM32的GEC框架为例,主要步骤如下:
首先读取BIOS和User工程的中断向量表并擦除User中断向量表所在扇区;其次将BIOS中断向量表中用于User工程程序更新的串口中断处理函数地址表项,拷贝至读取出的User工程中断向量表的对应处,并写回对应扇区。最后将系统的全局中断向量表指针修改为指向User工程的中断向量表。
2. GEC软件框架的空间划分
MCU的存储空间主要分为Flash和SRAM两部分,因此针对GEC软件框架的空间划分也从Flash和SRAM两部分来说明。
(1)芯片Flash分区。芯片的Flash主要分为BIOS区和User区,BIOS区主要分为五个部分:中断向量表、主要代码区、动态命令区、构件函数列表区、构件函数代码区;User区主要分为中断向量表和主要代码区。
BIOS的中断向量表主要存放了各个中断对应的中断服务例程函数地址;主要代码区为常规工程所占用的Flash空间,主要包含工程内的函数和必要数据;动态命令是预留的一块Flash空间,用于动态注入临时代码,是动态命令体系的一部分;构件函数列表区用于存放动态构件库内各个函数的调用地址,构件函数代码区则用于存放这些函数的具体实现,两者均属于动态构件库的组成部分。
User中的中断向量表和主要代码区与BIOS中的中断向量表和主要代码区相对应,功能一致。
(2)芯片SRAM分区。芯片内的SRAM空间同样要被BIOS和User共同使用。首先对各个工程而言,SRAM空间分为data段、bss段、heap段和stack段。data段中存放初始化过、且数值不为0的全局变量和静态变量;bss段中存放未初始化或初始化过、且数值为0的全局变量和静态变量;heap段一般由程序员动态分配和释放,如使用C语言中的malloc、free函数可用于在堆区动态申请和释放空间;stack段由编译器自动分配,保存函数中的局部变量和参数。其中data段、bss段和heap按照从低地址到高地址的方式排列,stack段则由高地址向下开始分配。
由于微控制器的SRAM空间相对受限,也受SRAM空间字段分配方式的影响,若要保证BIOS和User的SRAM空间零交叉,就不得不将SRAM空间一分为二,但这样不仅加大了BIOS的设计难度(寻求BIOS最小的SRAM占用),也必然导致了BIOS中SRAM的浪费。
在BIOS程序跳转User程序后,BIOS的SRAM空间中的heap段和stack段中的临时变量就失去了存在的意义,而由于User程序更新等功能的依赖,data段和bss段仍需保留。
基于这一点的考虑,设计了SRAM空间的分配。即BIOS仍然占据整个SRAM空间,而User的SRAM起始地址设置在BIOS的bss段之后。这样,BIOS在跳转至User之前,由于此时未运行User程序,BIOS的确可以独占所有的SRAM空间;在BIOS跳转至User之后,BIOS不再使用heap段和stack段,而User便充分利用了BIOS不再使用的SRAM空间。由此,实现了SRAM空间的最充分利用。
3. GEC软件框架的功能划分
GEC框架的功能划分主要分为BIOS工程和User工程两部分考虑。
(1)BIOS工程的功能。BIOS工程的功能主要分为两个部分。一是基于动态命令体系的动态功能的注入与运行。二是针对User工程的本地程序更新、复位、终止和引导。
User工程的本地程序更新是指BIOS通过一定的通信方式(一般指串行通信)获取User工程的机器码,并在擦除旧版工程后,从规定的User程序区域的起始地址开始写入至Flash中。绝大多数情况下的程序无法在运行的情况下对自身进行更新,因此,在User工程出现更新需求时,会将系统的运行环境从User工程切换至BIOS工程,由BIOS工程来负责后续的机器码接收、校验、写入。以STM32的GEC框架为例,User工程本地程序更新的主要步骤是:
由集成开发环境(以下简称IDE,Integrated Development Environment)向目标芯片的串口发送握手信号;目标芯片回应IDE的握手信号;IDE向目标芯片发送本次更新的主要信息,目标芯片收到后,做好终止并擦除当前User等准备工作,并予以反馈;IDE向目标芯片开始发送数据帧,在收到目标芯片对当前帧的反馈后,才继续发送下一个数据帧;在目标芯片收到带有特殊标记的末尾数据帧之后进行校验,校验无误后进行热复位,由BIOS工程进行后续的User工程的引导。
而针对User工程的远程程序更新需要借助动态命令体系来实现。这里还要对本地程序更新中,BIOS框架的几项工作作进一步解释:
首先是BIOS的跳转和驻留。在IDE向芯片发送更新主要信息时,串口中断内会修改BIOS中用于标志更新状态的变量,并调用内核自带的软复位函数来将芯片拉回至BIOS,在执行常规的User程序跳转之前,会检测gcUpdateFlag变量,从而放弃跳转驻留至BIOS内运行。
其次是数据帧重传机制。在更新数据帧的发送、接收和写入过程中,可能由于通信不稳定等因素导致当前帧校验失败,这时终端会向IDE重新请求当前帧再次进行尝试,直至校验通过或错误次数超过上限后发送错误警告。
最后给出串口更新数据帧格式。如表5-3所示。
Figure dest_path_image003
User工程的复位和终止。在实际的开发过程中,User工程可能会出现难以预计的错误导致芯片的运行“死机”。此时如果想要再次尝试运行User工程,则可以借助按键复位的方式使得芯片能够通过热复位回到BIOS工程并重新进行User工程的引导。
但是如果想要进行User工程的更新,此时借助复位,可能只能获得短暂的芯片正常运行的状态,因为User工程的错误仍然存在。这样就难以保证芯片能够正常的进行User工程的更新。此时只能考虑终止当前的User工程,在STM32的GEC框架中,具体的实现是通过快速、连续地触发芯片按键复位6次,使得BIOS工程不再进行对User工程的引导,从而停留在BIOS工程中,不再运行User工程,等待下一次的User工程的更新。这里针对按键复位时间的把控,取消了对定时器这一资源的依赖,使得更多的资源得以保留给User程序的具体应用开发,主要方式是在每一次按键复位后,给予一个由循环构成的一秒左右的延时,在这一秒内必须按下下一次复位按钮,否则在这个延时过后,若总按键复位次数不足六次,则清空按键复位次数,并不驻留至BIOS,反之则驻留。
特别的,在User工程被终止之后,如果在没有进行User工程的更新的情况下,想要重新恢复BIOS工程对User工程的引导,可以通过对目标芯片进行冷复位来实现。
User工程的引导。User工程的引导是指,在目标芯片运行初期,芯片的运行环境处于BIOS工程,在BIOS工程检测到User工程的存在后、或BIOS工程刚刚对User工程完成一次下载或更新后,BIOS工程会跳转至User工程运行。除了借助标志更新状态的变量以外,还需要读取User工程起始地址内的第一个32位常量(Main Stack Pointer,MSP)并与芯片SRAM空间的最大值比较,若相同则标志着User工程已被写入可以进行跳转。
(2)User工程的功能。User工程是开发者直接编程的工程,其功能自然也由开发者决定,嵌入式开发中的常见功能包括传感器数据的采集与存储、云转发平台的连接与数据收发、硬件执行机构的运行等。
2 云转发平台的设计
在嵌入式终端远程在线开发的场景下,由于开发者的PC机难以保证拥有固定的IP地址,终端通信模组也难以直接与集成开发环境进行信息交互,因此需要借助具有固定IP地址的服务器充当云转发平台来完成数据的转发,称在云转发平台上运行的程序为云转发程序。
2.1 云转发程序设计
云转发程序的模型如图3所示。从图中可以得知,云转发程序主要涉及两个端口,分别面向嵌入式终端和集成开发环境。
云转发程序的主要功能就是负责数据在嵌入式终端和集成开发环境之间进行数据转发,并不进行任何的数据处理。
2.2 临时云平台搭建
针对小规模嵌入式应用的开发者缺乏云平台支撑的问题,本发明将具有固定IP地址的云服务器“116.62.63.164”,让出7000~7009十个端口,用于服务这些开发者,同时也用于支持使用本发明ET-RODS模型进行系统搭建初期测试的开发者。在此云服务器上运行了内网穿透软件快速反向代理(Fast Reverse Proxy,FRP)的服务器端,将云服务器地址与端口映射至开发者计算机上,使得开发者的计算机可以充当临时云转发平台的角色。
1. FRP内网穿透
采用FRP内网穿透的网络原理可通过图4来理解。开发者可以将云转发程序安装在自己的计算机上,同时在此计算机上安装FRP客户端软件,FRP客户端软件与云服务器上的FRP服务端软件建立连接。FRP服务端软件将内网的云转发程序映射到云服务器的公网IP上,接入外网的开发者计算机和云服务器一起组成了新的云转发平台,为嵌入式终端和集成开发环境提供服务。此时,嵌入式终端和集成开发环境都可以像访问公网IP那样,访问开发者计算机上运行的云转发程序了。
2. 临时云平台的搭建
在介绍了FRP内网穿透原理后,临时云平台的搭建还需要进行FRP客户端配置文件的修改,表5-4给出了FRP客户端的配置文件说明。
Figure dest_path_image004
在使用表5-4中的配置方式,假设将面向嵌入式终端的本机服务侦听端口和映射到公网端口设置为20315,将面向集成开发环境的本机服务侦听端口和映射到公网端口设置为31213后,云服务器与本地计算机的映射关系便如表5-5所示。
Figure dest_path_image005
此后运行FRP客户端,并在后续的开发中遵循嵌入式终端与“116.62.63.164:20315”交互,集成开发环境与“116.62.63.164:31213”的交互规则即可。
3 集成开发环境的设计
本发明基于ET-RODS模型研发了一款远程在线集成开发环境RO-IDE,以下将从功能支撑、基础功能设计、核心功能设计和扩展功能接口设计四方面给出设计方法。
3.1 RO-IDE的提出和功能支撑
集成开发环境是指软件开发功能相关模组的集合,面向嵌入式应用开发的集成开发环境往往需要具备工程管理、交叉编译、交叉调试、程序下载等功能。然而现有的集成开发环境往往存在着配置困难、芯片通用性差、编译适应性差的问题,针对不同通信模组的不同芯片的远程在线开发所提供的解决方案更是少之又少,因此本发明提出了一款面向嵌入式应用开发的远程在线集成开发环境RO-IDE。
在ET-RODS模型下,RO-IDE的功能支撑同样分为对应的三部分:通用计算机端RO-IDE软件框架提供的主体功能支持、嵌入式终端BIOS程序提供的操作执行支持和云转发程序提供的远程通信支持,如图5所示。
其中通用计算机端的软件框架,既可以通过串行通信等有线连接直接与嵌入式终端进行信息交互,从而进行本地开发;也能够以云转发平台的云转发程序为桥梁,与终端节点进行远程无线的信息交互。
从各部分的功能上来说,通用计算机端的RO-IDE软件框架作为开发的主要场所,主要分为基础功能、核心功能和扩展功能三部分。其中基础功能主要包括代码编辑、程序编译和内存读写等;核心功能主要由程序更新功能和软件调试功能组成;扩展功能则主要由扩展功能接口来完成对额外功能的接入。而云转发平台的云转发程序作为RO-IDE与终端节点BIOS程序的信息交互桥梁,主要负责在进行远程模式下的内存读写、程序更新和软件调试等功能时,进行两者之间的信息传递。而终端节点中的BIOS程序,则预留了与RO-IDE进行交互的接口,负责协助RO-IDE来进行针对用户程序的内存读写、程序更新与软件调试等功能的执行。
3.2 RO-IDE基础功能设计
RO-IDE是使用C#语言编写的一款图形化软件,其基础功能主要是指完成嵌入式应用开发的一些基本功能,主要包括工程的导入与关闭、代码编辑、工程目录管理、程序编译、内存读写等。以下针对代码编辑、程序编译和内存读写三部分进行设计细节阐述。
1. 代码编辑
代码编辑功能主要包括代码的写入与删除、代码的行注释与段注释、文件内的文本查找与替换、工程内的文本查找与替换、代码格式对齐、变量/函数声明和定义之间的跳转等。
针对代码编写的主要窗口,本发明在使用开源控件ICSharpCode的基础上,结合嵌入式应用开发的背景需求,针对文本的查找与替换、声明与定义的跳转等功能进行修改。考虑到嵌入式应用开发过程中,数目庞大的嵌入式寄存器的宏定义嵌套,在指定文本的查找时,采用多线程来提高查找效率,并利用正则表达式来实现大小写敏感和全字匹配查询等功能。
2. 程序编译
RO-IDE以支持多种语言兼容和目标设备扩展的GCC(GNU Compiler Collection)编译器为工具,采用GNU交叉编译模式完成程序的编译。为了提高效率,GNU套件提供了Make工具以屏蔽GCC指令,转而依赖Makefile文件。Makefile文件对编译规则和连接规则进行了定义,规定了不同文件的编译顺序,控制底层程序从代码源文件到可执行文件的生成过程。Makefile文件中还指定了编译生成的目标文件、依赖文件及相应的控制指令。
(1)       Makefile文件模板。RO-IDE出于不同芯片的通用性考虑,为不同芯片提供了通用的Makefile文件模板,使得RO-IDE的程序编译具有一定的芯片适应性,主要格式如表5-6所示。
Figure dest_path_image006
Figure dest_path_image007
Figure dest_path_image008
(2)自动化编译。针对其他嵌入式集成开发环境在程序编译前需要进行繁琐工程配置的问题,RO-IDE消除了每当工程文件发生变更时就需要进行重新配置的弊病,取而代之使用在每次编译前通过遍历工程文件的方式来实现各目录下包含文件的自动配置。并在预编译工程的Makefile文件目录中,通过Windows系统下的cmd窗口来调用“make all”指令,以此来实现一键自动化编译。并以超链接的形式反馈给使用者,来使得程序能够跳转到编译后产生错误与警告等信息的具体位置。
3. 内存读写
内存读写是开发者对于当前嵌入式终端进行存储空间检查的实用工具,也是动态命令的简单应用。其主要运行逻辑是:在通用计算机端软件与嵌入式终端BIOS程序建立连接后,上位机软件向BIOS程序发送内存读写的动态命令程序包,并向BIOS程序请求当前嵌入式终端可访问存储空间的地址范围,上位机接收到后反馈于图形化界面,此时用户可以开始下达读写请求,以此来检查或修改对应存储空间的内容。
3.3 RO-IDE核心功能设计
RO-IDE的核心功能主要包含了嵌入式终端软件的远程更新和远程调试。
嵌入式终端软件的远程更新方法包括:
向用户串口发送动态命令数据,并由用户程序写入;
向用户串口发送程序跳转的系统指令,用户程序在接收到指令后,跳转至BIOS;
BIOS启动过程中默认调用动态命令函数;在动态命令内首先修改程序运行状态,完成BIOS的驻留;其次完成用户串口的初始化和中断使能;并设置BIOS程序中断向量表内对应于用户串口的中断服务例程地址为动态命令函数;最后告知上位机,相关初始化步骤已执行完毕,开始程序更新;
上位机开始向用户串口发送用户程序数据帧,终端通过用户串口的动态命令完成接收、校验和写入;
当用户串口的动态命令完成最后一帧数据的处理工作时,修改程序运行状态,复位BIOS,由BIOS基础运行流程完成针对用户程序的后续引导。
嵌入式终端软件的远程调试方法包括:
通过BIOS工程内的动态命令体系实现软件调试程序的动态加载,并在动态命令内给出调试必要函数的具体实现;
借助闪存地址重载及断点单元完成断点的相关设置,并在负责捕获断点的调试监控异常内完成相应调试信息的输出;
通过全速运行、逐语句运行、逐过程运行和暂停模式进行远程软件调试。
这里进一步针对RO-IDE软件的机器码文件解析工作给出说明。RO-IDE选取Hex文件作为目标机器码文件,相较于Elf文件,Hex文件具有体积小、易传输和易解析等优点。Hex文件的记录形式以行为单位,每行以冒号作为开始符号,依次跟随长度、偏移量、记录类型、有效数据与校验和。表5-7中结合了具体的示例来对Hex文件的解析方式作出了说明。
Figure dest_path_image009
3.4 RO-IDE扩展功能接口设计
在开发过程中,除了集成开发环境以外,开发者可能还会借助形形色色的外部工具,为了适应这样的开发需求同时提供更高的便捷度,RO-IDE中提供了扩展功能接口来实现外部工具的直接调用。借鉴快捷方式的思想,使得用户只需完成一次外部工具的路径配置即可实现在RO-IDE中的直接调用,在一定程度上提高了程序的可扩展性。
以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。

Claims (9)

  1. 一种嵌入式终端远程在线开发系统,其特征在于,包括:嵌入式终端、云转发平台和集成开发环境模块;所述云转发平台与集成开发环境模块通过互联网建立通信连接,所述云转发平台与嵌入式终端的通信模组通过通信基站建立连接;所述集成开发环境模块与嵌入式终端通过有线方式建立连接;所述集成开发环境模块能够进行嵌入式终端软件的远程更新,包括:向用户串口发送动态命令数据,并由用户程序写入;向用户串口发送程序跳转的系统指令,用户程序在接收到指令后,跳转至BIOS;BIOS启动过程中默认调用动态命令函数;在动态命令内首先修改程序运行状态,完成BIOS的驻留;其次完成用户串口的初始化和中断使能;并设置BIOS程序中断向量表内对应于用户串口的中断服务例程地址为动态命令函数;最后告知上位机,相关初始化步骤已执行完毕,开始程序更新;上位机开始向用户串口发送用户程序数据帧,终端通过用户串口的动态命令完成接收、校验和写入;当用户串口的动态命令完成最后一帧数据的处理工作时,修改程序运行状态,复位BIOS,由BIOS基础运行流程完成针对用户程序的后续引导。
  2. 根据权利要求1所述的一种嵌入式终端远程在线开发系统,其特征在于,所述嵌入式终端的硬件平台包括主控芯片最小系统、通信模组及其外围电路、电源转换电路、和接入传感器。
  3. 根据权利要求1所述的一种嵌入式终端远程在线开发系统,其特征在于,所述嵌入式终端和集成开发环境模块都和固定IP地址的云转发平台进行数据的上行和下行,由云转发平台负责数据的转发,由此完成嵌入式终端与集成开发环境模块的信息交互。
  4. 根据权利要求1所述的一种嵌入式终端远程在线开发系统,其特征在于,所述集成开发环境模块具有代码编辑、代码分析、程序编译、软件调试、软件更新、和内存读写功能。
  5. 根据权利要求1所述的一种嵌入式终端远程在线开发系统,其特征在于,所述云转发平台负责数据在嵌入式终端和集成开发环境之间进行数据转发。
  6. 根据权利要求1所述的一种嵌入式终端远程在线开发系统,其特征在于,所述云转发平台包括云服务器和开发者计算机,在所述云服务器上运行内网穿透软件快速反向代理的服务器端,在所述开发者计算机上运行内网穿透软件快速反向代理的客户端和云转发程序,将云服务器地址与端口映射至开发者计算机上。
  7. 根据权利要求4所述的一种嵌入式终端远程在线开发系统,其特征在于,所述代码编辑功能包括:代码的写入与删除、代码的行注释与段注释、文件内的文本查找与替换、工程内的文本查找与替换、代码格式对齐、变量/函数声明和定义之间的跳转。
  8. 根据权利要求4所述的一种嵌入式终端远程在线开发系统,其特征在于,所述程序编译功能包括:以支持多种语言兼容和目标设备扩展的GCC编译器为工具,采用GNU交叉编译模式完成程序的编译。
  9. 根据权利要求4所述的一种嵌入式终端远程在线开发系统,其特征在于,所述集成开发环境模块能够进行嵌入式终端软件的远程调试,包括:通过BIOS工程内的动态命令体系实现软件调试程序的动态加载,并在动态命令内给出调试必要函数的具体实现;借助闪存地址重载及断点单元完成断点的相关设置,并在负责捕获断点的调试监控异常内完成相应调试信息的输出;通过全速运行、逐语句运行、逐过程运行和暂停模式进行远程软件调试。
PCT/CN2021/122780 2021-04-29 2021-10-09 一种嵌入式终端远程在线开发系统 WO2022227411A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/761,793 US20240045672A1 (en) 2021-04-29 2021-10-09 Embedded terminals remote online development system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110472342.3 2021-04-29
CN202110472342.3A CN113110859B (zh) 2021-04-29 2021-04-29 一种嵌入式终端远程在线开发系统

Publications (1)

Publication Number Publication Date
WO2022227411A1 true WO2022227411A1 (zh) 2022-11-03

Family

ID=76720397

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/122780 WO2022227411A1 (zh) 2021-04-29 2021-10-09 一种嵌入式终端远程在线开发系统

Country Status (3)

Country Link
US (1) US20240045672A1 (zh)
CN (1) CN113110859B (zh)
WO (1) WO2022227411A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116455868A (zh) * 2023-03-29 2023-07-18 成都康胜思科技有限公司 一种基于泛域名解析加私有协议内网穿透的集成服务系统
CN116560658A (zh) * 2023-06-29 2023-08-08 睿思芯科(深圳)技术有限公司 基于云技术的芯片集成开发系统
CN117032742A (zh) * 2023-07-07 2023-11-10 珠海市深瑞智联科技有限公司 一种输电线路边与端监测设备的软件升级方法及系统
CN117376229A (zh) * 2023-12-08 2024-01-09 成都菁蓉联创科技有限公司 基于嵌入式设备的ftp文件系统软件交叉调试方法及系统

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113110859B (zh) * 2021-04-29 2024-05-17 苏州大学 一种嵌入式终端远程在线开发系统
CN113741411B (zh) * 2021-11-08 2022-02-01 西安热工研究院有限公司 一种分散控制系统全局变量点产物文件生成方法和系统
CN114518868B (zh) * 2022-02-15 2023-09-22 中航机载系统共性技术有限公司 一种嵌入式开发方法、装置、设备及介质
CN115086169A (zh) * 2022-05-23 2022-09-20 宿迁学院产业技术研究院 一种基于5g nr的远程程序更新方法和系统

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5497456A (en) * 1992-12-31 1996-03-05 Intel Corporation Apparatus for transferring information between an interrupt producer and an interrupt service environment
US20070043833A1 (en) * 2005-08-22 2007-02-22 Inventec Corporation Computer platform system program remote upgrading control method and system
US20150154017A1 (en) * 2012-08-21 2015-06-04 Wuhan Telecommunication Devices Co., Ltd. In-application upgrade method for optical module firmware not breaking service
CN106952425A (zh) * 2017-02-15 2017-07-14 深圳市新国都支付技术有限公司 一种终端远程升级方法和pos终端
CN111756858A (zh) * 2020-07-03 2020-10-09 潍柴动力股份有限公司 嵌入式设备的远程开发处理系统、方法及装置
CN112416443A (zh) * 2020-11-16 2021-02-26 苏州大学 实现实时操作系统在嵌入式架构下的驻留方法
CN113110859A (zh) * 2021-04-29 2021-07-13 苏州大学 一种嵌入式终端远程在线开发系统

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5497456A (en) * 1992-12-31 1996-03-05 Intel Corporation Apparatus for transferring information between an interrupt producer and an interrupt service environment
US20070043833A1 (en) * 2005-08-22 2007-02-22 Inventec Corporation Computer platform system program remote upgrading control method and system
US20150154017A1 (en) * 2012-08-21 2015-06-04 Wuhan Telecommunication Devices Co., Ltd. In-application upgrade method for optical module firmware not breaking service
CN106952425A (zh) * 2017-02-15 2017-07-14 深圳市新国都支付技术有限公司 一种终端远程升级方法和pos终端
CN111756858A (zh) * 2020-07-03 2020-10-09 潍柴动力股份有限公司 嵌入式设备的远程开发处理系统、方法及装置
CN112416443A (zh) * 2020-11-16 2021-02-26 苏州大学 实现实时操作系统在嵌入式架构下的驻留方法
CN113110859A (zh) * 2021-04-29 2021-07-13 苏州大学 一种嵌入式终端远程在线开发系统

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116455868A (zh) * 2023-03-29 2023-07-18 成都康胜思科技有限公司 一种基于泛域名解析加私有协议内网穿透的集成服务系统
CN116455868B (zh) * 2023-03-29 2023-11-07 成都康胜思科技有限公司 一种基于泛域名解析加私有协议内网穿透的集成服务系统
CN116560658A (zh) * 2023-06-29 2023-08-08 睿思芯科(深圳)技术有限公司 基于云技术的芯片集成开发系统
CN116560658B (zh) * 2023-06-29 2024-02-06 睿思芯科(深圳)技术有限公司 基于云技术的芯片集成开发系统
CN117032742A (zh) * 2023-07-07 2023-11-10 珠海市深瑞智联科技有限公司 一种输电线路边与端监测设备的软件升级方法及系统
CN117032742B (zh) * 2023-07-07 2024-05-28 长园智联科技(珠海)有限公司 一种输电线路边与端监测设备的软件升级方法及系统
CN117376229A (zh) * 2023-12-08 2024-01-09 成都菁蓉联创科技有限公司 基于嵌入式设备的ftp文件系统软件交叉调试方法及系统
CN117376229B (zh) * 2023-12-08 2024-02-06 成都菁蓉联创科技有限公司 基于嵌入式设备的ftp文件系统软件交叉调试方法及系统

Also Published As

Publication number Publication date
US20240045672A1 (en) 2024-02-08
CN113110859B (zh) 2024-05-17
CN113110859A (zh) 2021-07-13

Similar Documents

Publication Publication Date Title
WO2022227411A1 (zh) 一种嵌入式终端远程在线开发系统
CN100565472C (zh) 一种适用于多处理器核系统芯片的调试方法
CN102087609B (zh) 多处理器平台下的动态二进制翻译方法
CN101667154A (zh) 用于改善片上仿真系统中高级语言的仿真速度的装置和方法
US20070168905A1 (en) Networked linux machine and windows software development system
CN103544100A (zh) 便携数据处理设备应用程序的测试方法、系统和客户端
CN101267623A (zh) 一种手机启动引导的构建方法
CN116301880A (zh) 微控制单元中的指令响应方法、装置、电子设备及介质
CN102722438B (zh) 一种内核调试的方法和设备
US20060075310A1 (en) Microcomputer and trace control method capable of tracing desired task
CN112363950B (zh) 应用程序的调试方法及装置
KR101394225B1 (ko) 다중 언어로 개발된 어플리케이션을 위한 프로파일링 수행 시스템 및 이를 이용한 프로파일링 방법
CN109800007A (zh) Dsp芯片在线升级方法以及装置
CN110262349A (zh) 一种c8051f系列单片机的远程在线编程方法及系统
Kurniawan et al. Introduction to wireless sensor networks
Lee et al. Integrated IoT programming with selective abstraction
Cormack The rump kernel: A tool for driver development and a toolkit for applications
Bakhshi et al. Mosen: a middleware for mobile sensor programming
Viarheichyk Embedded Programming with Modern C++ Cookbook: Practical recipes to help you build robust and secure embedded applications on Linux
Takaso et al. Component Framework for Multiprocessor Real-Time Operating Systems
Cohen et al. Android Application Development for the Intel Platform
CN111294985A (zh) 一种基于4g的便携式矿灯通信系统、通信方法及构建方法
Ge et al. Design and implementation of intelligent control system based on embedded linux
CN216848733U (zh) 一种新型嵌入式调试设备
Wahba et al. Initiating a design pattern catalog for embedded network systems

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 17761793

Country of ref document: US

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21938874

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21938874

Country of ref document: EP

Kind code of ref document: A1