KR101640207B1 - Bootloader and embedded system upgrade method - Google Patents

Bootloader and embedded system upgrade method Download PDF

Info

Publication number
KR101640207B1
KR101640207B1 KR1020150009034A KR20150009034A KR101640207B1 KR 101640207 B1 KR101640207 B1 KR 101640207B1 KR 1020150009034 A KR1020150009034 A KR 1020150009034A KR 20150009034 A KR20150009034 A KR 20150009034A KR 101640207 B1 KR101640207 B1 KR 101640207B1
Authority
KR
South Korea
Prior art keywords
host
boot loader
communication
application program
upgrading
Prior art date
Application number
KR1020150009034A
Other languages
Korean (ko)
Inventor
류대우
Original Assignee
주식회사 뉴티씨 (Newtc)
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 주식회사 뉴티씨 (Newtc) filed Critical 주식회사 뉴티씨 (Newtc)
Priority to KR1020150009034A priority Critical patent/KR101640207B1/en
Application granted granted Critical
Publication of KR101640207B1 publication Critical patent/KR101640207B1/en

Links

Images

Classifications

    • 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/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

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

Abstract

A bootloader and a method of upgrading an embedded system are disclosed. According to an embodiment of the present invention, a bootloader embedded in an embedded system to upgrade an application program recorded in a memory includes: a system initializing unit initializing hardware installed on the embedded system; and an upgrading unit communicating with a host PC through a communication module, downloading an application program image to be upgraded, and upgrading the application program. A communication code transmitted to the host PC by the upgrading unit can be set as 2 to 4 bytes, and the communication code can be transmitted by a communication protocol of the communication module.

Description

부트로더 및 임베디드 시스템 업그레이드 방법{Bootloader and embedded system upgrade method}Boot loader and embedded system upgrade method {Bootloader and embedded system upgrade method}

본 발명은 부트로더 및 임베디드 시스템 업그레이드 방법에 관한 것이다.
The present invention relates to a boot loader and a method for upgrading an embedded system.

대표적인 8비트 마이크로컨트롤러에는 8051, PIC, AVR이 있다. Typical 8-bit microcontrollers include 8051, PIC, and AVR.

이 중 AVR은 미국 ATMEL사에서 개발한 8비트 마이크로컨트롤러로서, 보다 진보된 RISC 구조를 표방하고 있는 고성능, 저전력을 요하는 프로세서이다. AVR은 하버드 아키텍처(Harvard Architecture)를 채택하여 프로그램을 위한 시스템 어드레스 버스와 데이터를 위한 데이터 어드레스 버스를 분리하여 CPU의 처리 속도를 극대화하고 있다. Among them, AVR is an 8-bit microcontroller developed by Atmel of the United States. It is a high-performance, low-power processor that exhibits a more advanced RISC architecture. AVR employs the Harvard Architecture to maximize CPU throughput by isolating the system address bus for the program and the data address bus for the data.

AVR에서는 자기 프로그래밍(Self-Programming) 명령을 지원한다. 이 명령의 도움으로 AVR은 메모리의 여러 영역들을 읽고 쓸 수 있다. 경우에 따라서는 EEPROM 영역까지도 쓰고 읽을 수 있다. AVR supports self-programming commands. With the help of this command, the AVR can read and write various areas of memory. In some cases, even the EEPROM area can be written and read.

도 1은 AVR의 플래시 메모리 영역을 나타낸 도면이고, 도 2는 BOOTRST, BOOTSZ 퓨즈 비트를 나타낸 도면이며, 도 3은 부트로더의 동작 과정을 나타낸 도면이다. FIG. 1 shows a flash memory area of an AVR, FIG. 2 shows BOOTRST and BOOTSZ fuse bits, and FIG. 3 shows a boot loader operation process.

도 1을 참조하면, AVR의 메모리 영역은 RWW(Read-While-Write) 섹션(10)과 NRWW(No-Read-While-Write) 섹션(20)으로 나뉜다. 표면적으로 RWW 섹션(10)은 쓰기와 동시에 읽기가 가능한 메모리 영역이고, NRWW 섹션(20)은 그렇지 않은 메모리 영역을 나타낸다. Referring to FIG. 1, the memory area of the AVR is divided into a read-while-write (RWW) section 10 and a no-read-while-write (NRWW) section 20. On the surface, the RWW section 10 is a memory area that can be read simultaneously with writing, and the NRWW section 20 represents a memory area that is not.

이는 NRWW 섹션(20)은 자기 프로그래밍 명령으로는 기록될 수 없고, 반드시 외부 다운로드 장비(예를 들면, ISP, JTAG 등)를 이용하여야 프로그래밍될 수 있음을 의미한다. This means that the NRWW section 20 can not be written with magnetic programming instructions and can only be programmed using external download equipment (e.g., ISP, JTAG, etc.).

부트로더(Bootloader)는 NRWW 섹션(20)에 위치하게 되는데, 그 이유는 부트로더가 RWW 섹션(10)에 있을 경우, 자기 프로그래밍 명령에 의해 실행되는 부트로더 코드가 덮어씌워질 수 있기 때문이다.The boot loader is located in the NRWW section 20 because if the boot loader is in the RWW section 10, the boot loader code executed by the magnetic programming command can be overwritten.

부트로더의 실행 과정은 다음과 같다. The execution process of the boot loader is as follows.

AVR에서는 BOOTRST 퓨즈 및 BOOTSZ 퓨즈로 부팅 위치를 설정한다(도 2 참조). The AVR sets the boot location with a BOOTRST fuse and a BOOTSZ fuse (see FIG. 2).

일반적으로 AVR은 리셋 버튼을 누를 때 0x00 번지에서부터 시작한다. 하지만, BOOTRST 퓨즈가 활성화되어 있을 때에는, 0x00 번지가 아닌 BOOTSZ에서 가리키는 곳으로 시작 지점이 변경된다. 그리고 BOOTSZ는 시작 주소와 함께 NRWW 섹션의 크기를 결정하는 역할을 수행한다. Normally, the AVR starts at address 0x00 when the reset button is pressed. However, when the BOOTRST fuse is active, the starting point is changed to the point indicated by BOOTSZ instead of address 0x00. BOOTSZ is responsible for determining the size of the NRWW section along with the start address.

즉, 도 2에 도시된 것과 같이, BOOTSZ가 Bootflash size=512 words로 되어 있을 경우, NRWW 섹션이 512 워드(=1024 바이트)이고, BOOTRST가 켜져 있을 경우, 0x00 번지가 아닌 0xFE00 번지에서부터 명령어를 읽어오는 것이다. 2, when the BOOTSZ is set to Bootflash size = 512 words, when the NRWW section is 512 words (= 1024 bytes) and BOOTRST is on, the command is read from the address 0xFE00 instead of the address 0x00 Coming.

이 때 NRWW 섹션(20)에서 데이터를 받아 이것을 페이지 버퍼에 기록한 뒤, 이 페이지에 쓰는 방식으로 RWW 섹션(10)에 기록한다. 그 후 기록된 메모리에서 실행할 수 있도록, 0x00 번지로 점프하는 코드를 추가로 수행해야 한다. At this time, the NRWW section 20 receives the data, writes the data to the page buffer, and writes the data to the RWW section 10 in a manner of writing to the page buffer. Thereafter, a code for jumping to address 0x00 must be additionally executed so that it can be executed in the recorded memory.

