Sunday, February 21, 2010

libusb 1.0 Windows backend reaches pre-release mode

http://old.nabble.com/Announcing-code-freeze---pre-release-mode-for-the-Windows-backend-td27657981.html

Pete Batard announced the news and Pete Stuge has come out a good integration plan. Hopefully the Windows backend will sooon be integrated into the main tree.

At the same time, I think if you are interested in the Windows backend, you can already try it. It mostly works for me. The only issue I have right now is the HID backend where feature reports do not seem to work.

FreeBSD 8.0 First Impression

Now I used FreeBSD 8.0-Release (updated to 8.0-RELEASE-p2) and it seems to be much better than last time, especially in the USB front. I also like the freebsd-update capability. It seems to be faster than last time.

What I like compare to Linux: maybe the BSD license itself. But now I feel GPL/LGPL are not bad either.

What is not working: my SATA DVD-RW is not recognized at all. This is an Acer M1641 desktop with NVidia 620i/Geforce 7050 based chipset and FreeBSD seems to have big problems with NForce 620i and 630i.

What I do not like: the port system. I have since removed most of the packages initially installed (LXDE, KDE3, KDE 4, QT33, QT4, etc) due to the mass upgrade of libjpeg. It caused big problems to many packages. So now I have a bare-minimum Gnome 2.26 based desktop (dare not update to 2.28). Mass upgrade takes a long time and often the ports are broken. ARCH seems to do a much better job since binary updates are provided. I still like Ubuntu's package system (deb/apt, Synaptic) the best.

My libusb testing on FreeBSD: pk2cmd seems to behave like last time, but now I do not need to recompile the kernel. libusb based programs work better but there are still problems.
http://old.nabble.com/LibUSB-on-FreeBSD--current-%288.x%29-td21642051.html

My OpenOCD test on FreeBSD: FT2232D seems to work, J-Link V3 does not work. J-Link V7 seems to work. All of them works under Linux.
https://lists.berlios.de/pipermail/openocd-development/2010-February/014864.html

My main interests with FreeBSD will be more libusb/MCU related -- to get OpenOCD (J-Link and FTDI, for ARM MCU development) and PICkit 2 (and other PIC related things, for PIC development) to work well under FreeBSD. Now it seems that FreeBSD is an possible platform for MCU development.

Monday, February 15, 2010

FreeBSD 8.0 Installed

After about 1.5 years gap with FreeBSDs, yesterday I finally got FreeBSD 8.0 Release version installed. My main interests are to get some libusb based programs to work under FreeBSD, including the USB demos from Microchip, pk2cmd for PICkit 2.

The installation itself is not flawless. Initially I tried with ACPI disabled (last time it helped) but this resulted in General Protection Fault on this Acer M1641 PC (Nvidia 620i/Geforce 7050 integrated chipset). With ACPI enabled, the install CD can boot up. But the installed could not find the SATA DVD-RW. Luckily the network card was recognized. So I used network install and it was not too bad, faster than I expected. I then spent some time to get Nvidia driver port to work. I have to disable the Linux emulation support in nvidia-driver since I could not download the large Linux emulation base packages (linux_base-f10) due to dead mirrors.

There are some other minor things to fix up, like I need to mount procfs to /proc (edit /etc/fstab) to get the gdm login screen to be able to properly shutdown/reboot the PC.

I tried a few simple programs based on libusb 0.1 and they seem to work fine under FreeBSD 8.0 release. Last time I had to patch the kernel and use the then alternative USB stack from Hans Petter Selasky (FreeBSD USB developer).

Then I tried to build pk2cmd and it seemed to work. The "-s" option does not see to work just as the release note of pk2cmd 1.20 says. I have not tried updating the firmware which was not working last time I tried it.

libusb 1.0 API has not fully been synced by the FreeBSD /usr/include/libusb.h. Luckily Hans says that he will make the libusb 1.0 compatible layer available to FreeBSD.

USB permision setup is now much easier than last time. By default, it seems USB device will have a ugen driver associated. The /dev/ugen* device belong to the operator group. So it is quite easy to add the user to the operator group and then the user can run libusb based program without root privilege.

I had problems to build OpenOCD git code, luckily Tomek Cedro provided a port so that I could build OpenOCD 0.4.0-rc2. I had to update the port system to build libftdi 0.17. This seems to be a prerequisite for OpenOCD.

Overall this time I have more positive views about FreeBSD. It is not as smooth as Ubuntu, but at least it is quite usable.

$ uname -a
FreeBSD MyFreeBSD.WORKGROUP 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Tue Jan 5 16:02:27 UTC 2010 root@i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386

[mcuee@MyFreeBSD /usr/home/mcuee/Desktop/build/pk2cmd/pk2cmdv1.20LinuxMacSource]$ ./pk2cmd -?V

Executable Version: 1.20.00
Device File Version: 1.55.00
OS Firmware Version: 2.32.00

Operation Succeeded

Friday, February 12, 2010

Happy Chinese New Year!

Happy Chinese New Year! Wish you a very prosperous year of Tiger!