Month: August 2010

Error compiling Linux kernel to iMX51 with NAND Support


drivers/mtd/nand/mxc_nd2.c: In function 'mxcnd_probe':
drivers/mtd/nand/mxc_nd2.c:1233: error: 'NFC_BASE_ADDR_AXI' undeclared (first use in this function)
drivers/mtd/nand/mxc_nd2.c:1233: error: (Each undeclared identifier is reported only once
drivers/mtd/nand/mxc_nd2.c:1233: error: for each function it appears in.)

Edit drivers/mtd/nand/mxc_nd2.h and rename NFC_BASE_ADDR_AXI to MX51_NFC_BASE_ADDR_AXI

Testing Force Feedback Wheels on Linux

Definitely we don’t have good Linux race games with force feedback support. I don’t know who is the guilt: users, game companies, Linux distros companies, developers?

Until now only VDrift has force feedback support, but its graphics are very bad, even TORCS has better graphics. There is also Racer ( with force feedback support and nearly professional graphics, but you cannot find a recent binary version to Linux, only Windows, they even suggest user to test it using Wine (oh my gosh).

So, lets compiling VDrift for Linux, after downloading from repository you need to use “scons” to compile it. After some compilation errors I updated glew to version 1.5.5 and everything worked.

To compile VDrift with FF support execute:

scons force_feedback=1

Then edit ~/.vdrift/VDrift.conf and add your steer wheel details (Logitech Momo in my case):

[ joystick ]
calibrated = false
ff_device = /dev/input/by-id/usb-Logitech_Logitech_MOMO_Racing-event-joystick
ff_gain = 3.608330
ff_invert = false
hgateshifter = false
two_hundred = false
type = wheel

It is not perfect, but it is all we have right now 😦

Resolvido problema do Skype e o modem ADSL SpeedStream 4200

Enquanto o modem DLink 2026B que comprei pela internet não chega, estou me virando com o SpeedStream que meu amigo Hamilton me emprestou. Este modem estava funcionando muito bem, até o momento que resolvi instalar o Skype. Por algum motivo o LED de atividade começa a piscar sem parar até o momento que ele reinicia (todos os LEDs acendem).

Segui várias dicas que encontrei na internet, mas a unica que funcionou foi esta:



Esta dica foi dada pelo usuário carlosmarckk no forum da skype:

Kudos para o carlosmarckk, muito obrigado!

Getting started to NuttX

I discovered NuttX RTOS few weeks ago (thanks Marcelo Barros) and I like it very much, then I decided to test it on Olimex LPC2378-STK.

NuttX is a very small foot-print RTOS (starting about 20KB) which follows the POSIX and ANSI API, this means you can port your Linux application to run on this RTOS easily. I know FreeRTOS is even smaller and have a bigger community, but NuttX has advantage for follow the *nix APIs and recreate the Linux devices structure.

The only concern about it is the license, it is BSD. I never contributed for a BSD project (For As Long As I Can Recall). Then I need to get used with this idea.

Let start downloading the NuttX source code:

The current stable version is 5.17, but I prefer always using the repository version, so lets download it:

$ svn co nuttx

Now is time to download the cross-compiler (toolchain). I’m using the CodeSourcery toolchain:
Download and install it:

$ chmod a+x arm-2010.09-51-arm-none-eabi.bin
$ ./arm-2010.09-51-arm-none-eabi.bin

I installed it on /opt/cs/sourcelite but feel free to install it any place, just remember to place the corresponding binary directory (i.e.: /opt/cs/sourcelite/bin) in our PATH.
I selected the Minimum installation since I don’t want to use its IDE.

Now we need to modify some files to get NuttX compiled with CS toolchain:

Edit file nuttx/configs/olimex-lpc2378/nsh/defconfig and change the toolchain to CodeSourcery on Linux (Note: currently it is already defined):


Make sure to include the toolchain in the PATH:

$ export PATH=/opt/cs/sourcelite/bin:$PATH

Now configure NuttX to compile the NSH shell using LPC2378 configuration:

$ cd tools
$ ./ olimex-lpc2378/nsh
$ make

It will create two files: nuttx and nuttx.bin. The first is the ELF binary and the second is the firmware binary.

We can see more information about the ELF file using the size command:

$ size nuttx
BFD: nuttx: warning: sh_link not set for section `.ARM.exidx'
   text	   data	    bss	    dec	    hex	filename
  78228	    368	   2332	  80928	  13c20	nuttx

Now we need to flash the firmware (nuttx.bin) inside Olimex-LPC2378-STK. We can use OpenOCD to flash the firmware. I used Amontec JTAGKey for flash programming.

Run OpenOCD, it will open a telnet daemon on port 4444.
Note: nuttx.bin needs to be in the same directory where you ran openocd.

# openocd -f jtagkey.cfg -f lpc2378.cfg

Connect to OpenOCD’s telnet:

$ telnet 4444

Execute these commands to erase the flash and write the firmware on it:

> reset run
> reset halt
> flash erase_sector 0 0 26
> flash write_bank 0 nuttx.bin 0

Connect a serial cable on LPC2378-STK port1 (RS232_0) to your computer and configure minicom to 9600 8n1. You should see the NuttShell (NSH) prompt “nsh>”.