after - Spring Festival came back, the use of the days before work, the first to write this article, it was written first DAVINCI DM3730 Development Strategy-- linux-2.6.32 transplant, but that article involved the kernel of things too much, not very good to write, and I have not written a new article for a long time, first published this article. Later thought, from the perspective of application usage analysis, and then step by step into the kernel inside, perhaps better.
Previous several DM3730 development introduction: A DaVinci DM3730 Board program consists of Xload,uboot, linux-2.6.32 or (linux-2.6.37), file system Rootfs and many applications stored inside the file system, This order is in the order of the CPU run, or from the point of burning to NAND Flash: The name of our technology is: dm3730_xload.bin,dm3730_uboot.bin,dm3730_kernel.bin,dm3730_ Ubifs.bin (contains many applications, we use UBIFS instead of JFFS2), and some customers add bin files such as their app app.
1 , File system migration:
In the DVSDK4_03 installation package inside (not clear netizen can first see I in 51CTO blog a "DAVINCI DM3730 development Strategy--dvsdk4_03 and dual-core codec mechanism introduction"), I developed a directory dvsdk4_03\filesystem, Others Ti (including the Co-operative 3rd party) have provided arago-base-tisdk-image-dm37x-evm.tar.gz and dvsdk-dm37x-evm-rootfs.tar.gz, of which ARAGO-BASE-TISDK-IMAGE-DM37X-EVM . tar.gz is a 3rd-party clipping of the file system, very suitable for burning NAND flash inside, can also be directly decompressed as NFS File System (NFS environment settings See I 51CTO blog a "DAVINCI DM3730 development Strategy-development Environment chapter") While dvsdk-dm37x-evm-rootfs.tar.gz is a file system that is not trimmed, numerous applications, valuable LIB files, test programs, including applications that test dmai routines, encode applications, decode applications, WiFi application and so on, pay special attention to usr/share/ti inside example, in short very rich, concrete what value, also need to have the interest in this aspect to develop the Netizen oneself opens the folder to look.
650) this.width=650; "style=" width:676px;height:461px; "title=" app-1. JPG "src=" http://s3.51cto.com/wyfs02/M02/59/D8/wKioL1TtPjXBTqeyAAGgU7vwlxc721.jpg "width=" 688 "height=" 457 "alt=" Wkiol1ttpjxbtqeyaaggu7vwlxc721.jpg "/>
Figure-1 Dvsdk-dm37x-evm-rootfs about TI test application
This dvsdk-dm37x-evm-rootfs.tar.gz is super big, not suitable for burning into NAND flash inside. We are also on the basis of arago-base-tisdk-image-dm37x-evm.tar.gz, dvsdk-dm37x-evm-rootfs.tar.gz useful things copy, and then add their own development of the application and modified script, but also to arago- Base-tisdk-image-dm37x-evm.tar.gz to cut, only to get their own product file system Rootfs. This rootfs can be used as an NFS test, or you can use tools such as MKFS.UBIFS,MKFS.JFFS2 or MKSQUASHFS to create a product file system (such as Xxx.bin or xxx.img files) written to the board NAND Flash. As for these file system how to make, here is no longer cumbersome, because many netizens have written a lot of blog articles to introduce, especially omap3530,dm3730 ubifs, I do not need to say more (off-topic, We met some customers on the NFS file system and burning to NAND file system do not know how to do davinci embedded products, can only say that they mister Rich dependents and projects to burn money ah, this customer we now dare not sell the development board. Now the network is so developed, the technical article is very many, there are other hundreds of pieces of the Linux embedded Development Board a lot of money, at the university casually buy back study, a little difficult to learn. From the major portals of the forum, the major gods are under the judgment, starting from 2015, the domestic enterprise bankruptcy Tide mode opened, find a job more difficult, if the family is not good students and other people go to play, the bitter fruit and so on to the society slowly taste it. Previously in the DM368 development strategy said that the crisis has "dangerous" also has "machine", skilled talent is still very popular, after all, is now a global village model, technology or has been moving forward, the elimination of the low-efficiency low-technology threshold of enterprises).
2 , DVSDK video Application Introduction
Introduction to the file system porting, now can introduce the application, previously written DM6446 development strategy, there is no separate introduction, Here we to improve the DaVinci development strategy, Add. We take Ti davinci the most classic audio and video Encode example, this encode involves the original image acquisition and DSP calls, multithreading how to work together, very valuable. TI DaVinci Dual-core chip dm6446,dm6467t,dm3730 These classic chips are the same application architecture. In the dvsdk4_03\dvsdk-demos_4_02_00_01\omap3530 directory, there are encode,decode,edge_detection three examples, of which Edge_ Detection (edge detection) used to c6accel Lib, focusing on DSP algorithm porting, not very classic, we do not introduce, decode is also relatively simple, is how to call H264 decoding, MPEG4 decoding, JPEG decoding, audio g711 decoding. We still choose Encode introduction, see encode how to record h264 video files and g711 audio files (while modifying can support MPEG4 or JPEG compression). Combined with my "DAVINCI DM3730 development Strategy--dvsdk4_03 and dual-core codec mechanism introduction", through this encode concrete example, more in-depth understanding of how the dual-core work.
To properly compile the encode example, you must compile the kernel linux-2.6.32 and other related elements, and finally compile the encode example, see my 51CTO Blog "DAVINCI DM3730 development Strategy--dvsdk4_03 and dual-core codec mechanism introduction , this article is very important, by the way, the other elements are compiled, the corresponding temporary files and output files, these are the next level to compile the dependent files of the element, you to one of the make clean and other cleanup commands, the following element module must not be compiled past. The encode example calls directly to the Dmai element (Dvsdk4_03\dmai_2_20_00_15\packages\ti\sdo\dmai) instead of dealing directly with the kernel or directly to the DSP. Dmai is a packaged middleware, Dmai can directly through the Open device node and the kernel driver to deal with, but it is not directly to call the DSP SERVER, but to call the codec-engine inside the visa interface, Only codec-engine with elements such as Dsplink can call DSP SERVER. This refers to the DSP server is c64+ DSP program, a DSP core only a DSP server (is compiled cs.x64p), and a SERVER can have n DSP algorithm codecs, is that a lot of h264,jpeg, MPEG4 encoding and decoding, g711, AAC audio codec, and customer's own algorithm (such as the ty_video_copy algorithm of our Tong Ye technology).
We open the Dvsdk4_03\dvsdk-demos_4_02_00_01\omap3530\encode folder, first open makefile, modify line 79th,
#SOURCES = $ (wildcard *.c) $ (wildcard). /*.C) comment out
#HEADERS = $ (wildcard *.h) $ (wildcard). /*.h) comment out
Change to:
SOURCES = $ (wildcard *.c)
HEADERS = $ (wildcard *.h)
Then copy the dvsdk4_03\dvsdk-demos_4_02_00_01\omap3530\ctrl.c,ctrl.h,demo.h,ui.c,ui.h 5 files into the Encode folder, We do this because these files and Decode folder sharing files, if the 5 files modified, will affect both encode and decode, in order to maintain the independence of the project, we still copy to each file inside, then need to encode inside of almost every source file, Change the code (#include ") with the path to the header file include Demo.h. /demo.h "Change to # include" Demo.h "). After reference encode to establish their own projects, such as our tvp5158_d1, fully reference encode example, almost identical, encode inside is encode.cfg, do not need to modify, the following to take the side of the file introduced.
650) this.width=650; "Title=" app-2. JPG "src=" http://s3.51cto.com/wyfs02/M02/59/DC/wKiom1TtPUexTKpzAAGZlemaUJU370.jpg "alt=" Wkiom1ttpuextkpzaagzlemauju370.jpg "/>
Figure-2 Encode example inside the source code
capture.c
3 , compiling and running the encode example
Our introduction to the DAVINCI DM3730 development Strategy--dvsdk4_03 and the dual-core codec mechanism describes how to compile modules such as cmem,sdma,dsplink,lpm,codecs, especially the total dvsdk4_03\ Makefile and the total Path environment parameter Rules.make, according to the total Makefile compilation method, the compiled module all automatically copy to the NFS file system:
/HOME/DAVINCI/DM3730/DVSDK4_03/FILESYSTEM/DM3730ROOTFS/OPT/DVSDK/DSP directory,
My article specifically wrote a script, how to compile these elements, such as the total makefile have a cmem compile and install:
Cmem_install:
Install-d $ (exec_dir)/DSP
Install $ (cmem_install_dir)/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.ko $ (exec_dir)/DSP
We define exec_dir in the last sentence of the total rules.make,
# Where to copy the resulting executables
Exec_dir=/home/davinci/dm3730/dvsdk4_03/filesystem/dm3730rootfs/opt/dvsdk
Compile the relevant modules, and finally to compile demos, that is, our encode or my tvp5158_d1, directly into the Dvsdk4_03\dvsdk-demos_4_02_00_01\omap3530\encode directory to use make Clean and make, you will get encode this executable Linux application, you can copy this application to the NFS file system specified directory/home/davinci/dm3730/dvsdk4_03/filesystem/ Dm3730rootfs/opt/dvsdk.
OK, compile if everything OK, and the board analog video connection, or microphone connection, you can power the board, into the NFS mode on line debugging, execute the following command:
Record the H264 video file in the current directory (FILESYSTEM/DM3730ROOTFS/OPT/DVSDK):
./loadmodule.sh
./encode–v xxxxx.264
Recording G711 audio files
./loadmodule.sh
./encode–s xxxxx.g711
Recording video using the-v parameter, recording audio using the-s parameter, these are in the main.c inside there, you can analyze the source code.
Run for 10 seconds, use CTRL + C to terminate the operation, then the NFS file system on the Linux server/home/davinci/dm3730/dvsdk4_03/filesystem/dm3730rootfs/opt/ DVSDK below to get the xxx.264 file just recorded.
This loadmodule.sh basic content see below (Tong Ye Technology DM3730 Development Board use):
# Tongye Tech. Memory Map for DM3730 EVM without Android
# Start Addr Size Description
# -------------------------------------------
# 0x80000000 MB Linux
# 0x87800000 MB Cmem for ARM and DSP
# 0x89800000 104 MB CODEC SERVER for DSPs (20M for DDR2)
Insmod/opt/dvsdk/dsp/cmemk.ko phys_start=0x87800000 phys_end=0x89800000 allowoverlap=1 useHeapIfPoolUnavailable=1
Insmod/opt/dvsdk/dsp/dsplinkk.ko
Insmod/opt/dvsdk/dsp/lpm_omap3530.ko
Insmod/opt/dvsdk/dsp/sdmak.ko
In another 51CTO blog "DAVINCI DM3730 Development Raiders-u-boot-2010.06 Transplant" refers to the Uboot parameter Bootargs, there is an [email protected] Parameters:
This parameter corresponds to the address one by one assigned to the MEMMAP.TCI in the loadmodule.sh, Dvsdk4_03\codecs-omap3530_4_02_00_00\packages\ti\sdo\server\cs directory, [ Email protected] means that from 0x80000000 this memory is allocated to Linux, followed by the 0x87800000 from the beginning of the allocation of 32M dedicated to Cmem (all dual-core DaVinci Chip) important shared memory segments, The last side of 104M is assigned to the DSP, ARM and DSP can access 32M of shared memory, the above mentioned capture.c and video.c using the Buftab_create () function produced by the buffer is pointing to this memory, Therefore, the customer's own algorithm can be collected from arm to the original Yuv4:2:2 data in the DSP end of the image analysis. Above those insmod dynamic load several important element drive, is necessary, otherwise cannot go to run DSP SERVER.
The above is from the encode application point of view to further analysis of DVSDK software architecture, the development of DM3730 users should be a little help. This 2014 the company has been more difficult, the company's operating costs are increasingly high, and the products sold to customers more and more thin (I think most of China's companies have encountered the same problem, the burden of more and more heavy, the environment is getting worse), but also encountered some cooperation unpleasant companies, found that Ti davinci Solution , the more advanced the CPU development cycle longer, so the big six months did not write the article. Do products and prototyping is not the same thing, and big customers do a large-scale production of products very consumption of my energy, but for the survival of the company, there is no way. Also because too tired, the company also adjusts business, not too want to do development board. We are able to persist in the DaVinci solution because TI has a long CPU life cycle with DSP, as well as several cooperative happy old customer support. DM3730 acquisition of 1/3-inch CMOS SENSOR 720P or 1/4-inch COMs 2 million is still possible, low power is placed there, a high-definition 720P Intelligent Video Analysis camera power consumption is less than 4 watts. Very suitable for low-cost face recognition, low-cost license plate recognition, low-cost HD IVs product design, 4CIF binocular analysis products. Of course, to do 1080P 60 frame HD products can only use dm81xx, but this dm81xx solution cost is quite expensive, power consumption generally more than 10 watts.
Write so much, I hope to develop in this area of netizens have help, there are errors in the place can point out the correction, thank you.
This article is from the "Integrated system-embark on a civilized Journey" blog, please be sure to keep this source http://zjbintsystem.blog.51cto.com/964211/1615150
DAVINCI DM3730 Development Strategy--application routine analysis