I have always wanted to be a pioneer to introduce an open source ARM based dual core processor into machinery control. Most of the machine control platform right now are either based on third party generic design motion controller (i.e. Baldor) or in-house microcontroller and DSP based for very specific control application.
Basically, we need a host enviroment, a target-simulation enviroment and a real target device to do the work. In simplest term, it roughly go like this: develop and then port your programs from host to the target-simulator, and then download the image to the target device.
- Host, in this case I use Ubuntu
- Target-simulator (or a cross-compiling platform). Install Scratchbox on Ubuntu Hardy
- Target device, the latest dual core automotive control SoC device DIOPSIS from Atmel
wget http://repository.maemo.org/stable/3.1/maemo-scratchbox-install_3.1.sh
chmod +x maemo-scratchbox-install_3.1.sh
sudo ./maemo-scratchbox-install_3.1.sh -d
/scratchbox/sbin/sbox_adduser USER yes
/scratchbox/login
[1] For the inconsistency detected by ld.so: rtld.c: 1192: dl_main: Assertion ‘(void *) ph->p_vaddr == _rtld_local._dl_sysinfo_dso’ failed! problem, it’s necessary to disable “vdso”:
echo 0 | sudo tee /proc/sys/vm/vdso_enabled
[2] For problems when building packages (mmap: permission denied when building), it’s necessary to reduce the mmap minimum address:
echo 4096 | sudo tee /proc/sys/vm/mmap_min_addr
[3] To make these changes permanent across reboots, one can add these settings to /etc/sysctl.conf:
vm.vdso_enabled = 0
vm.mmap_min_addr = 4096
Then run
sudo sysctl -p
Unfortunately, I am running scratchbox in Ubuntu Hardy, which in turn is within a virtual box on Windows XP SP2... Anyway, the fact is you will not be able to access network within scratchbox after the installation. Somehow this is not a problem if you install on Debian distributions (this shows how much scratchbox people love Debian!)
What you need to do is to modify the following two conf files:
- /scratchbox/etc/nsswitch.conf (change nameserver to the correct IP address in your subnetwork)
- /scratchbox/etc/resolv.conf (change the line "hosts: xxxx" to "hosts: files dns")
One caveat is that you will not be able to change these two files IN scratchbox, even you do chmod 666 magic. You have to logoff scratchbox and change these two files outside. (Display hidden port and programs which are using them, netstat -nap)
Now you can use apt or wget to install packages onto your target simulation linux device. Here is a quite template list for /etc/apt/sources.list. Mine are
deb http://ftp.us.debian.org/debian/ stable main contrib non-free
deb-src http://ftp.us.debian.org/debian/ stable main
deb http://security.debian.org/ stable/updates main contrib non-free
After the enviroment is ready, one of my first step was to get my favorite messaging middleware onto ARM + Linux combination - zero messaging queue. Malo has reported that he has successfully done the porting. Somehow I found there are many more quite involved problems. I will find some other time to list them all.
Be aware that if you are trying to build latest version of autotools or GNU M4 for marco scipting you will find them in " /usr/local/bin", rather than the "/scratchbox/tools/bin". So make sure in your sh script file you are referring to the correct location to use the right version.
Some useful links:
No comments:
Post a Comment