Search This Blog

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