Beschreibung description
Verfahren zum Aufrüsten eines mikroprozessorgesteuerten Geräts mit neuem Softwarecode über ein KommunikationsnetzwerkA method of upgrading a microprocessor controlled device with new software code over a communication network
[0001] Die Erfindung betrifft ein Verfahren zum Aufrüsten eines mikroprozessorgesteuerten Geräts mit neuem Softwarecode über ein Kommunikationsnetzwerk.The invention relates to a method for upgrading a microprocessor-controlled device with new software code via a communication network.
[0002] In der Regel ist es bei mikroprozessorgesteuerten Geräten notwendig, die Software im Gerät von Zeit zu Zeit anzupassen, da diese normalerweise vom Gerätehersteller kontinuierlich weiterentwickelt wird. Das entsprechende Software-Update kann z. B. direkt am Gerät von einem Servicetechniker ins Gerät übertragen werden. Treten Probleme bei der Übertragung ins Gerät oder beim Betrieb des Software-Updates auf, so kann der Servicetechniker diese normalerweise sofort vor Ort beheben.In general, it is necessary for microprocessor-controlled devices to adjust the software in the device from time to time, as this is normally developed continuously by the device manufacturer. The corresponding software update can z. B. be transmitted directly to the device by a service technician to the device. If problems occur during the transfer to the device or during the operation of the software update, the service technician can usually remedy these immediately on site.
[0003] Häufig sind mikroprozessorgesteuerte Geräte wie z. B. in der Prozessautomatisie- rungstechnik über Kommunikationsnetzwerke mit übergeordneten Einheiten verbunden. Damit kann das Software-Update auch über das Kommunikationsnetzwerk ins Gerät übertragen werden.Frequently, microprocessor-controlled devices such. B. in the process automation technology via communication networks with higher-level units. This means that the software update can also be transferred to the device via the communication network.
[0004] Ein wesentlicher Nachteil hierbei ist, dass das Einspielen eines Software-Updates in ein Gerät ein relativ kritischer Vorgang ist und Probleme hierbei nie völlig auszuschließen sind. Im Extremfall können diese Probleme zum Totalausfall des Gerätes führen.A major disadvantage here is that the installation of a software update in a device is a relatively critical process and problems are never completely ruled out. In extreme cases, these problems can lead to total failure of the device.
[0005] In diesem Fall ist es notwendig, dass ein Servicetechniker das Gerät aufsucht, um den Fehler vor Ort zu beheben. Liegen die Service-Zentrale und das Gerät weit entfernt, kann dies sehr zeitaufwendig sein.In this case, it is necessary for a service technician to visit the device to fix the fault on the spot. If the service center and the device are far away, this can be very time-consuming.
[0006] Ist das betreffende Gerät in einen Automatisierungsprozess mit mehreren Geräten eingebunden, so kann der Ausfall des Geräts zum Stillstand einer gesamten Anlage führen, was mit erheblichen Kosten verbunden wäre.If the device in question involved in an automation process with multiple devices, the failure of the device can lead to a standstill an entire system, which would be associated with considerable costs.
[0007] Insbesondere in der Automatisierungstechnik werden vielfach mikroprozessor- gesteurte Feldgeräte eingesetzt, die zur Erfassung und/oder Beeinflussung von Prozessvariablen dienen. Beispiele für derartige Feldgeräte sind Füllstandsmessgeräte, Massedurchflussmessgeräte, Druck- und Temperaturmessgeräte, pH- und Leitfähigkeitsmessgeräte etc., die als Sensoren die entsprechenden Prozessvariablen Füllstand, Durchfluss, Druck, Temperatur bzw. pH- Wert bzw. Leitfähigkeitswert erfassen.Particularly in automation technology, microprocessor-based field devices are often used, which serve to detect and / or influence process variables. Examples of such field devices are level gauges, mass flow meters, pressure and temperature measuring devices, pH and conductivity meters, etc., which detect the corresponding process variables level, flow, pressure, temperature or pH value or conductivity value as sensors.
[0008] Zur Beeinflussung von Prozessvariablen dienen Aktoren, die z. B. als Ventile den Durchfluss einer Flüssigkeit in einem Rohrleitungsabschnitt oder als Pumpen den Füllstand in einem Behälter steuern.To influence process variables are actuators z. As valves control the flow of a liquid in a pipe section or as pumps the level in a container.
[0009] Als Feldgeräte werden auch Registriergeräte bezeichnet, die vor Ort Messdaten aufzeichnen.
[0010] Eine Vielzahl solcher Feldgeräte wird von der Fa. Endress + Hauser hergestellt und vertrieben.Also referred to as field devices are recording devices which record measurement data on site. A variety of such field devices is manufactured and sold by the company. Endress + Hauser.
[0011] In der Regel sind Feldgeräte in modernen Automatisierungsanlagen über Feldbussysteme (HART, Profibus, Foundation Fieldbus, etc.), mit übergeordneten Einheiten (z. B. Leitsysteme oder Steuereinheiten) verbunden. Diese Einheiten dienen unter anderem zur Prozesssteuerung, Prozessvisualisierung, Prozessüberwachung.In general, field devices in modern automation systems are connected via fieldbus systems (HART, Profibus, Foundation Fieldbus, etc.) to higher-level units (eg, control systems or control units). Among other things, these units are used for process control, process visualization, process monitoring.
[0012] Meist sind Feldbussysteme in Unternehmensnetzwerke integriert. Damit kann aus unterschiedlichen Bereichen eines Unternehmens auf Prozess- bzw. Feldgerätedaten zugegriffen werden.Most fieldbus systems are integrated into corporate networks. This makes it possible to access process or field device data from different areas of a company.
[0013] Zur weltweiten Kommunikation können Feldbussystem auch mit öffentlichenFor worldwide communication can fieldbus system also with public
Netzwerken, z. B. dem Internet verbunden sein. Eine Möglichkeit Feldgeräten mit dem Internet zu verbinden, bietet das Produkt Fieldgate der Fa. Endress + Hauser.Networks, z. B. connected to the Internet. One option for connecting field devices to the Internet is provided by the Fieldgate product from Endress + Hauser.
[0014] Auch die in den Feldgeräten eingesetzte Software wird kontinuierlich weiterentwickelt. Somit kann ein Aufrüsten dieser Geräte mit neuem Softwarecode über ein Kommunikationsnetzwerk von Zeit zu Zeit notwendig werden.The software used in the field devices is being developed continuously. Thus, upgrading these devices with new software code over a communication network may be necessary from time to time.
[0015][0015]
[0016] Aus der DE 100 84 648 ist gattungsgemäßes Verfahren bekannt, bei dem über einen Feldbus als Kommunikationsnetzwerk Software von einem Host-Rechner in ein Feldgerät übertragen wird. Das Feldgerät weist zum Speichern der neuen Software (Software-Update) zwei Speicherbereiche auf.From DE 100 84 648 generic method is known in which via a fieldbus as a communication network software is transmitted from a host computer into a field device. The field device has two memory areas for storing the new software (software update).
[0017] Diese Anwendung weist mehrere Nachteile auf.This application has several disadvantages.
[0018] So sind mehrere Speicherbereiche notwendig, die alle von einem Mikroprozessor bzw. einem Mikrocontroller adressiert werden müssen.Thus, several memory areas are necessary, all of which must be addressed by a microprocessor or a microcontroller.
[0019] Die Auswahl der beiden Speicherbereiche erfolgt über Sprungadressen für die neue Software, was im Hinblick auf die Komplexität des Systems nachteilig ist.The selection of the two memory areas via jump addresses for the new software, which is disadvantageous in view of the complexity of the system.
[0020] Der Update- Vorgang wird von einem Host-Rechner gesteuert und läuft nicht autark ab.The update process is controlled by a host computer and does not run off self-sufficient.
[0021][0021]
[0022] Ein Austausch des gesamten Betriebssystems ist nicht berücksichtig.An exchange of the entire operating system is not considered.
[0023] Eine eventuelle Störung oder ein Systemabsturz während des Update-Vorganges kann, wenn der neue Speicherbereich noch nicht aktiviert ist, zu Problemen führen.A possible fault or a system crash during the update process, if the new memory area is not activated, cause problems.
[0024] Aus der EP-1108984 Al ist ein weiteres gattungsgemäßes Verfahren bekannt. Hierbei stehen ebenfalls zwei Speicherbereiche für das Speichern des Software- Updates zur Verfügung. Nach dem Übertragen der neuen Software in das Gerät wird der Speicherbereich mit der alten Software deaktiviert und der Speicherbereich mit der neuen Software aktiviert. Treten beim Umschalten der Speicherbereiche Störeinflüsse auf, die auf die Lauffähigkeit der neuen Software Einflüsse haben, so kann dies zu einem permanenten Systemfehler führen, bei dem das Mikroprozessorsystem in einem
Undefinierten oder instabilen Zustand „hängen bleibt", was einen Totalausfall des Geräts zur Folge haben kann.From EP-1108984 Al a further generic method is known. There are also two memory areas for saving the software update. After the new software has been transferred to the device, the memory area is deactivated with the old software and the memory area is activated with the new software. If disturbing influences occur when switching over the memory areas, which influences the runnability of the new software, this can lead to a permanent system error, in which the microprocessor system in one Undefined or unstable state "gets stuck", which can result in a total failure of the device.
[0025] Solche Störeinflüsse können im Feldgerät nur aufwendig durch zusätzlicheSuch interference can be complex in the field device only by additional
Maßnahmen eingeschränkt werden. Außerdem ist bei diesem Verfahren eine Spannungsüberwachung mit Energiepufferung notwendig. Tritt z. B. beim Umschalten der Speicherbereiche eine Spannungsunterbrechung der Versorgungsspannung des Mikroprozessorsystems auf, so kann dies zu einem schwerwiegenden Systemfehler führen.Measures are restricted. In addition, this method requires voltage monitoring with energy buffering. For example, B. when switching the memory areas on a power interruption of the supply voltage of the microprocessor system, this can lead to a serious system error.
[0026] Da Spannungsausfälle beim Update- Vorgang zu Fehlern bei der Software führen können, ist normalerweise eine weitere Hardware z.B. eine aufwendige Früherkennung eines Spannungsausfalls (Pre-Powerfail) mit Energiepufferung notwendig.Since power failures during the update process can lead to software errors, normally further hardware, e.g. an elaborate early detection of a power failure (pre-power fail) with energy buffering necessary.
[0027] Aufgabe der vorliegenden Erfindung ist es deshalb ein einfaches Verfahren zum Aufrüsten eines mikroprozessorgesteuerten Geräts mit neuem Softwarecode über ein Kommunikationsnetzwerk anzugeben, das die oben genannten Nachteile nicht aufweist, das insbesondere Systemfehler, die zu einem Totalausfall des Geräts führen können, vermeidet und dabei Ressourcen schonend und kostengünstig realisierbar ist.The object of the present invention is therefore to provide a simple method for upgrading a microprocessor-controlled device with new software code via a communication network, which does not have the disadvantages mentioned above, in particular system errors, which can lead to a total failure of the device avoids and thereby Resource-saving and cost-effective is feasible.
[0028][0028]
[0029] Gelöst wird diese Aufgabe durch die im Anspruch 1 angegebenen Merkmale. DasThis object is achieved by the features specified in claim 1. The
[0030] Verfahren zum Aufrüsten eines mikroprozessorgesteuerten Geräts mit neuemA method for upgrading a microprocessor-controlled device with new
Softwarecode über Kommunikationsnetzwerk wobei das Gerät einen nicht flüchtigen Programmspeicher, mit zwei Speicherbereichen einem ersten und einem zweiten Speicherbereich aufweist,Software code via communication network, the device having a non-volatile program memory, with two memory areas having a first and a second memory area,
[0031] wobei der erste Speicherbereich (Boot Sektor) für ein Basisprogramm das ein erstes Betriebssystem und erste Funktionalitäten des Geräts bereitstelltWherein the first memory area (boot sector) for a basic program that provides a first operating system and first functionalities of the device
[0032] und der zweite Speicherbereich (Update Sektor) für den zu übertragendenAnd the second memory area (update sector) for the to be transmitted
Softwarecode vorgesehen ist und der erste Speicherbereich hardwaremäßig vor einem Überschreiben geschützt ist, umfasst folgende Verfahrensschritten:Software code is provided and the first memory area is protected in hardware from overwriting, comprises the following steps:
[0033][0033]
1. Systemstart mit dem Basisprogramm aus dem ersten Speicherbereich1. System start with the basic program from the first memory area
2. Lesen einer Systemvariablen UPDATE2. Read a system variable UPDATE
3. Falls die Systemvariable UPDATE den Wert „perform update" aufweist, Aufruf einer Funktion „perform firmware update" mit folgenden Unterschritten:3. If the system variable UPDATE has the value "perform update", call a function "perform firmware update" with the following substeps:
1. Schreiben der Systemvariablen UPDATE mit dem Wert „invalid Firmware"1. Writing the system variable UPDATE with the value "invalid firmware"
2. Aufbau einer Verbindung zu einem Server als übergeordnete Einheit und Übertragen des neuen Softwarecodes in das Gerät;2. establishing a connection to a server as a higher-level unit and transferring the new software code into the device;
3. Speichern des neuen Softwarecodes im zweiten Speicherbereich3. Save the new software code in the second memory area
4. Prüfung des neuen Softwarecodes auf Bitfehler
5. Falls ein Bitfehler aufgetreten ist erneuter Systemstart gemäß Schritt A)4. Check of the new software code for bit errors 5. If a bit error has occurred, reboot according to step A)
6. Fall kein Bitfehler aufgetreten ist Ausführen des neuen Softwarecodes aus dem zweiten Speicherbereich6. If no bit error has occurred, execute the new software code from the second memory area
7. Schreiben der Systemvariablen UPDATE mit dem Wert „valid firmware"7. Writing the system variable UPDATE with the value "valid firmware"
4. Falls die Systemvariable UPDATE den Wert „valid firmware" aufweist4. If the system variable UPDATE has the value "valid firmware"
5. Prüfung der Software in einem zweiten Speicherbereich auf Bitfehler5. Checking the software in a second memory area for bit errors
6. Wenn keine Bitfehler vorliegen Ausführen der Software des zweiten Speicherbereichs6. If there are no bit errors Execute the software of the second memory area
7. Wenn Bitfehler vorliegt Schreiben der Systemvariablen UPDATE mit dem Wert „invalid firmware" und Ausführen der Software im ersten Speicherbereich7. If there is a bit error Write the system variable UPDATE with the value "invalid firmware" and execute the software in the first memory area
[0034] Die wesentliche Idee der Erfindung besteht darin, dass das Gerät immer eine lauffähige Software aufweist, mit der das Mikroprozessorsystem gestartet werden kann.The essential idea of the invention is that the device always has a running software with which the microprocessor system can be started.
[0035] Auch wenn äußere Störeinflüsse während des Aufrüstens eintreten, können diese nie zu einem Undefinierten oder instabilen Zustand des Systems führen. Es steht immer eine lauffähige Software, das Basisprogramm, zur Verfügung.Even if external disturbances occur during the upgrade, they may never lead to an undefined or unstable state of the system. There is always an executable software, the basic program available.
[0036] Mit Hilfe des erfindungsgemäßen Verfahrens ist ein sicheres Aufrüsten eines Geräts mit neuem Softwarecode aus der Ferne möglich. Der neue Softwarecode kann auch das Betriebssystem bzw. die gesamte Firmware des Gerätes umfassen.With the help of the method according to the invention a secure upgrade of a device with new software code from a distance is possible. The new software code may also include the operating system or the entire firmware of the device.
[0037] Falls bei der Übertragung über das Kommunikationsnetzwerk im Softwarecode ein Bitfehlerauftritt, wird gemäß Anspruch 2 eine entsprechende Nachricht an den Sender des neuen Softwarecodes gesendet, um ein erneutes Übertragen des Softwarecodes über das Kommunikationsnetzwerk zu veranlassen.If a bit error occurs in the transmission over the communication network in the software code, according to claim 2, a corresponding message is sent to the sender of the new software code to cause re-transmission of the software code over the communication network.
[0038] In vorteilhafter Weise weist der nichtflüchtige Programmspeicher einen Adressraum auf, der größer ist, als der von dem mit dem Programmspeicher verbundenen Mikroprozessor verwaltet werden kann. Dadurch lässt sich der Adressraum des Mikroprozessors optimal nutzen und der Adressraum wird nicht durch den zweiten Speicherbereich eingeschränkt.Advantageously, the non-volatile program memory has an address space which is larger than that which can be managed by the microprocessor connected to the program memory. As a result, the address space of the microprocessor can be used optimally and the address space is not restricted by the second memory area.
[0039] In einer Weiterentwicklung der Erfindung ist der Adressraum des Programmspeichers gerade doppelt so groß wie der vom Mikroprozessor verwaltbare.In a further development of the invention, the address space of the program memory is just twice as large as that manageable by the microprocessor.
[0040] Eine typische Speichergröße für den Programmspeicher liegt bei 1064 kB.A typical memory size for the program memory is 1064 kB.
[0041] In vorteilhafter Weise besitzt der Programmspeicher einen vom Mikroprozessor ansteuerbaren Schalteingang, über den die beiden Speicherbereiche ausgewählt werden können.
[0042] Nachfolgend ist die Erfindung anhand eines in der Zeichnung dargestellten Ausführungsbeispiels näher erläutert.Advantageously, the program memory has a controllable by the microprocessor switching input, via which the two memory areas can be selected. The invention is explained in more detail with reference to an embodiment shown in the drawing.
[0043] Es zeigen:[0043] In the drawings:
[0044] Fig. 1 Kommunikationsnetzwerk der Automatisierungstechnik inFig. 1 communication network of automation technology in
[0045] schematischer Darstellung;[0045] schematic representation;
[0046] Fig.2 Blockschaltbild eines Feldgerätes;2 block diagram of a field device;
[0047] Fig. 3 Programmspeichers eines Feldgerätes mit einer AufteilungFig. 3 program memory of a field device with a division
[0048] in zwei Speicherbereiche;In two memory areas;
[0049] Fig. 4 Russdiagramm für das erfindungsgemäße Verfahren,FIG. 4 shows a soot diagram for the method according to the invention, FIG.
[0050] das das Systemverhalten nach einem Systemstart beschreibt;[0050] describing the system behavior after a system start;
[0051] Fig. 5 Russdiagramm für die Auslösung des Update- Vorgangs;FIG. 5 shows a soot diagram for triggering the update process; FIG.
[0052] Fig. 6 Russdiagramm für den Funktionsaufruf „perform update".FIG. 6 soot diagram for the function call "perform update".
[0053] In Fig. 1 ist ein Kommunikationsnetzwerk der Automatisierungstechnik näher dargestellt. An einem Datenbus Dl sind mehrere Rechnereinheiten Workstations WSl, WS2, angeschlossen. Diese Rechnereinheiten dienen als übergeordnete Einheiten (Leitsysteme bzw. Steuereinheiten), unter anderem zur Prozessvisualisierung, Prozessüberwachung und zum Engineering, sowie zum Bedienen und Überwachen von Feldgeräten. Der Datenbus Dl arbeitet z. B. nach dem Profibus DP-Standard oder nach dem HSE (High Speed Ethernet)-Standard der Foundation Fieldbus.In Fig. 1, a communication network of automation technology is shown in more detail. On a data bus Dl several computer units workstations WSL, WS2, connected. These computer units serve as higher-level units (control systems or control units), including for process visualization, process monitoring and engineering, as well as for operating and monitoring field devices. The data bus Dl operates z. Eg according to the Profibus DP standard or according to the HSE (High Speed Ethernet) standard of the Foundation Fieldbus.
[0054] Über ein Gateway Gl, das auch als Linking Device oder auch als Segment-Koppler bezeichnet wird, ist der Datenbus Dl mit einem Feldbus-Segment SMl verbunden. Das Feldbus-Segment SMl besteht aus mehreren Geräten Fl, F2, F3, F4, die in der Prozessautomatisierungstechnik allgemein als Feldgeräte bezeichnet werden und die über einen Feldbus FB miteinander verbunden sind. Bei den Feldgeräten Fl, F2, F3, F4 kann es sich sowohl um Sensoren oder um Aktoren handeln. Der Feldbus FB arbeitet entsprechend nach einem der bekannten Feldbusstandards Profibus, Foundation Fieldbus oder HART.Via a gateway G1, which is also referred to as a linking device or also as a segment coupler, the data bus D1 is connected to a fieldbus segment SM1. The field bus segment SM1 consists of several devices F1, F2, F3, F4, which are generally referred to as field devices in process automation technology and which are interconnected via a field bus FB. The field devices F1, F2, F3, F4 may be sensors or actuators. The fieldbus FB operates according to one of the known fieldbus standards Profibus, Foundation Fieldbus or HART.
[0055] Wird anstelle des Gateways Gl das Produkt Fieldgate der Fa. Endress + Hauser eingesetzt, so ist z. B. eine Verbindung der Feldgeräte Fl, F2, F3, F4 mit den übergeordneten Einheiten Wl, W2 über das Internet möglich.Is used instead of the gateway Gl the product Fieldgate the Fa. Endress + Hauser, so is z. B. a connection of the field devices Fl, F2, F3, F4 with the higher-level units Wl, W2 via the Internet possible.
[0056] In Fig. 2 ist ein Blockschaltbild eines erfindungsgemäßen Feldgerätes z. B. Fl näher dargestellt. Eine Mikroprozessor μP ist zur Messwertverarbeitung über einen Analog-Digital- Wandler A/D und einen Verstärker V mit einem Messaufnehmer MA verbunden, der eine Prozessvariable (z. B. Druck, Durchfluss oder Füllstand) erfasst. Der Mikroprozessor μP ist mit mehreren Speichern verbunden. Der Speicher VM dient als temporärer (flüchtiger) Arbeitspeicher RAM. Im Speicher PS dem Programmspeicher sind Software oder Software-Komponenten gespeichert, die im Mikroprozessor μP ausgeführt werden.
[0057] Der Programmspeicher PS weist einen Schalteingang Sl auf, über den unterschiedliche Speicherbereiche vom Mikroprozessor μP über einen Port- Ausgang PA ausgewählt werden können.In Fig. 2 is a block diagram of a field device according to the invention z. B. Fl shown in more detail. A microprocessor μP is connected to the measurement processing via an analog-to-digital converter A / D and an amplifier V to a sensor MA, which detects a process variable (eg, pressure, flow or level). The microprocessor μP is connected to a plurality of memories. The memory VM serves as a temporary (volatile) working memory RAM. In the memory PS the program memory software or software components are stored, which are executed in the microprocessor uP. The program memory PS has a switching input Sl via which different memory areas can be selected by the microprocessor μP via a port output PA.
[0058] In einem nichtflüchtigen beschreibbaren Datenspeicher NVM z. B. EEPROM- Speicher werden Parameterwerte (z. B. Kalibrierdaten etc.) abgespeichert.In a non-volatile writeable data memory NVM z. Eg EEPROM memory, parameter values (eg calibration data, etc.) are stored.
[0059] Der im Mikroprozessor μP ablaufende Softwarecode, das auszuführende Programm, definiert u. a. die anwendungsbezogenen Funktionalitäten des Feldgerätes (Messwertberechnung, Hüllkurvenauswertung, Linearisierung der Messwerte, Diagnoseaufgaben).The running in the microprocessor uP software code, the program to be executed, defines u. a. the application-related functionalities of the field device (measured value calculation, envelope evaluation, linearization of the measured values, diagnostic tasks).
[0060] Weiterhin ist der Mikroprozessor μP mit einer Anzeigebedieneinheit A/B (z. B. LCD-Anzeige mit mehreren Drucktasten) verbunden.Further, the microprocessor μP is connected to a display operation unit A / B (e.g., multi-button LCD display).
[0061] Zur Kommunikation mit dem Feldbus-Segment SMl ist der Mikroprozessor μP über einen Kommunikations-Controller COM mit einer Feldbusschnittstelle FBS verbunden. Ein Netzteil NT liefert die notwendige Energie für die einzelnen Elektronik-Komponenten des Feldgerätes Fl. Es kann vom Feldbus FB oder von einer separaten Energiequelle gespeist werden. Die Versorgungsleitungen für die Energieversorgung der einzelnen Komponenten im Feldgerät sind der Übersichtlichkeit halber nicht eingezeichnet.For communication with the field bus segment SMl, the microprocessor μP is connected via a communication controller COM to a fieldbus interface FBS. A power supply unit NT supplies the necessary energy for the individual electronic components of the field device F1. It can be powered by fieldbus FB or by a separate power source. The supply lines for the power supply of the individual components in the field device are not shown for clarity.
[0062] Eine Überwachungseinheit (Watchdog) WD, die ebenfalls mit dem Mikroprozessor μP verbunden ist, überwacht die Funktion des Mikroprozessors μP. Kommt es aufgrund eines Systemfehlers zu einer Programmunterbrechung, so veranlasst die Überwachungseinheit einen Systemstart.A watchdog WD, also connected to the microprocessor μP, monitors the operation of the microprocessor μP. If a program interruption occurs due to a system error, the monitoring unit initiates a system start.
[0063] In Fig. 3 ist der Programmspeicher PS mit den beiden Speicherbereichen Boot-Area BA und Update- Area UA vergrößert dargestellt. Der Programmspeicher PS weist einen Speicherplatz von 1024 kB auf. Sein Adressraum ist gerade doppelt so groß wie der vom Mikroprozessor μP verwaltbare. Über den Schalteingang Sl können die beiden Speicherbereiche BA bzw. UA vom Mikroprozessor μP ausgewählt und vollständig adressiert werden.In Fig. 3, the program memory PS is shown enlarged with the two memory areas boot area BA and update area UA. The program memory PS has a memory space of 1024 KB. Its address space is just twice as large as that managed by the μP microprocessor. About the switching input Sl, the two memory areas BA and UA can be selected by the microprocessor uP and fully addressed.
[0064] In Fig. 4 ist ein Flussdiagramm dargestellt, das das Systemverhalten nach einem Systemstart bei einem der Feldgeräte z. B. Fl wiedergibt.In Fig. 4 is a flowchart is shown, the system behavior after a system start in one of the field devices z. B. Fl reproduces.
[0065] Das System wird mit dem Basisprogramm, das ein erstes Betriebssystem und erste Funktionalitäten des Feldgeräts bereitstellt, aus dem ersten Speicherbereich (Boot Area) gestartet.The system is started with the basic program, which provides a first operating system and first functionalities of the field device, from the first storage area (boot area).
[0066] Anschließend wird die Systemvariable UPDATE gelesen, die im Speicher NVM, dem Konfigurationsspeicher abgelegt ist.Subsequently, the system variable UPDATE is read, which is stored in the memory NVM, the configuration memory.
[0067] Ist die Systemvariable UPDATE mit dem Wert „perform update" gesetzt, so wird eine Funktion „perform firmware update" aufgerufen.If the system variable UPDATE is set with the value "perform update", then a function "perform firmware update" is called.
[0068] Zuerst wird die Systemvariable UPDATE auf „invalid firmware" gesetzt.
[0069] Anschließend wird über das Kommunikationsnetzwerk KN eine Verbindung zu einer übergeordneten Einheit einem Server oder einem Host-Rechner z. B. WSl aufgebaut und die Übertragung des neuen Softwarecodes angefordert. Der neue Softwarecode wird dann in das Feldgerät Fl übertragen und im zweiten Speicherbereich UB (Update Area) abgespeichert.First, the system variable UPDATE is set to "invalid firmware". Subsequently, via the communication network KN, a connection to a higher-level unit a server or a host computer z. B. WSl and requested the transfer of the new software code. The new software code is then transferred to the field device F1 and stored in the second memory area UB (Update Area).
[0070] Zur Durchführung der Aufrüstung, bzw. des Update- Vorgangs, wird ein spezielles Update-Programm in den RAM-Speicher VM geladen und ausgeführt. Dieses Programm schaltet den Port- Ausgang PA so, dass nur der Update-Bereich UB des Programmspeichers PS zum Speichern verwendet werden kann.To carry out the upgrade, or the update process, a special update program is loaded into the RAM VM and executed. This program switches the port output PA so that only the update area UB of the program memory PS can be used for saving.
[0071] Der Mikroprozessor greift damit nur noch auf den Update-Bereich UB zu, ohne dies adressmäßig zu bemerken. Der neue Softwarecode wird seriell in den Update-Bereich UB des Programmspeichers PS übertragen und dort gespeichert.The microprocessor thus only accesses the update area UB without noticing this in terms of the address. The new software code is transmitted serially in the update area UB of the program memory PS and stored there.
[0072] Nach dem Übertragen wird der neue Softwarecode auf Bitfehler mit Hilfe eines CRC-Tests überprüft.After the transfer, the new software code is checked for bit errors using a CRC test.
[0073] Falls Bitfehler (mindestens einer) aufgetreten sind, wird ein erneuter Systemstart mit dem Basisprogramm aus dem ersten Speicherbereich BA durchgeführt. Dieses Basisprogramm muss zumindest den Kommunikations-Stack für den Kommunikationsaufbau zu einer übergeordneten Einheit aufweisen und dasIf bit errors (at least one) have occurred, a renewed system start is carried out with the basic program from the first memory area BA. This basic program must at least have the communication stack for establishing communication with a higher-level unit and the
[0074] Speichern des neuen Softwarecodes ermöglichen.[0074] Allow saving of the new software code.
[0075] Falls keine Bitfehler aufgetreten sind, wir der neue Softwarecode aus dem zweiten Speicherbereich UA ausgeführt. Der neue Softwarecode kann sowohl ein neues Betriebssystem als auch eine verbesserte Gerätesoftware umfassen. Da nun mit dem neuen Softwarecode eine gültige Firmware im Feldgerät zur Verfügung steht, wird die Systemvariable UPDATE auf den Wert „valid firmware" gesetzt.If no bit errors have occurred, the new software code is executed from the second memory area UA. The new software code can include both a new operating system and improved device software. Since a valid firmware is now available in the field device with the new software code, the system variable UPDATE is set to the value "valid firmware".
[0076] Falls die Systemvariable UPDATE nicht den Wert „perform update" sondern den Wert „valid firmware" aufweist, erfolgt eine Prüfung der Software im zweiten Speicherbereich auf Bitfehler ebenfalls mit einem CRC-Test.If the system variable UPDATE does not have the value "perform update" but the value "valid firmware", a check of the software in the second memory area for bit errors also takes place with a CRC test.
[0077] Wenn keine Bitfehler gefunden werden wird die Software des zweitenIf no bit errors are found, the software of the second will be found
Speicherbereichs ausgeführt. Andernfalls wird die Systemvariable UPDATE mit dem Wert „invalid firmware" geschrieben und das Gerät läuft weiter mit dem Basisprogramm aus dem ersten Speicherbereich.Memory area executed. Otherwise, the system variable UPDATE is written with the value "invalid firmware" and the device continues to run with the basic program from the first memory area.
[0078] Fig. 5 zeigt ein Russdiagramm für die Auslösung des Update- Vorgangs. Dieser kann vom System selbst über einen Zeitgeber (Timer) oder von extern ausgelöst werden. Dabei wird die Systemvariable UPDATE mit dem Wert „perform update" beschrieben und das Gerät führt einen Systemstart mit dem Basisprogramm, d. h. es wird ein Reboot- Vorgang gestartet, aus.FIG. 5 shows a soot diagram for triggering the update process. This can be triggered by the system itself via a timer or externally. The system variable UPDATE is described with the value "perform update" and the device performs a system start with the basic program, ie a reboot process is started.
[0079] Fig. 6 zeigt ein Russdiagramm für den Funktionsaufruf „perform firmware update". Aufgrund der Größe wurde das Diagramm auf die zwei Teilfiguren Fig. 6a und Fig. 6b
aufgeteilt. Die einzelnen Verfahrenschritte wurden im Wesentlichen bereits oben schon beschrieben.6 shows a soot diagram for the function call "perform firmware update." Due to the size, the diagram was based on the two subfigures 6a and 6b divided up. The individual process steps have essentially already been described above.
[0080] Zusätzlich findet noch eine Überprüfung statt, ob die neue Software d. h. die Firmware auch für das betreffende Gerät bestimmt ist. Hierzu wird der Eintrag Firmware Version überprüft. Wenn die neue Software nicht für das Gerät bestimmt bzw. geeignet ist muss natürlich ein erneuter Systemstart mit dem Basisprogramm erfolgen.In addition, there is still a check whether the new software d. H. the firmware is also intended for the device in question. For this the entry Firmware Version is checked. If the new software is not intended or suitable for the device, of course, a reboot must be done with the basic program.
[0081] Die neue Software kann auch stückweise, d. h. in kleineren Paketen in das Gerät übertragen werden. Dabei wechselt ein Update-Task immer wieder den Speicherbereich im Programmspeicher PS zwischen dem ersten und dem zweiten Speicherbereich.The new software may also be piecewise, i. H. be transmitted in smaller packages in the device. In this case, an update task repeatedly changes the memory area in the program memory PS between the first and the second memory area.
[0082] Nachfolgend sind verschiedenen Vorteile, die das Verfahren bietet, nochmals angegeben.Hereinafter, various advantages offered by the method are stated again.
[0083] Ein aufwendige Pre-Power Fail Erkennung ist nicht notwendig. Auch wenn Störungen bei dem Update- Vorgang bzw. beim Speichern der neuen Software auftreten bleibt das Gerät über das Basisprogramm funktionstüchtig.An expensive pre-power fail detection is not necessary. Even if faults occur during the update process or when the new software is saved, the device remains functional via the basic program.
[0084] Auch bei Programmfehlern der neuen Software, die nicht über einen CRC-Test festgestellt werden können, kann das System nicht in einen Undefinierten Zustand gelangen, der zu einem Totalausfall, bei dem das Gerät für immer „tot" bleibt, führt. Über die Watchdog-Einheit WD kann ein Systemstart mit dem immer zur Verfügung stehenden Basisprogramm durchgeführt werden.Even in the case of new software program errors that can not be detected by a CRC test, the system can not reach an undefined state which leads to a total failure in which the device remains "dead" forever The watchdog unit WD can be used to start the system with the always-available basic program.
[0085] Das Gerät kann auch selbständig einen Update-Vorgang auslösen.The device can also independently trigger an update process.
[0086] Durch Setzen der Systemvariablen UPDATE kann das Gerät aus der Ferne oder auch vor Ort mit dem Basisprogramm erneut gestartet werden.By setting the system variable UPDATE, the device can be restarted remotely or locally with the basic program.
[0087] Das Verfahren führt zu einem sehr robusten mikroprozessorgesteuerten Gerät, das immer eine lauffähige Software, das Basisprogramm, besitzt. Mögliche Störungen beim Update- Vorgang bedeuten nicht, dass ein Service-Techniker das Gerät aufsuchen und den Fehler vor Ort beheben muss.The method results in a very robust microprocessor-controlled device, which always has executable software, the basic program. Possible faults during the update process do not mean that a service technician must visit the device and rectify the fault locally.
[0088][0088]
[0089] Im Fall eines Fehlers bei der Übertragung des neuen Softwarecodes wird automatisch eine entsprechende Nachricht an den Sender d. d. die übergeordnete Einheit gesendet.In the event of an error in the transmission of the new software code automatically a corresponding message to the sender d. d. sent the parent unit.
[0090] Durch die geschickte Aufteilung des Programmspeichers PS und mit der Auswahl des aktiven Speicherbereichs über den Schalteingang Sl ist ein Resourcen-schonender Update-Vorgang möglich.The skillful division of the program memory PS and the selection of the active memory area via the switching input Sl a resource-saving update process is possible.
[0091] Das erfindungsgemäße Verfahren ist aufgrund seiner Einfachheit und Robustheit nicht nur für Feldgeräte der Automatisierungstechnik sondern allgemein für mikroprozessorgesteuerte Geräte, die allgemein als „embedded Systems" bezeichnet werden,
geeignet.
The inventive method is due to its simplicity and robustness not only for field devices of automation technology but generally for microprocessor-controlled devices, which are generally referred to as "embedded systems", suitable.