데이터는 보통 USART를 통하여 받지만, 몇몇 부트로더의 경우 SPI 통신을 써서 수행하기도 한다. USART 및 SPI 통신과 조합하여 블루투스 및 WLAN(주로 SPI 사용)에서 데이터를 받아 기록할 수도 있다. Data is usually received via the USART, but for some bootloaders it may be done using SPI communications. Combined with USART and SPI communications, it can also receive and record data from Bluetooth and WLAN (mainly using SPI).

AVR 부트로터의 경우 별도의 ISP 장비 없이 프로그램을 쉽게 내려받을 수 있어 대학 교육용 및 초심자들이 처음 사용하는 용도로 쓰이고, 별도의 ISP 장비를 들고 다닐 수 없는 환경에서 부트로더를 사용하여 코드를 내려받고 실행한다. In case of AVR bootloader, it is easy to download program without ISP equipment. It is used for the first time for university education and novice. It can download the code using boot loader in the environment where it can not carry around with ISP equipment. do.

다만 부트로더만으로는 한계가 있다. 먼저 AVR 디버깅 같은 경우, JATG가 디버깅을 수행하는 과정에서 메모리 전체를 다시 덮어쓰게 되어 이 과정에서 미리 기록된 부트로더가 삭제될 수 있다. ISP로 다운로드하는 것 역시 마찬가지이다. However, the boot loader alone has its limitations. First, in the case of AVR debugging, JATG overwrites the entire memory in the process of debugging, so that the pre-recorded boot loader can be deleted in this process. The same is true for downloading to an ISP.

그리고 부트로더는 메모리 용량을 차지하는 프로그램이므로, 프로그램의 크기가 클 경우 부트로더 영역을 침범하게 되는데, 이를 조정하게 되면 AVR 스펙에 나와있는 메모리 용량을 모두 사용할 수 없는 문제가 발생한다. Since the boot loader is a program that occupies memory capacity, if the size of the program is large, it invades the boot loader area. If the size of the program is large, the memory capacity shown in the AVR specification can not be used.

전술한 배경기술은 발명자가 본 발명의 도출을 위해 보유하고 있었거나, 본 발명의 도출 과정에서 습득한 기술 정보로서, 반드시 본 발명의 출원 전에 일반 공중에게 공개된 공지기술이라 할 수는 없다.The above-described background technology is technical information that the inventor holds for the derivation of the present invention or acquired in the process of deriving the present invention, and can not necessarily be a known technology disclosed to the general public prior to the filing of the present invention.

부트로더에 관련된 선행기술로는 한국공개특허 제10-2010-0136111호(휴대용 단말기에서 디버깅을 위한 부팅 방법 및 장치)에는 부트로더 영역과 운영체제 영역이 중복되지 않도록 부팅하는 기술이 개시되어 있다.
As a prior art related to the boot loader, Korean Patent Laid-Open No. 10-2010-0136111 (boot method and apparatus for debugging in a portable terminal) discloses a technique of booting so that the boot loader area and the operating system area do not overlap each other.

한국공개특허 제10-2010-0136111호Korean Patent Publication No. 10-2010-0136111

본 발명은 연결 시 자동 다운로드가 비활성화되어 기존 헥사(HEX) 파일을 보존하고, 통신 프로토콜을 변화시켜 PC x86 아키텍처의 메모리 구조와의 호환성을 높여 안정적인 동작이 가능하도록 한 부트로더 및 임베디드 시스템 업그레이드 방법을 제공하기 위한 것이다.The present invention relates to a boot loader and an embedded system upgrading method which enables stable operation by enhancing compatibility with a memory structure of a PC x86 architecture by preserving a conventional HEX file by deactivating automatic download upon connection and changing a communication protocol .

본 발명은 로그 세분화를 통해 사용자 편의성을 높이고, 다운로드 후 레지스터를 리셋하여 잠재적인 호환성 문제를 줄인 부트로더 및 임베디드 시스템 업그레이드 방법을 제공하기 위한 것이다.The present invention is intended to provide a boot loader and an embedded system upgrade method which improves user convenience through log segmentation and resets registers after downloading to reduce potential compatibility problems.

본 발명의 이외의 목적들은 하기의 설명을 통해 쉽게 이해될 수 있을 것이다.
Other objects of the present invention will become readily apparent from the following description.

본 발명의 일 측면에 따르면, 임베디드 시스템에 내장되어 메모리에 기록된 응용 프로그램을 업그레이드하는 부트로더에 있어서, 상기 임베디드 시스템에 설치되어 있는 하드웨어를 초기화시키는 시스템 초기화부; 및 통신 모듈을 통해 호스트 PC와 통신하여 업그레이드할 응용 프로그램 이미지를 다운로드하여 상기 응용 프로그램을 업그레이드하는 업그레이드부를 포함하되, 상기 통신 모듈을 통한 통신 프로토콜에 의해 상기 업그레이드부가 상기 호스트 PC로 전송하는 통신 코드가 2 내지 4바이트(byte)로 설정된 것을 특징으로 하는 부트로더가 제공된다. According to an aspect of the present invention, there is provided a boot loader built in an embedded system for upgrading an application program recorded in a memory, the system comprising: a system initialization unit for initializing hardware installed in the embedded system; And an upgrading unit for communicating with the host PC through the communication module to upgrade the application program to download the application program image to be upgraded, wherein the communication code transmitted by the upgrading unit to the host PC according to the communication protocol through the communication module And the boot loader is set to 2 to 4 bytes.

상기 업그레이드부는 상기 호스트 PC와의 통신이 완료되면 통신을 위해 설정한 레지스터를 리셋할 수 있다.When the communication with the host PC is completed, the upgrading unit can reset the register set for communication.

상기 업그레이드부는 상기 응용 프로그램을 업그레이드한 후 자동으로 상기 통신 모듈을 통한 통신 연결 수립을 해제할 수 있다.The upgrading unit may automatically cancel establishment of a communication connection through the communication module after upgrading the application program.

USB 전원 공급 기능이 있는 통신포트가 상기 통신 모듈에 연결되는 경우, 설정값에 따라 상기 업그레이드부의 활성화 여부를 제어하는 자동실행 제어부를 더 포함할 수 있다.And an automatic execution control unit for controlling activation of the upgrading unit in accordance with a set value when a communication port having a USB power supply function is connected to the communication module.

한편 본 발명의 다른 측면에 따르면, 임베디드 시스템에 내장되어 메모리에 기록된 응용 프로그램을 업그레이드하는 부트로더에서 수행하는 시스템 업그레이드 방법으로서, 상기 부트로더가 시작되면 시스템 초기화를 수행하고, 부트로더 시작 메시지를 호스트 PC로 전송하는 단계; 상기 호스트 PC로부터 전송이 제대로 이루어졌음을 알리는 응답 메시지를 수신하면, 상기 임베디드 시스템에 대한 장치 정보를 취합하여 장치 정보 전송 메시지에 뒤이어 순차적으로 전송하는 단계; 상기 장치 정보에 대응하여 상기 호스트 PC로부터 바이트 수(ByteCount) 숫자 및 주소(Address)를 포함하는 쓰기 명령을 수신하는 단계; 상기 쓰기 명령에 상응하여 상기 호스트 PC로부터 상기 응용 프로그램을 업그레이드하기 위한 데이터를 수신하는 단계; 수신한 상기 데이터를 상기 응용 프로그램이 저장된 메모리에 덮어쓰는 단계; 및 데이터 덮어쓰기가 완료되면 상기 호스트 PC로 쓰기 완료 메시지를 전송하는 단계를 포함하는 시스템 업그레이드 방법이 제공된다. According to another aspect of the present invention, there is provided a system upgrading method implemented by a boot loader that is built in an embedded system and upgrades an application program recorded in a memory, the method comprising: initializing the system when the boot loader is started; To a host PC; Receiving a response message informing that the transmission from the host PC is properly performed, collecting the device information of the embedded system, and sequentially transmitting the device information transmission message following the device information transmission message; Receiving a write command including a byte number and an address from the host PC corresponding to the device information; Receiving data for upgrading the application program from the host PC in accordance with the write command; Overwriting the received data in a memory in which the application program is stored; And transmitting a write completion message to the host PC when data overwriting is completed.

