Summary: this paper introduces real-time multitasking operating system in mC/OS-II GPRS terminal of the transplantations and application, as well as GPRS Terminal hardware components and software framework that details the mC/OS-II in ARM devices S3C44B0x chip transplantation procedure and GPRS Terminal software design.
Real-time embedded operating system for small and medium mC/OS-II embedded application that contains all the function modules in the kernel around is 10 KB, amount of RAM and the system's main tasks.
GPRS in the GSM network of currently running developed on the basis of the data service, can be used with the GSM modem technology, frequency, and the same TDMA frame structure.
Use of the existing base station subsystem (BSS), GPRS from the outset to provide comprehensive coverage.GPRS Terminal system consisting of hardware
GPRS Terminal system consists of control sections and GPRS wireless modules, as shown in Figure 1.
Figure 1 GPRS Terminal hardware architecture
In order to adapt to the embedded technologies at GPRS communication, system control part adopts S3C44B0x chip.
S3C44B0x is 16/32-bit RISC microprocessor, usually for handheld devices and applications provide a cost-effective solution.
S3C44B0x has a wealth of on-chip resources, either through a serial interface operation GPRS module, operating instructions for the at command set.
GPRS wireless module using the SIM300, the module supports GPRS for voice, data and SMS functionality, embedded TCP/IP protocol.
This module is mainly composed of RF antenna, internal Flash, SRAM, GSM baseband processor, matching power and a 60 foot ZIF socket. Where GSM baseband processor is a core part of its functions as a protocol handler that is used to handle external system through the serial port to send over the AT command. GPRS modules receive rate can reach up to the sending rate 86.2kbps 21.5kbps, ease of integration.MC/OS-II of transplantation
MC/transplanted OS-II is a very strong operating system, its source code is divided into hardware and hardware for both parts, transplantation, simply modify the hardware-related parts.
Transplantation mC/OS-II to S3C44B0X, demand to do the following:(1) to modify the data type
In order to maintain and platform-independent, mC/OS-II use after macro definitions of common types, such as INT16U, indicates that 16-bit unsigned numbers.
In transplantation, to map them into the correct type.(2) enter and exit a critical section
With the close and open the disruption, enter the critical section functions OS_ENTER_CRITICAL () and exit the critical section functions OS_EX2IT_CRITICAL ().
(3) set the stack growth direction
Different processor stack growth orientation, on S3C44B0X, its growth trend upward or downward.
However, because the compiler ADS only supports stack from top to bottom, and must be filled with decreasing stack, so here you want to set the direction of actual use as the down growth, i.e.#define OS_STR_GROWTH 1;
(4) task switching and scheduling
To task switching and scheduling has two methods, one is currently running tasks active call OS_Sched (), determine whether there is a higher priority task to run, if you have to switch it to the ready state, and then call OS_TASK_SW () produces a soft interrupts, interrupt vector points to the function OSIntCtxSw (), modify task stack, run the new task.
The second is to produce hardware interrupts, interrupt handler function called OSIntEx ().In the above process, produce soft interrupt and modify task stack code is associated with the processor, S3C44B0X soft interrupt compilation directive is SWI, stack and stack assembler instructions are STM and LDM.
(5) stack initialization
MC/OS-II created is called OSTaskStkInt () function to initialize the task stack, where the need to stack up to and after interruption of forms, usually including tasks start address, interrupt returns the address of the CPU registers, etc.
Also, ensure that the task is run in privileged mode, instead of the user mode.(6) clock cycle time interrupt
MC/OS-II beat with a clock interrupt latency and timeout function, Timer frequency generally 10Hz ~ 100Hz.
Set the timer code associated with the CPU, the interrupt vector must point to a beat mC/OS-II clock interrupt service routines OSTickISR ().System processes and tasks of the composition
This system, first call the initialize OSInit (), mC/OS-II all variables and data structures, then call ARM_init () initialize the timer's micro-controller and the serial port hardware, such as by calling OSTaskCreate (), then create individual tasks, last call OSStart ()-start system, start multiple task scheduling.
The entire system of control modules and process as shown in Figure 2.P>
Figure 2 system control modules and processes
The entire system of tasks including ARM control section of the keyboard scan, LCD display task and communication tasks and GPRS Terminal features short message task, task waiting for voice calls.
Therefore, in mC/OS-II system tasks include:Keyboard scan task task_sys_key scan (), including 4 × 4 keypad portion of the scan recognition keyscan (), as well as the corresponding keys feature coding implementation keyscan_code (), etc.
LCD display task task_sys_ lcddis (), including the background content display display_context (), enter the content display display_input (), the output displays display_output (), etc.
Communication task task_sys_ communication (), including system and host communication function host_msg () to achieve through the computer system operation, there are various tasks communicate processing msg_tasl ().
Voice call task task_sys_ telephone (), including phone calls gprs_phone_call (), telephone answering gprs_phone_recevie (), etc.
In addition, also including the system of SMS sending and receiving tasks.Depending on the system for GPRS SMS and voice communication function sets the priority of individual tasks as shown in table 1.
Conclusion
MC/OS-II real-time operating system is open source and get actual authentication software platform, and S3C44BOx with powerful 32-bit RISC performance, based on the software and hardware platform for GPRS module design, can reduce research and development tasks, increase the speed of research and development, as in a short time to realize the GPRS Terminal system design to create good conditions.
No comments:
Post a Comment