Preliminary understanding hi3559v100 sdk double AMP system architecture

hi3559v100 Hass is launched camera soc processor. It uses a dual-core processor. One is a7, running linux3.18 kernel. One is the use of a17 is huaweiliteos operating system, Hi3559V100 system Huawei LiteOS media codec is responsible for system-related business. Construction of the two operating systems to achieve the form of amp.

First look at the contents of sdk.

Separately extracting two sdk package directory as follows:

image

As embedded software development, the focus on the following two directories:

  1. hardware

The main is a schematic diagram of some datasheet, demo board.

  1. sofaware

End plate, pc terminal, mobile terminal used to develop and debug maintenance package, toolkits and documentation

1. sdk software architecture:

image

  1. OSDRV layer mainly provides the underlying support package systems, such as Bootloader, OS, Rootfs template, the key driver and cross compiler tool chain, driving a dual-core communications.
  2. MPP layer and surveillance SDK original consistency, comprising a drive module related to the main media libraries, such as VI, VPSS, VENC, VO, etc., provide external MPI interface.
  3. Hisyslink communication system is a dual-core dual component for message communication, data transfer between two systems. To simplify the development of customers to reduce the difficulty in the two systems, the SDK package provides media adaptation NDK reference code, for your reference, the customer in the actual product development process, the MPI interface may be based on the target market product form, based on audio and video data streams and business functions reseal.
  4. Middleware layer provides a typical major business components, such as video, photographs, document management, playback, GUI and network transmission and so on.

2. sdk deployment of dual-core businesses:

image

  1. NDK media services deployed in the dual system.

NDK i.e., media-related functions are substantially modules specific implementation (i.e. MAPI Local mode), and by providing a MAPI client side interface linux, provide external media services Huawei LiteOS. Between MAPI local and MAPI client communicate through dual-core communication component Hisyslink.

  1. References on Linux and Middleware side deployment, user-friendly extension.

  2. Hardware resources deployed in the dual system.

Media-related hardware deployed Huawei LiteOS side; but its associated peripheral controller interrupts, memory and other hardware resources should be based on product needs, dual system deployment.

3. IPCM

amp architecture deployed on soc, a linux, one is huawei liteos. Communication mechanism between the two systems: ICMP

Linux + Huawei LiteOS dual system service deployment, the hardware resources and functions media service realization are deployed in Huawei LiteOS end, and by inter-core communication, the media services extend to the Linux terminal, Linux offers and Huawei LiteOS end of the same interface definition. This requires Linux and Huawei LiteOS provide communication between the nuclear mechanisms to provide messaging and bulk data communication mechanism for the media business. IPCM inter-core communication component is designed for Linux + Huawei LiteOS dual-system inter-core communication design underlying components.

IPCM underlying communication mechanism to achieve based on shared memory + interrupt.

IPCM is based on multi-core shared memory region to communicate, each core (OS) has its own memory region of a (base address + length), while each of the other known core (OS) has a memory area (base address + length).

When sending a message (message with header), specify the target core ID (target) and a port (Port), a message to the memory area is filled object.

Upon receiving the message, read the data from its own memory area, reading a message according to the message header.

Between the dual-core news ready by GIC interrupt notice to the other, we need each other to read.

Hi3559V100 the basis repackaged IPCM HisysLink subsystem implemented, do not access the dual-core communication interface IPCM general. Here only initialization action IPCM modules.

  • Linux end

挂载 hi_ipcm.ko

  • Huawei LiteOS end

Call _ipcm_vdd_init (); IPCM initialization module.

Since IPCM use a memory area for Linux and Huawei LiteOS common access for message communication. When the execution rmmod hi_ipcm uninstalled IPCM modules of Linux, also you need to call at Huawei LiteOS _ipcm_vdd_cleanup to initialize IPCM. If initialization ends Huawei LiteOS Linux and to initialize the IPCM inconsistent (and to initialize the end of such initialization IPCM again, the other end of the corresponding operation is not performed), will lead to internal shared memory region is not synchronized, resulting in an access exception occurrence address a hanging system .

4. Shared File System sharefs:

Some applications running on Huawei LiteOS need to produce and write and delete temporary files among some configuration files. But Hi3559V100 the flash, sd, usb are deployed on the Linux side, leading to Huawei LiteOS not use yaffs, FAT file system like access to files. Therefore, the development Sharefs file system, a virtual file system in Huawei LiteOS end, the use of IPCM communication and shared memory to achieve the specified directory on the contents of its read and write Linux. Sharefs can help Huawei LiteOS read and write files from Linux end, similar to NFS. Sharefs specified directory access Linux can be used as flash, sd, usb, nfs, etc. mount point. In this way, enabling Huawei LiteOS access yaffs, FAT, NFS and other file system Sharefs. Huawei LiteOS files need to be accessed on the Linux end Sharefs specified directory, Huawei LiteOS can access the files they need. If the shared directory is liteos this directory, Huawei LiteOS Client Access / liteos directory, Linux is the end of the actual directory / liteos. Using open / read / write / lseek / close system calls in Huawei LiteOS end, it can also be used fopen / fread / fwrite / fclose and other standard I / O library access / liteos directory. Specific used as follows:

4.1 sharefs use:

Huawei LiteOS files need to be accessed on the Linux end Sharefs specified directory, Huawei LiteOS can access the files they need. Sharefs using the following steps:

Step 1. Sharefs in the directory osdrv / components / sharefs / sharefs, in its directory database compiled Linux execution ./build.sh end use (sharefs / out / linux / liblinux_sharefs.a) and APP (sharefs / out / linux / sharefs), library Huawei liteOS end use (sharefs / out / liteos / libsharefs.a). (This step has been completed by the top-level SDK compiler implementation, can not do)

Step 2. Huawei LiteOS / Linux use

Huawei LiteOS end use: sharefs / include / sharefs_client.h header file for use Sharefs used. IPCM is performed first initialization call _ipcm_vdd_init (); then call HI_ShareFs_Client_Init ( "/ liteos");

Initialization is complete, its mass participation "/ liteos" specify access for Sharefs file directory on the Linux side needs to have a directory with the same name. Users can specify their own Sharefs access to the directory. Use HI_ShareFs_Client_Check () interface to see whether Sharefs establish a connection. Returns true if a connection. Before the implementation of file access. Use HI_ShareFs_Client_Get_Path () interface to get access to the specified directory Sharefs. This directory actually exists in the Linux terminal file system.

Linux end use: IPCM first load module execution / komod / ipcm or insmod /komod/hi_ipcm.ko board at the root file system; APP performed if: sharefs &, if the library, the user calls the APP HI_ShareFs_Server_Init ().

Sharefs is used in Linux end user mode application, which will compete for CPU resources with other user mode programs. When the Linux end CPU usage is too high (large 80%), APP efficiency Sharefs will be affected, causing Huawei LiteOS terminal end Linux file access efficiency Sharefs decline, increases long visit. At this point the need to improve Sharefs process priority preemptive CPU resources, command: nice --19 sharefs &. When using Sharefs library, APP priority need to improve the use of its library.

Guess you like

Origin www.cnblogs.com/linhaostudy/p/11095342.html