상기 장치 정보는 바이트 수, 페이지 크기, 프로세서 ID, 메모리 크기, 부트로더 시작 번지 중 하나 이상을 포함하는 2 내지 4바이트로 이루어진 정보를 포함할 수 있다.The device information may include information consisting of 2 to 4 bytes including at least one of a byte count, a page size, a processor ID, a memory size, and a boot loader start address.

상기 호스트 PC는 상기 쓰기 명령에 상응하는 데이터 전송 시에 바이트를 지속적으로 더하고 0xFF를 넘어가는 경우 오버플로우 처리를 통해 1바이트만을 남기는 방식으로 원본 체크섬을 구하고, 상기 부트로더에서 전송된 상기 쓰기 완료 메시지의 바로 뒤 바이트에 더해진 쓰기 체크섬과 비교하여 일치 여부를 확인하며, 일치하지 않을 경우 데이터 전송을 재시도할 수 있다.The host PC continuously adds bytes at the time of data transmission corresponding to the write command and when the number of bytes exceeds 0xFF, the host PC obtains the original checksum by leaving only one byte through overflow processing, To compare the write checksum with the write checksum added to the byte immediately after the data byte, and to retry the data transfer if they do not match.

전술한 것 외의 다른 측면, 특징, 이점이 이하의 도면, 특허청구범위 및 발명의 상세한 설명으로부터 명확해질 것이다.
Other aspects, features, and advantages will become apparent from the following drawings, claims, and detailed description of the invention.

본 발명의 실시예에 따르면, 연결 시 자동 다운로드가 비활성화되어 기존 헥사 파일을 보존하고, 통신 프로토콜을 변화시켜 PC x86 아키텍처의 메모리 구조와의 호환성을 높여 안정적인 동작이 가능하도록 한 효과가 있다.According to the embodiment of the present invention, automatic downloading during connection is disabled, existing hex file is saved, communication protocol is changed, compatibility with the memory structure of PC x86 architecture is improved, and stable operation is enabled.

또한, 로그 세분화를 통해 사용자 편의성을 높이고, 다운로드 후 레지스터를 리셋하여 잠재적인 호환성 문제를 줄인 효과가 있다.
In addition, log segmentation improves user convenience and resets registers after downloading to reduce potential compatibility issues.

도 1은 AVR의 플래시 메모리 영역을 나타낸 도면,
도 2는 BOOTRST, BOOTSZ 퓨즈 비트를 나타낸 도면,
도 3은 부트로더의 동작 과정을 나타낸 도면,
도 4는 본 발명의 일 실시예에 따른 부트로더를 포함하는 임베디드 시스템의 구성도,
도 5는 본 발명의 일 실시예에 따른 시스템 업그레이드 방법의 순서도,
도 6은 본 발명의 일 실시예에 따른 호스트 PC에 설치되는 클라이언트 프로그램의 예시를 나타낸 도면.
1 shows a flash memory area of an AVR,
2 shows a BOOTRST, BOOTSZ fuse bit,
3 is a diagram illustrating an operation process of the boot loader,
4 is a configuration diagram of an embedded system including a boot loader according to an embodiment of the present invention;
5 is a flowchart of a system upgrade method according to an embodiment of the present invention;
6 is a diagram illustrating an example of a client program installed in a host PC according to an embodiment of the present invention;

본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세한 설명에 상세하게 설명하고자 한다. 그러나 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다.While the invention is susceptible to various modifications and alternative forms, specific embodiments thereof are shown by way of example in the drawings and will herein be described in detail. It is to be understood, however, that the invention is not to be limited to the specific embodiments, but includes all modifications, equivalents, and alternatives falling within the spirit and scope of the invention.

어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다. It is to be understood that when an element is referred to as being "connected" or "connected" to another element, it may be directly connected or connected to the other element, . On the other hand, when an element is referred to as being "directly connected" or "directly connected" to another element, it should be understood that there are no other elements in between.

본 명세서에서 사용한 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 본 발명을 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 명세서에서, "포함하다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The singular expressions include plural expressions unless the context clearly dictates otherwise. In this specification, the terms "comprises" or "having" and the like refer to the presence of stated features, integers, steps, operations, elements, components, or combinations thereof, But do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, or combinations thereof.

제1, 제2 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다.The terms first, second, etc. may be used to describe various components, but the components should not be limited by the terms. The terms are used only for the purpose of distinguishing one component from another.

또한, 명세서에 기재된 "…부", "…모듈" 등의 용어는 적어도 하나의 기능이나 동작을 처리하는 단위를 의미하며, 이는 하드웨어나 소프트웨어 또는 하드웨어 및 소프트웨어의 결합으로 구현될 수 있다.Also, the terms " part, "" module," and the like, which are described in the specification, mean a unit for processing at least one function or operation, and may be implemented by hardware or software or a combination of hardware and software.

또한, 각 도면을 참조하여 설명하는 실시예의 구성 요소가 해당 실시예에만 제한적으로 적용되는 것은 아니며, 본 발명의 기술적 사상이 유지되는 범위 내에서 다른 실시예에 포함되도록 구현될 수 있으며, 또한 별도의 설명이 생략될지라도 복수의 실시예가 통합된 하나의 실시예로 다시 구현될 수도 있음은 당연하다.It is to be understood that the components of the embodiments described with reference to the drawings are not limited to the embodiments and may be embodied in other embodiments without departing from the spirit of the invention. It is to be understood that although the description is omitted, multiple embodiments may be implemented again in one integrated embodiment.

또한, 첨부 도면을 참조하여 설명함에 있어, 도면 부호에 관계없이 동일한 구성 요소는 동일하거나 관련된 참조부호를 부여하고 이에 대한 중복되는 설명은 생략하기로 한다. 본 발명을 설명함에 있어서 관련된 공지 기술에 대한 구체적인 설명이 본 발명의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우 그 상세한 설명을 생략한다.
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Reference will now be made in detail to the preferred embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the like elements throughout. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. In the following description, well-known functions or constructions are not described in detail since they would obscure the invention in unnecessary detail.

도 4는 본 발명의 일 실시예에 따른 부트로더를 포함하는 임베디드 시스템의 구성도이고, 도 5는 본 발명의 일 실시예에 따른 시스템 업그레이드 방법의 순서도이다. FIG. 4 is a configuration diagram of an embedded system including a boot loader according to an embodiment of the present invention, and FIG. 5 is a flowchart of a system upgrade method according to an embodiment of the present invention.

