Monday, July 13, 2009

ImportError: dynamic module does not define init function

Don't do the same mistake I did...

If you have compiled your own .dll or .so file and when you are trying to import a python file then make sure your dll filed does not have the same name as one of the python files.

For e.g. if your directory contains the following files:
mymodule.dll
mymodule.so
mymodule.py

and you do

>> python
>> import mymodule

You will get the above error and that is because it is trying to import not from mymodule.py but from mymodule.so/dll.

Friday, July 18, 2008

Football according to me..

A great american tradition of drinking beer in the afternoon while pretending to be watching bunch of guys from some dark planet playing a pre-civilization sport where they are allowed to pull, push and kick their opponent.

Monday, June 2, 2008

openocd config for LPC2294 that worked for me...

#daemon configuration
telnet_port 4444
gdb_port 3333

#interface
interface ft2232
ft2232_device_desc "Amontec JTAGkey A"
ft2232_layout jtagkey
ft2232_vid_pid 0x0403 0xcff8
jtag_speed 3
jtag_nsrst_delay 200

#use combined on interfaces or targets that can't set TRST/SRST separately
reset_config srst_only srst_pulls_trst

#jtag scan chain
#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
jtag_device 4 0x1 0xf 0xe


#target configuration
daemon_startup reset

#target arm7tdmi
target arm7tdmi little run_and_init 0 arm7tdmi-s_r4

# run_and_halt_time
run_and_halt_time 0 1000

# commands below are specific to arm7tdmi Flash Programming
# −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

#target_script specifies the flash programming script file
target_script 0 reset openocd_lpc2294_flash.sh

#working_area <'backup'|'nobackup'>
working_area 0 0x40000000 0x2000 nobackup

#flash configuration
#flash bank lpc2000 0x0 0x40000 0 0 0 lpc2000_v1 0 14765 calc_checksum
flash bank lpc2000 0x0 0x40000 0 0 0 lpc2000_v1 10000 calc_checksum

Flash write script (openocd_lpc2294_flash.sh):

arm7_9 dcc_downloads enable
wait_halt
sleep 10
poll
flash probe 0

# erase first bank only:
flash erase_sector 0 0 0
#load_binary main.bin 0x0
flash write_image main.bin 0x0
poll
sleep 10
reset run
sleep 10
shutdown
resume

Using the flash write_image did the trick for me. I read it in some post that when you use flash write_image then the calc_checksum in the

flash bank lpc2000 0x0 0x40000 0 0 0 lpc2000_v1 0 10000 calc_checksum

works.
If not programmed with calc_checksum enable, a valid crc wouldn't be put in the exception vector table and the program would not get pass the bootloader.

Thursday, May 29, 2008

Capitalism does not have a heart and socialism does not have a mind.

I think so. That's why we need something in the middle.

Wednesday, May 28, 2008

openocd in Ubuntu

Error: ft2232.c:1413 ft2232_init_ftd2xx(): unable to open ftdi device: 2

What worked for when I was getting this error was to kick off openocd with sudo.e.g. instead of 'openocd -f jtagkey-arm7.cfg' try 'sudo openocd -f jtagkey-arm7.cfg'

-daa