i.MXプロセッサ ナレッジベース

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

i.MX Processors Knowledge Base

ディスカッション

ソート順:
通常的音乐播放是这样一个流程: alsa将一段上层的应用空间和底层的物理空间通过mmap映射起来,然后DMA从被映射的物理空间往I2S的fifo传送数据。 现在有个客户想将FEC网络那边收到的数据中的audio数据分离出来,暂存到一段物理内存中,然后通过DMA传输到我们芯片的I2S fifo,从而节省掉数据在上层、底层之间来回调用的时间。 这就需要我们I2S这边支持通过DMA直接从一段物理内存拿数据。 为了较为方便的实现这一功能,通过对ALSA架构的分析,我保留了我们整个ASoC代码的架构,只是不让DMA从原来的mmap的地址拿数据,而是从我自己分配的DMA内存中拿数据。 258         uint8_t *wbuf; 259         uint8_t *index1; 261         wbuf = dma_alloc_coherent(NULL, 0x10000, &wpaddr, GFP_DMA); 265         for (i=0; i<0x10000; i++) { 269                         *(wbuf + i) = wav_data[i]; 273         } 333                 iprtd->desc = chan->device->device_prep_dma_cyclic( 334                         chan, wpaddr, 335 //                      chan, dma_addr, 336                         iprtd->period_bytes * iprtd->periods, 337                         iprtd->period_bytes, 338                         substream->stream == SNDRV_PCM_STREAM_PLAYBACK     ? 339                         DMA_TO_DEVICE : DMA_FROM_DEVICE); 代码实现上,实际上是比较简单的,可以套用以前做过的dma_m2m的部分代码。 现在我们要拿一些wav里面的audio数据。 linux可以用16进制的方法读wav里面的数据: hexdump -n 65700 -C audio44k16S.wav > wav_data_44100_s16_stereo.h将audio44k16S.wav 里面的audio数据用16进制的形式保存到wav_data_44100_s16_stereo.h这个文件里。 然后我们要编辑这个头文件里的audio数据,原数据是这种格式的: 00000000  52 49 46 46 12 63 0c 00  57 41 56 45 66 6d 74 20  |RIFF.c..WAVEfmt | 00000010  12 00 00 00 01 00 02 00  44 ac 00 00 10 b1 02 00  |........D.......| 00000020  04 00 10 00 00 00 66 61  63 74 04 00 00 00 b5 18  |......fact......| 00000030  03 00 64 61 74 61 d4 62  0c 00 58 01 f0 00 98 01  |..data.b..X.....| 00000040  56 01 3d 01 1e 01 d0 00  ae 00 81 00 35 00 40 00  |V.=.........5.@.| 00000050  dd ff f7 ff 90 ff 9f ff  1d ff 54 ff bb fe 18 ff  |..........T.....| 00000060  61 fe 1e ff e7 fd 5e ff  e4 fd 23 00 39 fe ee 00  |a.....^...#.9...| 我们要把它转换成符合我们要求的这种形式: ,0x63 ,0xf0 ,0x0f ,0xf0 ,0x7f ,0xf1 ,0x21 ,0xf1  ,0x89 ,0xf3 ,0xef ,0xf2 ,0x9d ,0xf5 ,0x8c ,0xf4 ,0x5f ,0xf7 ,0xd3 ,0xf5 ,0x8c ,0xf8 ,0x08 ,0xf7  ,0x4c ,0xf9 ,0x01 ,0xf8 ,0x74 ,0xf9 ,0x2e ,0xf8 ,0x1c ,0xf9 ,0x15 ,0xf8 ,0x09 ,0xf9 ,0x82 ,0xf7  ,0x45 ,0xf9 ,0xd1 ,0xf6 ,0x0b ,0xf9 ,0x1e ,0xf6 ,0xce ,0xf8 ,0xbe ,0xf5 ,0xd7 ,0xf8 ,0x9a ,0xf5  ,0xa8 ,0xf9 ,0xc7 ,0xf5 ,0xe0 ,0xfa ,0x3e ,0xf6 ,0x25 ,0xfc ,0x44 ,0xf7 ,0x44 ,0xfd ,0xa2 ,0xf8  ,0x9a ,0xfe ,0xea ,0xf9 ,0x25 ,0x00 ,0x94 ,0xfb ,0x16 ,0x02 ,0xec ,0xfc ,0xcb ,0x03 ,0xfe ,0xfd  ,0xef ,0x04 ,0xa5 ,0xfe ,0x45 ,0x05 ,0x0b ,0xff ,0x3b ,0x05 ,0x24 ,0xff ,0x34 ,0x05 ,0x94 ,0xff  ,0x06 ,0x05 ,0x13 ,0x00 ,0x6c ,0x04 ,0x82 ,0x00 这里有一个比较好的方法, 可以通过VIM 垂直编辑的方法较为轻松的实现。 vim垂直编辑: ctrl+v 然后上下左右移动选中,D删除选中的。 ctrl+v 选中, shift+i 可以在选中的地方加入想插入的字符。 将编辑过的数据放到uint8_t wav_data[],赋值给wbuf,wbuf对应的物理地址wpaddr中的数据,就是上面wav中的audio数据。 wbuf = dma_alloc_coherent(NULL, 0x10000, &wpaddr, GFP_DMA);中的0x10000=1024*64是我们分配的dma内纯的大小,我们sdma是根据以下大小传输数据的: iprtd->period_bytes = 21844, iprtd->periods = 3 //21844*3=65532= 0xfffc 这样实际上DMA是不停的刷我们分配的内存里的数据,因为我们没有更新DMA内存里的数据,所以听到的是不断重复播放的声音片段。 刚开始时,我听这个片段,发现片段之间有较为明显的pop音,这是由于我截取的是一首音乐开始的部分,包含了wav包头数据,这不是音乐数据,将这个去除就可以了。
記事全体を表示
For most of interlace output camera sensors, they only support up to 30fps sample rate. In this case, we may not get good display quality. In order to improve the permance under this case, we can use IPU VDI function to increase the output frequency to be 60fps and then we can get a better quality. The patch is an example to support YUV422(YUYV) 60fps VDI for Android camera preview. SW Platform: kk4.4.2_1.0.0-ga HW Platform: imx6q-sabresd Features: Support YUV422(YUYV) input format; Support IPU 60fps VDI; Supprot 60fps camera preview, but don't support camera capture. Patch: The linux kernel patch to support additonal IPU function can be found at: https://community.freescale.com/docs/DOC-173003 The Android Camera HAL can be found at here. Note: 1. The g_vdi_double is used to decide whether to support these features. When g_vdi_double is set to be 1, these features will be enabled; Or these features will be disabled and camera feature will be the same with default release. 2. The patch should be used at hardware\imx\mx6\libcamera2. 3. Accoeding to the real user case, the user can set IPU VDI motion mode to be 0 or 1 , but NEVER to be 2. 4. The fps can be up to 60fps, but it is not stable now.
記事全体を表示
[中文翻译版] 见附件   原文链接: https://community.nxp.com/docs/DOC-343178 
記事全体を表示
Fix cdc_ether connection over usb0 stalls and cannot recover after transmitting few MByte data The patch is modified from ENGR00278073.
記事全体を表示
INTRODUCTION REQUIREMENTS HARDWARE CONNECTIONS IMPLEMENTATION AND TESTING 1. INTRODUCTION This document explains how to generate and compile a custom Linux application on the UDOO NEO board  for using the GPIO headers to connect a 16x2 LCD. 2. REQUIREMENTS First of all, the Linux image used is UDOObuntu 2 RC1 (Ubuntu 14.04), available for download from the following link:      Downloads - UDOO​ For creating a bootable SD card and other basic setup please refer to the following guidelines:      Very First Start Then, it is required to install the proper drivers to ensure connectivity, including USB communication with Linux terminal of the target board. Please refer to the link below:      Usb Direct Connection The LCD driver of this document was already implemented on a previous application, and could be found on the following document: Customizing MQX applications on i.MX6SX. 3. HARDWARE CONNECTIONS Now, the hardware connection considers a 4-bit interface to the LCD plus the Register Select (RS) and Enable (E) pins, so, six GPIO are used. For this example, digital input/output pins are used as shown on the following figure (purple rectangle): Where: NEO GPIO GPIO148 GPIO105 GPIO149 GPIO140 GPIO141 GPIO142 LCD pin E RS DB7 DB6 DB5 DB4 4. IMPLEMENTATION AND TESTING After booting Linux, a text editor like nano should be used to generate the program. The three main configurations for GPIOS are the following (using the E pin as example): Export the GPIO. echo 148 > /sys/class/gpio/export Configure the direction of the GPIO (as output). echo out > /sys/class/gpio/gpio148/direction Set the GPIO value to Low or High: echo 0 > /sys/class/gpio/gpio148/value echo 1 > /sys/class/gpio/gpio148/value So, based on these configurations and the LCD driver already implemented on the document mentioned on Requirements section, the complete C application for Linux could be generated (find it attached). The GCC compiler already included on the UDOObuntu image could be used to generate the executable application. The picture below shows the terminal of the UDOO NEO board including the text editor, compilation and execution commands of the application. The used commands are the following: $ nano lcd16x2_imx6sx.c $ sudo gcc lcd16x2_imx6sx.c -o lcd $ sudo ./lcd Finally, the following image shows the LCD with the application working on the UDOO NEO board, connecting the LCD using a proto shield: NOTE: Ensure that M4 core is not running or using the same pins, in order to avoid unexpected behavior on GPIOs.
記事全体を表示
Q:Is there an issue using odd DIV_SELECT values? When setting the CPU clock (maybe others also) in uboot, the code will only use even valuesfor the DIV_SELECT field. There is nothing in the Reference Manual or Errata that indicates only even values can be used for this field. There were 2 SR's that had conflicting answers and we are trying to determine what can be used. The CPU freq setting trying to be achieved is 996MHz. With a 24MHz source, you need 24MHz x 41.5 = 996MHz. Since the DIV_SELECT is x2, a value of 83 would be needed. A: Below is the DIV_SELECT description of ARM PLL, since the Fin is 24MHz, so there is no odd issue of DVI_SELECT, as 24 / 2 = 12MHz. Such as for 996M, this value is 83, that is fine. "This field controls the pll loop divider. Valid range for divider value: 54-108. Fout = Fin * div_select/2.0." This document was generated from the following discussion: mx6Q PLL Setting
記事全体を表示
Overview i.MX6Dual/Quad supports using internal LDO or bypass internal LDO. LDO bypass is helpful to save power consumption and reduce thermal under high loading use cases because the power consumption on internal LDO can be saved. The purpose of this document is to introduce how to enable LDO bypass based on i.MX6 R13.4.1 release on i.MX6Dual/Quad SabreSD board. Constraint LDO Bypass solution currently can only be applied to i.MX6Dual/Quad 1GHz. LDO bypass function will force disabled on i.MX6Dual/Quad 1.2GHz, but customer can estimate this function through limit the max ARM frequency to 1GHz by command line 'arm_freq=1000' on i.MX6Dual/Quad 1.2GHz . Hardware Voltage Settings The following table lists the voltage settings in each working CPU frequency and VPU frequency with LDO bypass solution: VPU Frequency ARM Frequency VDDARM_IN (V) VDDSOC_IN (V) 0 to 352MHz 996MHz 1.25 1.25 264-> 352MHz 702MHz 1.15 1.25 0 to 264MHz 792MHz 1.15 1.175 264->352MHz 396MHz 0.95 1.25 <264MHz 396MHz 0.95 1.175 VDDARM_IN and VDDSOC_IN voltage setting should be within the voltage range, considering the ripple: VDDARM_IN - ripple>VDDARM_INmin VDDARM_IN + ripple<VDDARM_Inmax For the Min/Max value, refer to the i.MX6Dual/Quad data sheet. The above list is based on SabreSD PFuse-100. Software Changes Please apply the patches into Android-13.4.1-LDO_BYPASS-pathes.tar.gz.gz based on R13.4.1. The change lists: uboot-imx: move LDO bypass code and one PFUZE1.0 workaround code to kernel. Remove CONFIG_MX6_INTER_LDO_BYPASS in u-boot. kernel: A set of patches are used to support LDO bypass enable/disable by command option. How to Enable/Disable LDO Bypass After applying for above patches, you can add command option into boot command line to enable or disable LDO: Command option “ldo_active=off”: Enable LDO bypass mode Command option “ldo_active=on”: Enable LDO active
記事全体を表示
This is a copy of the currently posted i.MX 6DQ reference manual, revision 2, published Jun 2014.  This is part 2 of 2, and includes chapters 44-71, Appendix A and Appendix B.  Go here for part 1: i.MX 6DQ Reference Manual (IMX6DQRM R2, Part 1) This document is to be used to enter community comments.  Please feel free to add inline comments in this reference manual. You can point out where more information is needed or where existing information is incorrect.  You can also enter information in your comment that expands on existing information in the document, based on your experience with the device.  If you are pointing out that more information is needed in a paragraph or a section, please be very specific, not “needs more information”.  Your comments in this manual may help other members and will drive improvements in this and future documentation. Note: The doc viewer does not support going directly to a specified page.  Instead of manually paging through one page at a time, you can do a search on a string on a page such as "types of resets", or you can go to chapter links listed in the inline comments.  To do this, page down to the comments below the doc view, select "Inline Comments", sort the comments by "page", and then select the chapter you want to view.  You may find it easier to use this manual by downloading and viewing it in your local Adobe Reader.  Then when you have a comment/question to add to this review copy, navigate to the chapter as described above and then do a search on the text for which you want to add a comment.  This will take you to that page the quickest.
記事全体を表示
In L2.6.35_11.09.01_ER BSP Uboot, the MMC driver was updated, but there is issue that when you modified some uboot code, the MMC driver has chance to fail to work. The root cause is that mmc->has_init hasn't been initialized. Sometimes the value will be not zero, then mmc driver will be skipped for initialization. Attached is the patch to fix this issue in L2.6.35_11.09.01_ER BSP Uboot.
記事全体を表示
Sometimes there is a requirement to make display work in portrait mode when physical panel is in landscap mode. setprop persist.demo.rotationlock true setprop persist.demo.remoterotation portrait The above codes can be set in init.rc to take effect when android boot up.
記事全体を表示
as we known, mx6sx doesn’t have IPU, if we need to resize, rotation or blending…., we can use pxp module, this part, we talk about rotation for example. We also can use GPU for rotation, but in imx6sx, the number after 6sx in the part number stands for the chip including gpu or not, the number 4 and 3 mean mx6sx has gpu, like MCIMX6X3EVN10AB. and 1,2 and 3 mean mx6sx doesn’t have gpu, like MCIMX6X2EVN10AB for gpu, we know we can use xrander to rotate ,in this part, we focus on pxp rotation the stesp: enable pxp in the kernel:               $ bitbake -c menuconfig linux-imx, then choose Device Drivers ---> DMA Engine support ---> [*] MXC PxP support [*] MXC PxP Client Device 2) download the built image from tmp/deploy/images/imx6sxsabresd 3) boot up the board, then you can find the pxp_v4l2_test.out in the unit test 4) use the command as below to test the rotation: ./pxp_v4l2_test.out -sx 480 -sy 272 -res 352:240 -a 100  -r 90 fb-352x240.yuv BLANK   Sx and sy is resolution for display, -res is resolution for image or video. -r is for rotaion, you can set 0,90,180 and 270 for it. I attach the fb-352x240.yuv for testing
記事全体を表示
The getevent function shows kernel events like press button events, touchscreen events, sensor events (like accelerometers or magnetometers). bash-3.2# getevent -h Usage: getevent [-t] [-n] [-s switchmask] [-S] [-v [mask]] [-p] [-q] [-c count] [-r] [device]       -t: show time stamps       -n: don't print newlines       -s: print switch states for given bits       -S: print all switch states       -v: verbosity mask (errs=1, dev=2, name=4, info=8, vers=16, pos. events=32)       -p: show possible events (errs, dev, name, pos. events)       -q: quiet (clear verbosity mask)       -c: print given number of events then exit       -r: print rate events are received Bellow an example of all events on some board bash-3.2# getevent -p add device 1: /dev/input/event2   name:    "mxc_ts"   events:       SYN (0000): 0000  0001  0003       KEY (0001): 014a       ABS (0003): 0000  value 0, min 0, max 0, fuzz 0 flat 0                         0001  value 0, min 0, max 0, fuzz 0 flat 0                         0018  value 0, min 0, max 0, fuzz 0 flat 0 could not get driver version for /dev/input/mouse0, Not a typewriter add device 2: /dev/input/event1   name:    "mxc_power_key"   events:     SYN (0000): 0000  0001     KEY (0001): 003e add device 3: /dev/input/event0   name:    "mxckpd"   events:     SYN (0000): 0000  0001     KEY (0001): 0002  0003  0004  0005  003b  003c  003d  003e                       0066  0067  0069  006a  006c  008b  009e  0161 could not get driver version for /dev/input/mice, Not a typewriter For example, some touchscreen event. Any touchscreen press-up or press-down will return a vector of values related with the event (please, see include/linux/input.h for detail) bash-3.2# getevent /dev/input/event2 0003 0000 0000020e 0003 0001 0000014a 0003 0018 00000037 0001 014a 00000001 0000 0000 00000000 0003 0000 00000209 0003 0001 00000147
記事全体を表示
Description       this doc is explain how to develop a audio card driver base on i.MX6 platform. which explain the ASOC architecture struction basic knowledage and then give some sample for the audio driver development like: 1:NXP SGTL5000: NXP i.MX BSP sabrelite board default support it. 2: Wolfson WM8524.    A: 3.0.35 BSP support: i.MX6 setbox BSP support it:(which in elder fsl community link and out of data)    B: 3.14.28 BSP support pls check attachment: 3: Wolfson WM8960.     which include how to add the android middle-layer and driver, pls check attachment. 4: TI TLV320AIC3120      which include how to add the android middle-layer and driver, pls check attachment. 5: TI TLV320AIC3X   Products Product Category NXP Part Number URL MPU i.MX6 Family https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/i-mx-applications-processors/i-mx-6-processors:IMX6X_SERIES   Tools NXP Development Board URL i.MX6 SabreSDP https://www.nxp.com/design/development-boards:EVDEBRDSSYS#/collection=softwaretools&start=0&max=25&query=typeTax%3E%3Et633::archived%3E%3E0::Sub_Asset_Type%3E%3ETSP::deviceTax%3E%3Ec731_c380_c127_c126&sorting=Buy%2FSpecifications.desc&language=en&siblings=false which have a doc MX6X_ASOC_V5-20191115.pdf and related driver sample codes.
記事全体を表示
The vbs file is a script file in mfgtool. In fsl android lollipop consolidate and later MFGTOOL version, You just need add a new vbs item for new board and have not need to change the ucl2.xml. The below is the example struct. Set wshShell = CreateObject("WScript.shell") wshShell.run "mfgtool2.exe -c ""linux"" -l ""SDCard-Android"" -s ""board=sabresd"" -s ""folder=sabresd"" -s ""soc=6dl"" -s ""mmc=2"" -s ""data_type=-f2fs""" Set wshShell = Nothing Explain for each option: -l: storage type      There three type for android: Nand-Android\eMMC-Android\SDCard-Android -s: extend variable      board: It is used to download uboot and dts in init system.      folder: there are three type: sabresd sabreauto evk                the android image is located in: files/android/%folder%/      soc: Used to define android image name. types: 6q, 6dl, 6sx, 6sl.      mmc: define the storage idex.      data_type: if the type of data partition is f2fs, need define data_type=-f2fs      ldo: if the board is 1.2G, need to define it to -ldo      plus: if the board is 6qp, need too define it to p
記事全体を表示
The i.MX6Q-SDP is used to stream OV5642 parallel camera video encoded as JPEG using the hardware CODEC engine to a Linux client which decodes and displays on the screen.
記事全体を表示
Question: What’s the best way to rotate a MX6 image 90 degrees, thought the IPU correct? IPU is limited to 1024x1024. Apparently we don’t support frame buffer rotation in the IPU, so we have to use some middleware. I know that Android’s surface flinger uses the GPU but do you know what we can use in Linux that uses H/W acceleration also? It looks look like X-server can rotate only when the Vivante driver is not  loaded, which means the hardware is not implementing rotations. Answer: it should be possible to split the picture into two halves and rotate them separately. Well, two halves if you can reduce the line count to 1024 … otherwise it would be 4 rotates. X11 Xrandr will be implemented on GPU sometime this year. It's in the R&D queue but as low priority. They could use GC320 low level API to rotate (if they use linux frame buffer). It implies a blit but it would be done by GC320 they will probably need to use virtualFB too. The API documentation is the BSP documentation (iMX6.2D.API.pdf) Attached a simple source using the 2D low level API. VirtualFB: https://community.freescale.com/message/289198
記事全体を表示
JAVA on i.MX Sun Microsystems has pre-built versions of Java Virtual Machine for ARM Processors. It's possible to download them at: http://java.sun.com/javase/downloads/embedded.jsp All pre-built software mentioned on site above are distributed as evaluation software. For more information about use and license, please contact Sun Microsystems i.MX31 PDK will be used as an example to describe installation, compilation and execution procedures. It can be easily done for other i.MX platforms Installing Sun Java on i.MX For i.MX31, i.MX35, download the following version: Usage Headful Binary Version Non-Graphical Applications ARMv6 Linux - Headless (Early Access) EABI, glibc 2.5, Hard Float (VFP), Little Endian Graphical Applications ARMv6 Linux - Headful (Early Access) EABI, glibc 2.5, Hard Float (VFP), Little Endian For i.MX21, i.MX25, i.MX27, download the following version: Usage Headful Binary Version Non-Graphical Applications ARMv5 Linux - Headless (Early Access) EABI, glibc 2.5, Soft Float, Little Endian Graphical Applications ARMv5 Linux - Headful (Early Access) EABI, glibc 2.5, Soft Float, Little Endian On following example, a graphical application will be compiled, the headful version will be used. This example uses X11 as graphical server. On LTIB, select X11 and also the package libXtst and libXi. Extract the downloaded package (in this case "ejre-1_6_0_10-ea-b39-linux-armv6-vfp-eabi-min-eval-30_jul_2009.tar.gz") tar xzvf ejre-1_6_0_10-ea-b39-linux-armv6-vfp-eabi-min-eval-30_jul_2009.tar.gz Create a new folder on <LTIB Directory>/rootfs/ called ejre1.6.0_10 cd rootfs sudo mkdir ejre1.6.0_10 Copy all files and folders located inside the extracted package to <LTIB Directory>/rootfs/ejre1.6.0_10/ cd rootfs/ejre1.6.0_10 cp -a ../../ejre1.6.0_10/* . Include the bin folder to the PATH: export PATH=$PATH:/ejre1.6.0_10/bin/ In this example the X11 will be used as graphical server. Add the display environment variable: export DISPLAY=:0 Running a simple program Compiling and testing on Host PC Let's first compile and test a simple program on Host Machine (PC). Create a file called Example1.java and add the following code: import java.awt.*;   public class Example1 extends java.applet.Applet {    public void init()    {         add(new Button("One"));         add(new Button("Two"));    }     public Dimension preferredSize()    {         return new Dimension(480, 640);    }        public static void main(String [] args)    {         Frame f = new Frame("Example 1");          Example1 ex = new Example1();          ex.init();          f.add("Center", ex);                  f.pack();         f.show();    } } On terminal, compile the source code using ecj: $ ecj Example1.java ecj Java Compiler is needed to compile this example. To install ecj on Debian based OS, install the packages: sudo apt-get install ecj ecj-gcj libecj-java libecj-java-gcj Now it's possible to test the compiled program. Just type on host: $ java Example1 The following window will be shown: Running on i.MX Copy the file Example1.class to <LTIB Directory>/rootfs/home cp Example1.class rootfs/home On i.MX Linux, start Xfbdev in background: $ Xfbdev & Run Example1: $ java Example1 The following screen will be shown on LCD:
記事全体を表示
Hi, The document "How to create ubuntu hardfloat rootfs for imx6d/q" was shared by Junping Mao. https://community.freescale.com/docs/DOC-95185 However, some modification need to be made to build imx-tests on this rootfs. Attached please find the guide for building imx-tests on hf-ubuntu rootfs for imx6d/q. Any problems, pls feel free to let me know. Regards, Alvin zheng
記事全体を表示