본 발명의 일 실시예에 따른 부트로더(110)는 통신 프로토콜을 변화시켜 다양한 코드들이 전송될 수 있도록 하면서도 PC와 같은 호스트 PC(200)의 x86 아키텍처의 메모리 구조와의 호환성을 높여 안정적인 동작이 가능하도록 한 것을 특징으로 한다. The boot loader 110 according to the embodiment of the present invention can exchange various codes by changing the communication protocol, while enhancing the compatibility with the memory structure of the x86 architecture of the host PC 200 such as a PC, .

본 실시예에서 임베디드 시스템(100)은 마이크로컨트롤러(MCU)로서, 예를 들면 8비트 마이크로컨트롤러인 AVR인 경우를 가정하여 설명하기로 하지만, AVR 이외에도 RENESAS, ARM Cortex-M 시리즈, Cortex-R 시리즈, Cortex-A시리즈 CPU 등과 같이 다양한 CPU에 해당할 수도 있음은 물론이다. In the present embodiment, the embedded system 100 is a microcontroller (MCU), for example, an AVR which is an 8-bit microcontroller. However, in addition to AVR, RENESAS, ARM Cortex-M series, Cortex- , A Cortex-A series CPU, and the like.

도 4를 참조하면, 임베디드 시스템(100)은 부트로더(110), 응용 프로그램(120), 통신 모듈(130)을 포함한다. Referring to FIG. 4, the embedded system 100 includes a boot loader 110, an application program 120, and a communication module 130.

