A kind of method for upgrading software of car audio system
Technical field
The present invention relates to the vehicle audio field, relate in particular to the software upgrading scheme in the car audio system.
Background technology
Along with the development of vehicle mounted multimedia technology, the function of on-vehicle acoustic apparatus is abundant day by day, and the software design of sound system also becomes increasingly complex.Because the characteristic of current vehicle audio; After the vehicle audio entrucking, if, just must dismantle vehicle audio from car because software upgrading or software maintenance need be upgraded sound system software; Use professional replication tool to accomplish software upgrading then; Process is complicated, consuming time long and cost is very high, and in addition, the main control MCU (microcontroller) of existing car audio system adopts single-chip microcomputer and internal RAM (random access memory) less mostly; Realize that software upgrading generally need expand external RAM or use high-grade MCU, increased the cost of car audio system.
Summary of the invention
The method for upgrading software that the purpose of this invention is to provide a kind of car audio system, the difficulty that is intended to solve software upgrading inconvenience after the existing car audio system entrucking.
Car audio system provided by the invention comprises MCU, and the storage space of said MCU comprises normal application memory block, software upgrading control program memory block and updating mark memory block.
More specifically, said system also comprises power module, servo module, radio reception module, audio-frequency module, bluetooth module, display module and the key-press module that is connected with MCU.
More specifically; Application storing, application boot and application program interrupt vector in the said normal application memory block; Storage update sign setting program, updating mark setting program program of file copy, renewal control program, renewal control program program of file copy and public boot in the said software upgrading control program memory block, storing software updating mark in the said updating mark memory block.
More specifically, further storing servo control program, the erasable program in normal application space and the erasable program of updating mark in the said software upgrading control program memory block.
The method for upgrading software of car audio system provided by the invention may further comprise the steps:
Step a is divided into normal application memory block, software upgrading control program memory block and updating mark memory block with the MCU memory block of car audio system;
Step b when CD inserts in the startup car audio system, judges whether to be the software upgrade data CD, if the software upgrade data CD then gets into the software upgrading state;
Step c carries out erasable to realize software upgrading to the normal application memory block of MCU.
More specifically, further comprise a steps d after the said step c: after the software upgrading success, upgrade control program and restart car audio system, make car audio system work in usual application state.
More specifically, said step b specifically may further comprise the steps:
Step b1 judges that whether the updating mark memory block exists updating mark, then gets into the software upgrading state if any updating mark;
Step b2, as do not have updating mark to judge whether that then CD inserts in the car audio system, when CD inserts in the car audio system, judges whether to be the software upgrade data CD, if the software upgrade data CD then gets into the software upgrading state.
More specifically, said step b1 specifically may further comprise the steps: if there is updating mark in the updating mark memory block, then will upgrade among the RAM that control program copies MCU to, controlled step is upgraded in operation in RAM, and wipes the software upgrading sign after finishing upgrading.
More specifically; Said step b2 specifically may further comprise the steps: if there is the software upgrade data CD to be inserted in the car audio system; Then the updating mark setting program is copied among the RAM of MCU; The operation updating mark is provided with the erasable action that realizes the memory block in RAM, will upgrade among the RAM that control program copies MCU to operation renewal controlled step in RAM then.
More specifically, said step c specifically may further comprise the steps:
Step c1 reads the data of upgrading on the CD;
Step c2 is according to the erasable normal application of the servo data that read memory block;
Step c3 judges whether renewal process finishes, and then continues execution in step c1 as not finishing, and finishes like renewal and then wipes software upgrading sign and the warm reset MCU in the updating mark memory block.
Than prior art; The method for upgrading software of car audio system provided by the invention directly carries out software upgrading control on the inner RAM of single-chip microcomputer (MCU) and storage space (for example FLASH), simplified hardware circuit, and through designing public boot; Guaranteed under the application program update failure scenarios; Can get into the software upgrading pattern again, guarantee that software update system is stable, have escalation process advantage simple, with low cost.
Description of drawings
Fig. 1 is the hardware structure diagram of car audio system of the present invention;
Fig. 2 is the area dividing synoptic diagram of the storage space of MCU of the present invention;
Fig. 3 is the software upgrading process flow diagram of car audio system of the present invention;
Fig. 4 is a renewal control program process flow diagram involved in the present invention.
Embodiment
In order to make the object of the invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with accompanying drawing and embodiment.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
Referring to shown in Figure 1, the car audio system that preferred embodiment of the present invention provides comprises MCU10 (for example MB90880 series monolithic) and the power module 11 that is connected with MCU10 respectively, servo module 12, radio reception module 13, Audio (audio frequency) module 14, bluetooth module 15, display module 16 and key-press module 17.Wherein, MCU10 realizes the control to power module 11, servo module 12, display module 16 and key-press module 17 through GPIO (General-Purpose IO ports, general input and output) mode.MCU10 carries out information interaction through I2C (Inter-Integrated Circuit, inner integrated circuit) with radio reception module 13.MCU10 is through serial ports and bluetooth module 15 data interactions.
In conjunction with referring to shown in Fig. 2, the storage space of MCU10 is divided into following zone: normal application memory block 20, software upgrading control program memory block 21 and updating mark memory block 22.Wherein in the normal application memory block 20 except application storing 203; Application boot 201 and application program interrupt vector 202 have also been stored; Using boot 201 realizes being provided with to the RAM initialization of application program and storehouse etc.; Application program interrupt vector 202 is preserved the interrupt routine entry address that application program 203 needs, 203 processing of accomplishing normal use of application program.
Storage update sign setting program 211, updating mark setting program program of file copy 212, renewal control program 213, renewal control program program of file copy 214 and public boot 215 in the software upgrading control program memory block 21.Upgrade in the control program 213 and further comprise servocontrol program, the erasable program in normal application space and the erasable program of updating mark.
Storing software updating mark in the updating mark memory block 22.
In conjunction with the storage space partitioned mode of the MCU of above-mentioned car audio system, the preferred embodiment of the method for upgrading software of car audio system provided by the invention may further comprise the steps:
Step a divides the memory block of vehicle audio and compiling according to storage area;
Step b; Start car audio system, car audio system works in usual application state, when CD inserts; Judgement is common CD music CD or software upgrade data CD; If common CD music CD is then by the normal use work disposal, if the software upgrading CD then gets into the software upgrading state;
Step c; Operation servocontrol program, the erasable step of normal application space FLASH (is example with the FLASH storer) realize software upgrading in the RAM of MCU; And judge to upgrade and whether finish, in case finish just to carry out the erasable step of updating mark, wipe the updating mark of setting.
Steps d, the software upgrading success is restarted car audio system through upgrading controlled step, and car audio system works in usual application state.
In conjunction with referring to shown in Fig. 3, above-mentioned steps b specifically may further comprise the steps:
At first in step 30, through RST (resetting) the instruction MCU that resets; Execution in step 31 then, through the setting of public boot 215 completion to MCU crystal oscillator and PC pointer; Execution in step 32 then, and public boot 215 judges whether there is the software upgrading sign in the updating mark memory block 22, if exist, then execution in step 38, and renewal control program program of file copy 214 will be upgraded control program 213 and copy RAM to; If there is not the software upgrading sign in the updating mark memory block 22, then execution in step 33, RAM initialization and storehouse setting that application program guiding 201 realizes to application program; Execution in step 34 then, run application 203, and continuous execution in step 35; Judged whether that the software upgrading CD inserts, inserted that then execution in step 36 as finding the software upgrading CD; Updating mark setting program program of file copy 212 copies updating mark setting program 211 to RAM, and execution in step 37 then, and operation updating mark setting program 211 is realized the erasable action of FLASH in RAM; Execution in step 38 then; Renewal control program program of file copy 214 will be upgraded control program 213 and copy RAM to, and execution in step 39 then, and control program 213 is upgraded in operation in RAM.
Shown in Fig. 4; Above-mentioned steps 39 described renewal control programs specifically may further comprise the steps: initialization MCU10 (MCU port and initialization of variable) in step 41 at first, in step 42, accomplish servo initialization then, and in step 43, read the data of upgrading on the CD; In step 44 according to 20 corresponding FLASH positions, the erasable normal application of the servo data that read memory block; Judge in step 45 whether renewal process finishes, as not continuing step 43, finishing like renewal gets into step 46; In step 46, wipe the software upgrading sign in the updating mark memory block 22, warm reset MCU in step 47.
The above is merely preferred embodiment of the present invention; In order to restriction the present invention, for example, servo module 12 can not be that CD is servo; Also can be that DVD is servo etc.; Servo initialization also can change the bluetooth initialization in the step 42, is provided by bluetooth module to Update Information, and realizes the software upgrading of car audio system; Moreover, can also comprise a step that the car audio system update software is converted to Bin (virtual drive) file and coils quarter before the step b; Or the like.All any modifications of within spirit of the present invention and principle, being done, be equal to replacement and improvement etc., all should be included within protection scope of the present invention.