Tuesday, December 9, 2014

Adafruit kernel module for PWM for RaspberryPi

I was trying to use the Adafruit kernel source to build my customized kernel. But for some reasons, the USB hub was not working after installing the kernel. So I spent sometime to extract the kernel modules from Adafruit from their source tree.

Here is the patch that I generate for official RaspberryPi kernel source tree.


Wednesday, November 12, 2014

Thursday, October 23, 2014

Beautify Linux Screen session


Screen is a useful too to maintain remote SSH sessions while working with embedded devices. If you want to have nice and informative screen sessions, you can add the following to the ~/.screenrc file.

autodetach on
startup_message off
hardstatus alwayslastline
shelltitle 'bash'

hardstatus string '%{gk}[%{wk}%?%-Lw%?%{=b kR}(%{W}%n*%f %t%?(%u)%?%{=b kR})%{= w}%?%+Lw%?%? %{g}][%{d}%l%{g}][ %{= w}%Y/%m/%d %0C:%s%a%{g} ]%{W}'

Tuesday, October 21, 2014

Updating MacPort to Yosemite

I was trying to install a package from MacPort and realized my port installation is broken. To install a new version, I have to recompile it from source.

I follow the SVN path.
https://guide.macports.org/#installing.macports.subversion

The compile is fine, no problem at all. Assume you have everything installed for compilation.

At the end, you might want to upgrade all outdated packages. then You will have a problem like this.

$ sudo port upgrade outdated
--->  Computing dependencies for cmake
--->  Configuring cmake
Error: Failed to configure cmake: configure failure: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/main.log for details.
Error: Follow http://guide.macports.org/#project.tickets to report a bug.

CSs-MacBook-Pro:base ph$ more /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/main.log

To solve the problem, you will need to update your xCode SDK. Just go to apple developer site and update it. After that, you are rock.

You will have another problem with gcc46.


$ sudo port upgrade outdated
Password:
--->  Computing dependencies for gcc46
--->  Building gcc46
Error: Failed to build gcc46: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc46/gcc46/main.log for details.

Error: Follow http://guide.macports.org/#project.tickets to report a bug.

I went pass this problem with installing gcc49 and remove gcc46.

sudo port install gcc49
sudo port uninstall gcc46

RISC-v emulator

Changes are based on https://risc-v-getting-started-guide.readthedocs.io/en/latest/linux-qemu.html For Ubuntu/Debian, in addition to sud...