부트로더(110)는 메모리의 NRWW 섹션(20)에 탑재되고, 응용 프로그램(120)은 RWW 섹션(10)에 탑재될 수 있다. The boot loader 110 may be mounted on the NRWW section 20 of the memory and the application program 120 may be mounted on the RWW section 10. [

응용 프로그램(120)은 임베디드 시스템(100)에 내장되어, 하드웨어와 소프트웨어를 작동시켜 미리 정해진 기능을 수행하도록 작성된 프로그램으로, 예를 들면 펌웨어(firmware)일 수 있다. The application program 120 is a program embedded in the embedded system 100 and designed to perform predetermined functions by operating hardware and software, and may be, for example, firmware.

부트로더(110)는 ISP와 같은 프로그래머 장비를 이용하지 않고서도 통신 모듈(130)을 통해 임베디드 시스템(100)의 메모리에 기록되어 있는 응용 프로그램(120)을 업그레이드한다. The boot loader 110 upgrades the application program 120 recorded in the memory of the embedded system 100 through the communication module 130 without using a programmer device such as an ISP.

통신 모듈(130)은 임베디드 시스템(100)과 호스트 PC(200) 사이를 연결하여 데이터 송수신이 가능하게 하는 모듈로서, 예를 들면, UART, USB, CAN, 이더넷, USART 등의 통신 방식이 적용되어 있을 수 있다. The communication module 130 connects the embedded system 100 and the host PC 200 to enable data transmission and reception. For example, a communication method such as UART, USB, CAN, Ethernet, or USART is applied Can be.

부트로더(110)는 기본적으로 시스템 초기화부(112) 및 업그레이드부(114)를 포함한다. 실시예에 따라서는 자동실행 제어부(116)를 더 포함할 수 있다. The boot loader 110 basically includes a system initialization unit 112 and an upgrading unit 114. And may further include an automatic execution control unit 116 according to an embodiment.

시스템 초기화부(112)는 임베디드 시스템(100)이 동작할 수 있도록 임베디드 시스템(100)에 설치되어 있는 하드웨어를 초기화하는 기능을 수행한다. 예를 들면, 통신 모듈(130)을 초기화하여 호스트 PC(200)와의 통신이 수립되도록 할 수 있을 것이다. The system initialization unit 112 initializes the hardware installed in the embedded system 100 so that the embedded system 100 can operate. For example, the communication module 130 may be initialized and communication with the host PC 200 may be established.

시스템 초기화부(112)는 임베디드 시스템(100)에 하드웨어적으로 구현되어 있는 리셋 버튼의 눌림 여부에 따라 구동될 수 있다. 즉, 리셋 버튼이 눌려지는 경우 시스템을 초기화하라는 리셋 명령으로 인식하고, 시스템 초기화부(112)가 구동될 수 있다. The system initialization unit 112 may be driven depending on whether a reset button that is implemented in hardware in the embedded system 100 is pressed or not. That is, when the reset button is pressed, the system initialization unit 112 can be recognized as a reset command to initialize the system.

업그레이드부(114)는 통신 모듈(130)을 통해 호스트 PC(200)와 통신하여, 메모리에 저장된 응용 프로그램(120)을 업그레이드한다. 호스트 PC(200)와의 통신 시에 간단한 사용자 인터페이스를 제공해주고, 업그레이드할 응용 프로그램 이미지를 주고 받을 수 있다. The upgrading unit 114 communicates with the host PC 200 through the communication module 130 to upgrade the application programs 120 stored in the memory. A simple user interface is provided at the time of communication with the host PC 200, and an application program image to be upgraded can be exchanged.

업그레이드부(114)는 시스템 초기화부(112)의 구동 이후에 자동적으로 활성화되는 것이 아니라 별도의 동작을 통해 활성화될 수 있다. The upgrading unit 114 may be activated after the system initialization unit 112 is activated, but may be activated through a separate operation.

예를 들면, 임베디드 시스템(100)에 하드웨어적으로 구현되어 있는 다운로드 버튼의 눌림 여부에 따라 활성화 여부가 결정될 수 있다. 혹은 호스트 PC(200)에 설치된 클라이언트 프로그램(210) 내에 소프트웨어적으로 구현되어 있는 다운로드 버튼의 선택 여부에 따라 활성화 여부가 결정될 수도 있다. For example, activation or non-activation may be determined depending on whether a download button that is implemented in hardware in the embedded system 100 is pressed. Or whether or not the download button implemented in software in the client program 210 installed in the host PC 200 is selected.

업그레이드부(114)에서 시스템 업그레이드를 위한 데이터 다운로드를 위해서는, 임베디드 시스템(100)과 호스트 PC(200) 간에는 데이터 교환을 위한 통신 프로토콜이 정의될 필요가 있다. In order to download data for upgrading the system in the upgrading unit 114, a communication protocol for data exchange needs to be defined between the embedded system 100 and the host PC 200. [

기존의 부트로더들은 바이너리 크기를 줄이기 위해 통신 코드들을 1바이트 크기로 줄여 사용하고 있다. 하지만, 본 실시예에 따른 부트로더(110)에서는 통신 코드들을 2 내지 4바이트로 설정하여 좀 더 다양한 코드들을 전송할 수 있도록 하고 있다. 또한, 호스트 PC(200)의 x86 아키텍처의 메모리 구조와의 호환성을 높여 안정적인 동작이 가능하도록 한다.
Conventional bootloaders use communication codes to reduce the size of the binary to 1 byte. However, in the boot loader 110 according to the present embodiment, communication codes are set to 2 to 4 bytes so that more various codes can be transmitted. In addition, compatibility with the memory structure of the x86 architecture of the host PC 200 is enhanced to enable stable operation.

도 5를 참조하면, 업그레이드부(114)에서 수행되는 시스템 업그레이드 방법이 도시되어 있다. Referring to FIG. 5, a system upgrade method performed by the upgrading unit 114 is illustrated.

우선 부트로더(110)가 시작되면(단계 300), 시스템 초기화를 수행하고, 부트로더 시작 메시지를 단 1번 호스트 PC(200)로 전송한다(단계 305). 부트로더 시작 메시지는 2 내지 4바이트로 설정된다. 단, 전에 입력된 프로그램 코드가 없을 경우 0번지부터 계속하여 올라가다가 결국 부트로더가 실행되고, 계속 부트로더가 실행되는 것처럼 보일 수 있다. First, when the boot loader 110 is started (step 300), the system initialization is performed and the boot loader start message is transmitted to the host PC 200 only once (step 305). The boot loader start message is set to 2 to 4 bytes. However, if there is no program code previously input, the boot loader will be continuously executed from 0th place, and the boot loader may continue to be executed.

호스트 PC(200)는 부트로더 시작 메시지를 수신한 경우, 전송이 제대로 이루어졌음을 알리는 응답 메시지를 전송한다(단계 310). 여기서, 응답 메시지는 1바이트로 설정된다. If the host PC 200 receives the boot loader start message, the host PC 200 transmits a response message indicating that the transfer has been properly performed (step 310). Here, the response message is set to 1 byte.

부트로더(110)는 응답 메시지를 수신한 경우, 임베디드 시스템(100)에 대한 장치 정보를 취합하여 전송한다(단계 315). 바이트 수, 페이지 크기, 프로세서 ID, 메모리 크기, 부트로더 시작 번지와 같은 장치 정보가 장치 정보 전송 메시지에 뒤이어 순차적으로 전송될 수 있다. When the boot loader 110 receives the response message, the boot loader 110 collects and transmits the device information of the embedded system 100 (step 315). The device information such as the number of bytes, the page size, the processor ID, the memory size, and the boot loader start address may be sequentially transmitted following the device information transmission message.

바이트 수는 무결성 확인을 위해 존재하는 장치 정보로서, 구조체의 크기를 대입한다. 페이지 크기는 부트로더(110)가 실제 쓰기 동작을 수행하는 단위인 페이지의 크기로서, 바이트 단위로 보내진다. 프로세서 ID는 현재 임베디드 시스템(100)의 식별정보(ID)로서, 임베디드 시스템(100)마다 고유한 값을 가질 수 있다. 메모리 크기는 현재 메모리 크기를 킬로바이트(KB, KiloByte) 단위로 나타낸다. 부트로더 시작 번지는 현재 구동 중인 부트로더(110)의 시작 번지를 나타낸다. The number of bytes is the device information that exists for integrity verification, and substitutes the size of the structure. The page size is the size of a page, which is the unit in which the boot loader 110 performs the actual write operation, and is sent in bytes. The processor ID is identification information (ID) of the current embedded system 100, and may have a value unique to each embedded system 100. Memory size indicates the current memory size in kilobytes (KB, KiloByte). The boot loader start address indicates the start address of the currently boot loader 110.

장치 정보들 역시 장치 정보 전송 메시지와 마찬가지로 2 내지 4바이트로 구성될 수 있다. The device information may also be composed of 2 to 4 bytes as in the device information transmission message.

호스트 PC(200)는 장치 정보를 수신하면, 이에 맞추어 쓰기 명령을 전송한다(단계 320). 쓰기 명령 시에는 바이트 수(ByteCount) 숫자를 알려준다. 만약 바이트 수 숫자가 미리 지정된 2바이트 코드(예를 들어, 0xFFFF)라면 데이터 전송이 끝났음을 의미한다. Upon receiving the device information, the host PC 200 transmits a write command in accordance with the device information (step 320). The write command tells the number of bytes (ByteCount). If the number of bytes is a predetermined 2 byte code (for example, 0xFFFF), it means that the data transmission is finished.

그리고 바이트 수가 끝났을 경우, 그 즉시 메모리에 저장될 수 있도록 주소(Address)도 전송한다. When the number of bytes ends, the address is also sent so that it can be immediately stored in memory.

바이트 수 숫자는 2바이트로 구성되고, 주소는 2 내지 4바이트로 구성된다. The number of bytes consists of two bytes, and the address consists of two to four bytes.

그리고 주소 전송이 완료되면, 시스템 업그레이드를 위한 데이터를 전송한다(단계 325). When the address transmission is completed, data for system upgrade is transmitted (step 325).

시스템 업그레이드 데이터는 HEX 파일인 경우 호스트 PC(200)에서 내부적으로 Bin 데이터로 변환하여 전송할 수 있다. If the system upgrade data is a HEX file, the host PC 200 internally converts the system upgrade data into Bin data and transmits the data.

그리고 전송 시에 원본 체크섬을 계산한다(단계 330). 원본 체크섬은 인텔 HEX 표준에서 계산하는 것과 같이, 바이트를 지속적으로 더하고, 오버플로우를 통하여 자동으로 1바이트가 되는 방식으로 계산될 수 있다. And the original checksum is calculated at transmission (step 330). The original checksum can be computed in such a way that the bytes are added continuously, as calculated by the Intel HEX standard, and are automatically one byte through the overflow.

업그레이드부(114)는 호스트 PC(200)로부터 데이터를 전송받은 경우, 메모리에 데이터를 기록한다(단계 335). 데이터 기록은 신규 쓰기 혹은 기 저장된 데이터의 덮어쓰기일 수 있다. When the upgrade unit 114 receives the data from the host PC 200, it records the data in the memory (step 335). The data recording may be new writing or overwriting of the stored data.

그리고 데이터 기록이 완료되면 쓰기 작업이 완료되었음을 알리는 쓰기 완료 메시지를 전송한다(단계 340). When the data recording is completed, a write completion message indicating that the write operation is completed is transmitted (step 340).

쓰기 완료 메시지의 바로 뒤 바이트에 1바이트 크기의 쓰기 체크섬을 더할 수 있다. 호스트 PC(200)는 쓰기 체크섬을 가지고 자신이 계산한 원본 체크섬과 일치하는지를 확인(단계 345)한 뒤 일치하지 않을 경우 데이터 전송을 다시 시도할 수 있다. You can add a byte-wide write checksum to the byte immediately after the write completion message. The host PC 200 checks whether the write checksum matches the original checksum calculated by the host computer 200 (step 345), and if not, the host PC 200 can retry the data transfer.

업그레이드부(114)는 호스트 PC(200)와의 통신이 완료되면, 통신을 위해 설정한 레지스터를 리셋할 수 있다. 통신에 이용된 레지스터를 리셋함으로써 잠재적인 호환성 문제를 줄일 수 있게 된다. When the communication with the host PC 200 is completed, the upgrading unit 114 can reset the register set for communication. By resetting the registers used for communication, potential compatibility problems can be reduced.

또한, 업그레이드부(114)는 시스템 업그레이드 이후에는 자동으로 통신 모듈(130)을 통한 통신 연결 수립을 해제할 수 있다. In addition, the upgrading unit 114 may automatically cancel the communication connection establishment through the communication module 130 after the system upgrade.

예를 들어, UART 통신 모니터링 테스트를 위해 프로그래머가 만든 HEX 파일 다운로딩 이후에, 다시 임베디드 시스템(100)에서 연결을 끊어주고, 모니터링할 터미널에서 연결을 해줘야 하는 불편함에서 해방될 수 있게 된다. For example, after downloading the HEX file created by the programmer for the UART communication monitoring test, the embedded system 100 can be disconnected from the inconvenience of disconnecting the connection again from the terminal to be monitored.

즉, UART 통신 모니터링 테스트를 하기 위하여 본인이 만든 HEX 파일 다운로딩 이후에, 자동으로 연결을 끊어주므로, 모니터링할 터미널에서만 연결을 해주면 후속 작업이 원활히 수행될 수 있게 된다.
In other words, after downloading the HEX file that I created to do the UART communication monitoring test, the connection is automatically disconnected so that the follow-up work can be performed smoothly by connecting only at the terminal to be monitored.

다시 도 4를 참조하면, 부트로더(110)는 자동실행 제어부(116)를 더 포함할 수 있다. Referring again to FIG. 4, the boot loader 110 may further include an automatic execution controller 116.

자동실행 제어부(116)는 초기 상태에서 USB 전원 공급 기능이 있는 통신포트가 통신 모듈(130)에 연결되는 경우 부트로더(110)는 자동 실행되지만 시스템 업그레이드를 위한 데이터 다운로드가 시작되지 않도록 제어할 수 있다. 즉, 설정값에 따라 업그레이드부(114)가 비활성화된 상태를 유지하도록 할 수 있다. When the communication port having the USB power supply function is connected to the communication module 130 in the initial state, the automatic execution controller 116 automatically controls the boot loader 110 so as to prevent the data download for the system upgrade from being started have. That is, the upgrade unit 114 can maintain the inactivated state according to the set value.

자동실행 설정은 호스트 PC(200)의 클라이언트 프로그램에서 버튼 누름과 같은 간단한 조작을 통해 수행될 수 있다. The automatic execution setting can be performed through a simple operation such as a button push in the client program of the host PC 200. [

기존의 부트로더들은 초기 상태에서 USB 전원 공급 기능이 있는 통신포트가 연결되는 경우 부트로더가 자동 실행되어 기존 버전의 HEX 파일을 덮어쓰게 되는 일이 발생하는 문제점이 있었다. The conventional boot loaders have a problem in that when the communication port having the USB power supply function is connected in the initial state, the boot loader is automatically executed and the existing version of the HEX file is overwritten.

따라서, 본 실시예에서는 자동실행 제어부(116)를 두어 호스트 PC(200)와 연결은 수립되지만 데이터 다운로드를 하지 않도록 함으로써, 원치 않는 시스템 업그레이드가 수행되는 것을 방지할 수 있다. Therefore, in this embodiment, the automatic execution control unit 116 is provided so that connection with the host PC 200 is established, but data downloading is not performed, thereby preventing unwanted system upgrading from being performed.

부트로더(110)는 자체적으로 레지스터 혹은 변수의 값을 보여주거나, 브레이크 기능 등 디버깅 기능을 내장할 수도 있다.
The boot loader 110 may display the value of a register or a variable itself, or may include a debugging function such as a break function.

도 6은 본 발명의 일 실시예에 따른 호스트 PC에 설치되는 클라이언트 프로그램의 예시를 나타낸 도면이다. 6 is a diagram illustrating an example of a client program installed in a host PC according to an embodiment of the present invention.

클라이언트 프로그램에는 HEX 파일 선택 부분, 통신 속도 설정 부분, 작업 부분, 설정 부분, 진행 상황 표시 부분이 포함되어 있다. Client program includes HEX file selection, communication speed setting part, work part, setting part and progress indication part.

HEX 파일 선택 부분을 통해 호스트 PC에서 임베디드 시스템으로 전송할 데이터인 HEX 파일을 직접 선택할 수 있게 된다. HEX file selection allows you to directly select a HEX file that is data to be transferred from the host PC to the embedded system.

통신 속도 설정 부분을 통해 직렬 포트 및 통신 속도를 선택하여 원활한 통신이 이루어지도록 할 수 있다. It is possible to select the serial port and the communication speed through the communication speed setting part so that the communication can be smoothly performed.

작업 부분에서는 프로그램 다운로드 및 실행 버튼을 통해 호스트 PC와 임베디드 시스템 간에 통신 연결이 수립되더라도 자동적으로 다운로드가 실행되지 않고, 해당 버튼이 선택되어 눌려진 경우에 한해 다운로드가 실행되도록 함으로써 임베디드 시스템에 설치된 기존 HEX 파일이 실수로 지워지는 것을 방지할 수 있게 된다. Even if a communication connection is established between the host PC and the embedded system through the program download and execution button in the work portion, the download is not automatically executed, but the download is executed only when the corresponding button is selected and pressed. Thus, It is possible to prevent erasure by mistake.

설정 부분에서는 언어 설정이 가능하여, 사용자 인터페이스를 구성하는 언어를 사용자가 쉽게 알 수 있는 언어로 변경할 수 있게 한다. In the setting section, the language can be set, and the language constituting the user interface can be changed to a language easily understood by the user.

또한, 임베디드 시스템이 리셋되는 경우 자동 다운로드가 이루어지게 할 것인지에 대해서 체크박스를 통해 설정이 가능하도록 함으로써, 자동실행 제어부가 해당 체크박스의 체크 여부에 따라 동작할 수 있게 한다. In addition, whether the automatic download is to be performed when the embedded system is reset can be set through a check box so that the automatic execution control unit can operate according to whether or not the check box is checked.

그리고 진행 상황 표시 부분을 통해 프로그램 다운로드 시에 진행 상황을 보여주어 다운로드 완료 시간을 예측할 수 있도록 해 줄 수 있다.
The progress indicator can be used to show the progress of downloading the program, so that the download completion time can be predicted.

본 실시예에 따른 부트로더(110)는 일련의 동작을 취하면 펌웨어/소프트웨어를 최신 버전으로 갱신하며, 외부의 호스트 PC(200)에서 펌웨어/소프트웨어를 다운로드하는 업데이트 동작을 수행하게 된다. When the boot loader 110 according to the present embodiment performs a series of operations, the firmware / software is updated to the latest version, and an update operation for downloading the firmware / software from the external host PC 200 is performed.

별도의 업데이트 서버가 지정되어 있는 윈도우 업데이트와는 달리 호스트 PC(200) 쪽의 소프트웨어에서 업그레이드를 위한 파일을 받아오는 위치를 지정할 수 있고, 오프라인 업데이트가 가능하다. Unlike a window update in which a separate update server is designated, the host PC 200 can designate a location for receiving a file for upgrade from the software of the host PC 200, and can update it offline.

또한, 파일 포맷은 HEX 혹은 BIN 이며, 오류 검사 루틴이 수신 바이트를 가지고 체크섬 계산을 수행하고 있기에, 해시 값 확인을 수행하는 윈도우 업데이트와는 차별화된다. Also, since the file format is HEX or BIN and the error checking routine is performing the checksum calculation with the received bytes, it differs from the window update that performs hash value checking.

또한, 본 실시예에 따른 부트로더(110)의 경우 로그가 세분화되어 있고, 리스트 박스가 아닌 텍스트 형식으로 로그를 제작하여 다른 프로그램으로의 복사/붙여넣기가 가능하여 버그 체크 및 기술 지원이 용이할 수 있다. In addition, in the case of the boot loader 110 according to the present embodiment, the log is divided, and a log can be produced in a text format instead of a list box, so that copying / pasting to other programs is possible, .

본 실시예에 따른 호스트 PC(200)의 클라이언트 프로그램(210)은 HEX 파일의 무결성을 검사하여, HEX 파일이 여러가지 이유로 손상되어 오류가 있을 경우 손상되었음을 알리는 메시지를 띄울 수 있다. The client program 210 of the host PC 200 according to the present embodiment checks the integrity of the HEX file and may launch a message indicating that the HEX file is corrupted if the HEX file is corrupted due to various reasons.

또한, 본 실시예에서는 호스트 PC(200)에서 부트로더(110)로 암호화된 HEX 파일을 전송하고, 부트로더(110)에서 이를 복호화할 수도 있다. Also, in the present embodiment, the HEX file encrypted by the boot loader 110 may be transmitted from the host PC 200, and the HEX file may be decoded by the boot loader 110.

또한, 부트로더 전송 후에 로딩 완료 이후에, 호스트 PC(120)의 부트로더용 클라이언트 내부의 자체 통신 프로그램을 활성화하여, 편리하게 직렬 통신모드 및 부트로더 다운로더 모드를 자유자재로 변경할 수 있도록 할 수도 있다.
In addition, after completion of loading after the boot loader transfer, the self communication program inside the client for the boot loader of the host PC 120 may be activated to freely change the serial communication mode and the boot loader downloader mode .

상기에서는 본 발명의 실시예를 참조하여 설명하였지만, 해당 기술 분야에서 통상의 지식을 가진 자라면 하기의 특허 청구의 범위에 기재된 본 발명의 사상 및 영역으로부터 벗어나지 않는 범위 내에서 본 발명을 다양하게 수정 및 변경시킬 수 있음을 이해할 수 있을 것이다.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention without departing from the spirit or scope of the invention as defined in the following claims And changes may be made without departing from the spirit and scope of the invention.

100: 임베디드 시스템 110: 부트로더
120: 응용 프로그램 130: 통신 모듈
112: 시스템 초기화부 114: 업그레이드부
116: 자동실행 제어부
200: 호스트 PC 210: 클라이언트 프로그램
100: embedded system 110: boot loader
120: Application program 130: Communication module
112: System initialization unit 114:
116:
200: Host PC 210: Client program

Claims (7)

임베디드 시스템에 내장되어 메모리에 기록된 응용 프로그램을 업그레이드하는 부트로더에 있어서,
상기 임베디드 시스템에 설치되어 있는 하드웨어를 초기화시키는 시스템 초기화부; 및
통신 모듈을 통해 호스트 PC와 통신하여 업그레이드할 응용 프로그램 이미지를 다운로드하여 상기 응용 프로그램을 업그레이드하는 업그레이드부를 포함하되,
상기 통신 모듈을 통한 통신 프로토콜에 의해 상기 업그레이드부가 상기 호스트 PC로 전송하는 통신 코드가 2 내지 4바이트(byte)로 설정되며,
USB 전원 공급 기능이 있는 통신포트가 상기 통신 모듈에 연결되는 경우, 설정값에 따라 상기 업그레이드부의 활성화 여부를 제어하는 자동실행 제어부를 더 포함하는 부트로더.
A boot loader built in an embedded system for upgrading an application program recorded in a memory,
A system initialization unit for initializing hardware installed in the embedded system; And
And an upgrade unit communicating with the host PC through the communication module to download an application program image to be upgraded and upgrade the application program,
A communication code transmitted from the upgrade unit to the host PC is set to 2 to 4 bytes according to a communication protocol through the communication module,
Further comprising an automatic execution control unit for controlling whether the upgrade unit is activated according to a set value when a communication port having a USB power supply function is connected to the communication module.
제1항에 있어서,
상기 업그레이드부는 상기 호스트 PC와의 통신이 완료되면 통신을 위해 설정한 레지스터를 리셋하는 것을 특징으로 하는 부트로더.
The method according to claim 1,
Wherein the upgrading unit resets the register set for communication when communication with the host PC is completed.
제1항에 있어서,
상기 업그레이드부는 상기 응용 프로그램을 업그레이드한 후 자동으로 상기 통신 모듈을 통한 통신 연결 수립을 해제하는 것을 특징으로 하는 부트로더.
The method according to claim 1,
Wherein the upgrading unit automatically releases establishment of a communication connection through the communication module after upgrading the application program.
삭제delete 임베디드 시스템에 내장되어 메모리에 기록된 응용 프로그램을 업그레이드하는 부트로더에서 수행하는 시스템 업그레이드 방법으로서,
상기 부트로더가 시작되면 시스템 초기화를 수행하고, 부트로더 시작 메시지를 지속적으로 호스트 PC로 전송하는 단계;
상기 호스트 PC로부터 전송이 제대로 이루어졌음을 알리는 응답 메시지를 수신하면, 상기 임베디드 시스템에 대한 장치 정보를 취합하여 장치 정보 전송 메시지에 뒤이어 순차적으로 전송하는 단계;
상기 장치 정보에 대응하여 상기 호스트 PC로부터 바이트 수(ByteCount) 숫자 및 주소(Address)를 포함하는 쓰기 명령을 수신하는 단계;
상기 쓰기 명령에 상응하여 상기 호스트 PC로부터 상기 응용 프로그램을 업그레이드하기 위한 데이터를 수신하는 단계;
수신한 상기 데이터를 상기 응용 프로그램이 저장된 메모리에 덮어쓰는 단계; 및
데이터 덮어쓰기가 완료되면 상기 호스트 PC로 쓰기 완료 메시지를 전송하는 단계를 포함하는 시스템 업그레이드 방법.
A system upgrade method performed by a boot loader that is embedded in an embedded system and upgrades an application program recorded in a memory,
Performing system initialization when the boot loader is started, and continuously transmitting a boot loader start message to the host PC;
Receiving a response message informing that the transmission from the host PC is properly performed, collecting the device information of the embedded system, and sequentially transmitting the device information transmission message following the device information transmission message;
Receiving a write command including a byte number and an address from the host PC corresponding to the device information;
Receiving data for upgrading the application program from the host PC in accordance with the write command;
Overwriting the received data in a memory in which the application program is stored; And
And transmitting a write completion message to the host PC when data overwriting is completed.
제5항에 있어서,
상기 장치 정보는 바이트 수, 페이지 크기, 프로세서 ID, 메모리 크기, 부트로더 시작 번지 중 하나 이상을 포함하는 2 내지 4바이트로 이루어진 정보를 포함하는 것을 특징으로 하는 시스템 업그레이드 방법.
6. The method of claim 5,
Wherein the device information comprises information consisting of 2 to 4 bytes including at least one of a byte count, a page size, a processor ID, a memory size, and a boot loader start address.
제5항에 있어서,
상기 호스트 PC는 상기 쓰기 명령에 상응하는 데이터 전송 시에 바이트를 지속적으로 더하고 0xFF를 넘어가는 경우 오버플로우 처리를 통해 1바이트만을 남기는 방식으로 원본 체크섬을 구하고,
상기 부트로더에서 전송된 상기 쓰기 완료 메시지의 바로 뒤 바이트에 더해진 쓰기 체크섬과 비교하여 일치 여부를 확인하며,
일치하지 않을 경우 데이터 전송을 재시도하는 것을 특징으로 하는 시스템 업그레이드 방법.
6. The method of claim 5,
The host PC continuously adds bytes at the time of data transmission corresponding to the write command and, when exceeding 0xFF, obtains an original checksum in such a manner that only one byte is left through overflow processing,
Comparing the write checksum added to a byte immediately after the write completion message transmitted from the boot loader,
And if not, retrying the data transfer.
KR1020150009034A 2015-01-20 2015-01-20 Bootloader and embedded system upgrade method KR101640207B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020150009034A KR101640207B1 (en) 2015-01-20 2015-01-20 Bootloader and embedded system upgrade method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020150009034A KR101640207B1 (en) 2015-01-20 2015-01-20 Bootloader and embedded system upgrade method

Publications (1)

Publication Number Publication Date
KR101640207B1 true KR101640207B1 (en) 2016-07-15

Family

ID=56506175

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020150009034A KR101640207B1 (en) 2015-01-20 2015-01-20 Bootloader and embedded system upgrade method

Country Status (1)

Country Link
KR (1) KR101640207B1 (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106325939A (en) * 2016-08-25 2017-01-11 苏州蓝海彤翔系统科技有限公司 Target object starting method and business program system
CN108021382A (en) * 2017-12-22 2018-05-11 深圳华意隆电气股份有限公司 A kind of embedded device remote update system, method and embedded device
CN111045734A (en) * 2019-11-19 2020-04-21 中国航空工业集团公司西安航空计算技术研究所 Software and hardware program one-key curing system and method based on IMA platform
CN111488168A (en) * 2019-12-25 2020-08-04 湖北航天飞行器研究所 Weapon system control software safety upgrading method based on boot secondary loading
CN111831311A (en) * 2019-04-18 2020-10-27 东莞新能安科技有限公司 Application program upgrading method, electronic equipment and storage medium
CN111880780A (en) * 2020-07-28 2020-11-03 北京经纬恒润科技有限公司 Method, device and platform for developing boot loader of MCU (microprogrammed control Unit)
CN112148340A (en) * 2020-10-13 2020-12-29 江苏科技大学 Real-time wireless program burner for unmanned ship and implementation method
CN112181446A (en) * 2020-09-04 2021-01-05 中国船舶重工集团公司第七0七研究所 STM 32-based software online upgrading method
CN112527371A (en) * 2020-12-17 2021-03-19 杭州海康威视数字技术股份有限公司 Boot loader upgrading method and device, electronic equipment and storage medium
CN112527366A (en) * 2020-11-25 2021-03-19 江苏华创微系统有限公司 Bootrom online updating and debugging system
CN114281381A (en) * 2021-12-23 2022-04-05 广州航海学院 Management method and equipment for full-task turbine simulator board card

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070060448A (en) * 2005-12-08 2007-06-13 한국전자통신연구원 Device and method for upgradin system using two step bootloader
KR20100136111A (en) 2009-06-18 2010-12-28 삼성전자주식회사 Appratus and method for booting for debug in portable terminal
KR101427755B1 (en) * 2013-04-26 2014-08-07 주식회사 코아로직 Device and method for firmware upgrade using usb

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070060448A (en) * 2005-12-08 2007-06-13 한국전자통신연구원 Device and method for upgradin system using two step bootloader
KR20100136111A (en) 2009-06-18 2010-12-28 삼성전자주식회사 Appratus and method for booting for debug in portable terminal
KR101427755B1 (en) * 2013-04-26 2014-08-07 주식회사 코아로직 Device and method for firmware upgrade using usb

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106325939A (en) * 2016-08-25 2017-01-11 苏州蓝海彤翔系统科技有限公司 Target object starting method and business program system
CN108021382A (en) * 2017-12-22 2018-05-11 深圳华意隆电气股份有限公司 A kind of embedded device remote update system, method and embedded device
CN111831311A (en) * 2019-04-18 2020-10-27 东莞新能安科技有限公司 Application program upgrading method, electronic equipment and storage medium
CN111045734B (en) * 2019-11-19 2023-09-01 中国航空工业集团公司西安航空计算技术研究所 IMA platform-based software and hardware program one-key curing system and method
CN111045734A (en) * 2019-11-19 2020-04-21 中国航空工业集团公司西安航空计算技术研究所 Software and hardware program one-key curing system and method based on IMA platform
CN111488168B (en) * 2019-12-25 2023-09-12 湖北航天飞行器研究所 Weapon system control software safety upgrading method based on boot secondary loading
CN111488168A (en) * 2019-12-25 2020-08-04 湖北航天飞行器研究所 Weapon system control software safety upgrading method based on boot secondary loading
CN111880780A (en) * 2020-07-28 2020-11-03 北京经纬恒润科技有限公司 Method, device and platform for developing boot loader of MCU (microprogrammed control Unit)
CN111880780B (en) * 2020-07-28 2024-03-15 北京经纬恒润科技股份有限公司 Method, device and platform for developing boot loader of MCU
CN112181446A (en) * 2020-09-04 2021-01-05 中国船舶重工集团公司第七0七研究所 STM 32-based software online upgrading method
CN112148340A (en) * 2020-10-13 2020-12-29 江苏科技大学 Real-time wireless program burner for unmanned ship and implementation method
CN112527366A (en) * 2020-11-25 2021-03-19 江苏华创微系统有限公司 Bootrom online updating and debugging system
CN112527366B (en) * 2020-11-25 2024-03-19 江苏华创微系统有限公司 Update rollback fault tolerant design technique for embedded processor boot
CN112527371A (en) * 2020-12-17 2021-03-19 杭州海康威视数字技术股份有限公司 Boot loader upgrading method and device, electronic equipment and storage medium
CN112527371B (en) * 2020-12-17 2024-06-04 杭州海康威视数字技术股份有限公司 Boot loader upgrading method and device, electronic equipment and storage medium
CN114281381A (en) * 2021-12-23 2022-04-05 广州航海学院 Management method and equipment for full-task turbine simulator board card

Similar Documents

Publication Publication Date Title
KR101640207B1 (en) Bootloader and embedded system upgrade method
KR101427755B1 (en) Device and method for firmware upgrade using usb
US7320126B2 (en) Implementation of in system programming to update firmware on memory cards
EP3080693B1 (en) Devices, updaters, methods for controlling a device, and methods for controlling an updater
US9164756B2 (en) Software updating process for an embedded device
CN101047457B (en) Digital broadcasting processing device and upgrade method of bootloader for the same
US7421573B2 (en) Apparatus and method for updating firmware
EP1785855A2 (en) Method of booting a microprocessor system, method of updating contents of a serial flash memory array, microprocessor system, flash memory device and booting system
WO2020062887A1 (en) Firmware upgrading method and system based on flash micro-controller, and flash micro-controller
KR20070077463A (en) Method of system booting with a direct memory access in a new memory architecture
US8601464B2 (en) Memory online update system and method
CN101815988A (en) Firmware image update and management
JP2000357095A (en) Method and device for downloading software to embedded system
JP2003345618A (en) Method of switching between tow or more images of firmware
US7418589B2 (en) System and method for updating a basic input/output system
CN112947977A (en) Software online upgrading method and system
WO2016171921A1 (en) Bridge configuration in computing devices
JP2008504628A (en) Safe flushing
US11137995B2 (en) Updating firmware of a microcontroller
US7428635B2 (en) Method of writing non-volatile memory that avoids corrupting the vital initialization code
CN110955442B (en) Bootloader suitable for PCI-E password card
JP2005182812A (en) System and method for storing image file in computer system
US20190073134A1 (en) Methods for resetting a flash memory device and apparatuses using the same
CN106611124A (en) Computer device and boot method thereof
TWI556172B (en) Computer and booting method thereof

Legal Events

Date Code Title Description
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20190711

Year of fee payment: 4