Search This Blog

Dec 1, 2008

Completed 512 bytes sector nand flash driver

Finished the 512 bytes sector nand flash driver, it works ok on nand stress test. However, our SDK is too complicate to accept 512 bytes sector. I need set it in pending status although there still have many other case need to handle.

Nov 19, 2008

512 bytes sector access

I plan to add 512 bytes support in Nand flash driver. That may have a little change. Hope it can be finished this week.

Oct 28, 2008

USBMSC mode work ok

MediaInit locate in use once memory, it calls my init function and cause VMI abort. remove this call and then USBMSC mode work OK. Player mode still has problem.

Oct 17, 2008

Nand flash write speed improve

Trace the USB transfer data. I got impress about the time cost at each stage. Every 64 sectors write will take a block erase and build block map. And when access FAT1, FAT2, Root directory and MBR, it will copy block which take many time.
I list the time cost below, the time is relative.
1.Write sector takes 620 us.
2.Build block map and erase block takes 12ms
3.Copy block takes 180ms.
And then I rewrite block map evict method, just pick up the less time cost block. And then write speed improve 33%. now the read write speed is same as SDK does.
The other way to improve the speed should put our foucs on read redandunt time. Every build block map will read 64 redandunt area and takes 9ms.

Oct 10, 2008

Updater work fine

replace read/write function with mine, updater can copy files into disc. use HDbench test, r/w is 6470/1476(3716). orignal SDK r/w is 5369/4000. read speed is fast than original SDK, write speed too slow, need find out why the root cause.

Oct 9, 2008

Nand flash logical to physical management

Yesterday, use nand stress test for 30 mins, it runs OK. Next step I will try to migrate it into SDK procedure.

Sep 26, 2008

Nand flash driver

I am preparing the Nand flash driver which control logical to physical translation. Almost finish. Will test it in our SDK.

Sep 17, 2008



Aug 10, 2008



Jul 13, 2008




5。0以后引入PQOAL的概念,在PQOAL格式的BSP中,有一个SYSINTR与IRQ的概念,SYSINTR是系统使用的中断,IRQ为硬件中断,即CPU使用的中断线,一般的BSP中,将其CPU的中断标志寄存器的各位一一对应,即,IRQ0对应于该寄存器的第0位,IRQ2为第2位。所以,做为驱动程序,必须知道它所驱动的硬件所使用的IRQ,即硬件中断线。然后调用KernelIoControl的IOCTL_HAL_REQUEST_SYSINTR功能得到一个SYSINTR,然后再进入上面描述的流程。这样,驱动程序 以后就只使用申请到的SYSINTR,而不关心其IRQ了。 OAL层会将IRQ与SYSINTR做相互转换。

Jun 23, 2008

WINCE build option.

1.Sysgen to build image when you change the catalog.
2.Build and Sysgen. Build OS kernel and Sysgen, it tooks too much time
3.Build and Sysgen CurrentBSP. Build if you only change platform BSP code, the speed is fast.

When I change config.bib for memory map, with Build and Sysgen CurrentBSP, it does not generate correct image. I found config.bib in release directory is old on. I run "Copy file to release directory" and then run "Build and Sysgen CurrentBSP" and get correcty image.
If you only change one device driver, you can select the "Build project" and then run "Make runtime image", then you can fastest get image.

Jun 16, 2008

PWM setting

SDK setting is too complex, re-organize it.
void backlight_test()
unsigned int i,temp;

(*(volatile unsigned int *) HW_PINCTRL_MUXSEL4_CLR_ADDR) = (3<<4); // GPIO config as PWM2
(*(volatile unsigned int *) HW_PWM_ACTIVE2_CLR_ADDR) = 0; // clear count of inactive and active
(*(volatile unsigned int *) HW_PWM_ACTIVE2_SET_ADDR) = 0x00210000; // set active and inactive count
(*(volatile unsigned int *) HW_PWM_PERIOD2_CLR_ADDR) = 0; // clear
(*(volatile unsigned int *) HW_PWM_PERIOD2_SET_ADDR) = 0x000B002F; // set MATT,CDIV,INACTIVE,ACTIVE,PERIOD
(*(volatile unsigned int *) HW_CLKCTRL_XTAL_CLR_ADDR) = 0x20000000; // Clear the gate
(*(volatile unsigned int *) HW_PWM_CTRL_CLR_ADDR) = 0x40000000; // Clear the clock gate
(*(volatile unsigned int *) HW_PWM_CTRL_SET_ADDR) = (1<<5); // PWM2_ANA_CTRL_ENABLE
(*(volatile unsigned int *) HW_LRADC_CTRL0_CLR_ADDR)= 0xC0000000; // LRADC RST and gate clear
(*(volatile unsigned int *) HW_LRADC_CTRL2_CLR_ADDR)= 0x00200000; // LRADC1 feedback control

temp = (*(volatile unsigned int *) HW_LRADC_CTRL2_ADDR) & 0x001F0000;
(*(volatile unsigned int *) HW_LRADC_CTRL2_ADDR) = temp | ((0x1C*i/100) << 16);
(*(volatile unsigned int *) HW_PWM_CTRL_SET_ADDR) = 0x4; // Pwm2 enable
(*(volatile unsigned int *) HW_LRADC_CTRL2_SET_ADDR) = 0x00400000; // BL enable

May 27, 2008

Dirver developing in wince

We can compile the driver project and then make run time image, it is fastest way when you developing your device driver. It takes few minutes.

May 20, 2008


wanna to store touch panel cordinate data into REG, modify the FlashDSK.reg
"PROFILEDIR"="Documents and Settings"
"Start DevMgr"=dword:1


"FriendlyName"="MSFLASH Driver"

; LoadFlags 0x01 == load synchronously

"FriendlyName"="MSFLASH Driver"

"Name"="Microsoft Flash Disk"

"MountFlags"=dword:2 ; support hive-based registry


May 19, 2008

wince run on 32MB mDDR platform

1.config.bib modified the macro definition from 64MB to 32MB
#define ROM_IMAGE_START 80100000
; #define ROM_IMAGE_SIZE 01100000
; #define RAM_IMAGE_START 81300000
; #define RAM_IMAGE_SIZE 02D00000
#define ROM_IMAGE_SIZE 01100000
#define RAM_IMAGE_START 81300000
#define RAM_IMAGE_SIZE 00D00000
2. Modify
constants {
LOAD_ADDR = 0x40100000;
ENTRY_ADDR = 0x40100000;
sdram_arg = 0x02010020; // 0x02010040
3. Modify SDRAM arg from 64MB to 32MB in elf2sb convert.
elftosb -V -z -f 37xx -p "\." -c -o -D sdram_arg=0x02010020

Apr 23, 2008


Now the license fees of wince is only 1$, and the cpu is powerful now. Moreover, it is fast way to use wince to design your product.

Mar 25, 2008



Mar 10, 2008

Rmvb support

There are serveral vendor are supporting rmvb function without transfer. It is hot issue and we need speed up our development.
Have a look on overlay code, it is complex but the idea is good to deal with the overlay with MMU coperate. I still need take more time to famliar with the memory issue. I have tested serveral python script in BIN directory, however, it doesn't works.:-(

Mar 3, 2008

IIC 展览


Feb 20, 2008

Read firmware from player

Now we can read firmware under normal USB connection. It looks work well.

Feb 15, 2008

Read10, Write10, ReadCapacity command support

With my co-worker help, it can do read/write through SCSI command. The original data buffer pointer return from structure member. change it to golbal array, it can write data into u-disk now.

Feb 14, 2008

Python access mass storage class device

use SWIG function. Build C dll which access USB port with DDK support. Python implement SCSI command function. Now can send INQUIRY and READ10 command. Try to add more SCSI command support in future.

Jan 28, 2008

Python call C function with pointer parameter

昨天折腾了一下。 可以传递指针参数了。
1. 在useSwig.i 里面加上
%module useSWIG

%inline %{
extern void add(int size, int *result);

%include carrays.i
%array_functions(int, intp);

2. useSWIG.c
void add(int size, int *result)

import useSWIG
a = useSWIG.new_intp(100);
for i in range(0,100):
r = useSWIG.intp_getitem(a,i);
print r


Jan 24, 2008

SWIG call C function

Download the Swig, check the Examples\python\simple. It makes a dll project. Something need notice.
1. VC7 tools->option->projects->VC++ Directories->Excutable files "c:\swigwin"
tools->option->projects->VC++ Directories->Include files "c:\python25\include"
tools->option->projects->VC++ Directories->Library files "c:\python25\libs"
tools->option->projects->VC++ Directories->Library files "c:\python25\lib"

2. example.i customer build step->command line
swig -python "$(InputPath)"

3. project properties C/C++->Advanced->Compile As->Compile as C++ code(/TP)

after that, write simple python file and can call windows functions.

Jan 23, 2008

Play for Sure 1.21 with WMP11

Yesterday we found P4S1.21 win WMP10 can pass the error point, and still on going now. We also check another Nand flash which pass the stress test long time ago, it fail with WMP11 installed. It looks it is relate with WMP version. Oh, what Microsoft doing? It already took our 3 weeks to investigate this problem!

Jan 17, 2008

HY27UT088G2A validation

These are working on HY27UT088G2A MTP stress test fail issue. We have tested 3 pcs Nand flash, all of them are fail on deleting 280 or 281 song file. It looks strange here. Every test will take 70 minutes, it is hard to debug the problem. I try to copy some large files into Nand flash with hidden attribute, the failure will happen within 20 minutes. However, the MTP stress test need at least 128 MB free space, I can not cut down to many space to shorten the test time.

Jan 11, 2008

Sdram L2 table remove

Modified MMU initialization part, remove SDRAM l2 table and remove sdram prep initial subproject. And comment Sdram initial part in firmware. The can run in OCRAM now.

Jan 9, 2008

Sdram less updater

I am working on Sdramless of updater now. The .text part can be less than 100kB. However, the memory usage is much more than I think. After adjustment, the memory size is fit on OCRAM now. However, SDRAM l2 table in SDRAM which can not move to OCRAM now. I would like to take a look on MMU initliazation part first.

Jan 2, 2008

Vocation on Zhuhai