Показаны сообщения с ярлыком makefile. Показать все сообщения
Показаны сообщения с ярлыком makefile. Показать все сообщения

понедельник, 2 декабря 2013 г.

Talking to Arduino from Netgear Stora via USB

Weeks of investigations and code compiling and finally I found that the answer is quite simple and elegant.

  • Download original(or whatever is installed in your Stora) Kernel source. Original one can be found here http://www.openstora.com/wiki/index.php?title=Source_Code
  • Extract kernel sources from stora sources.
  • (Optional - depends on compiler that you have) I had gcc from optware ipkg installation, so I had to change the Makefile - otherwise 'make menuconfig' will tell you that mixed explicit and implicit rules.
    • Locate all places where you see something like this "$somthing: something:"
    • Split each variable before colon into the separate line and duplicate code from one into the empty one.
    • Run 'make menuconfig' if there is still "mixed implicit...bla-bla-bla" error - check the line number and do the separation trick above again
  • Run 'make menuconfig'. Do no uncheck anything(you need the kernel in it original configuration) - you need to enable experimental drivers/code (because ftdi_sio is expiremental in Stora code) and then go to drivers > USB > USB serial, enable generic and core usbserial drivers as well as FTDI driver (ftdi_sio), close and save the config
  • Run 'make modules ARCH=arm'
  • Copy usbserial.ko and ftdi_sio.ko where you store other drivers.
  • I think I also added both drivers into modules.conf or whatever is the procedure for device drivers, 'depmod -a', you know... :) this kind of stuff
  • Also I did the trick with udev rules (http://playground.arduino.cc/Linux/All), but I'm not sure it was necessary.
  • Plugin the arduino board - do modprobe usbserial, ftdi_sio if necessary (if they are not loaded already) and here you go... you can talk to arduino(it was /ttyUSB0 in my case)
P.S. After everything worked I was using screen command to test everything - it works very well with my ardu. But you can find other examples(http://playground.arduino.cc/Interfacing/LinuxTTY)

суббота, 23 ноября 2013 г.

error expected '=', ',', ';', 'asm' or '__attribute__' before

Compiling avrdude on ARM Netgear Stora to be able to work with and program Arduino board.

Solved a lot of other quite complicated dependency issues, had to compile some of dependencies myself and then stuck with this error in the subject for almost half a day.

error expected '=', ',', ';', 'asm' or '__attribute__' before

WTF!
I had 'OD' symbos in the beginning of the .c file which had includes to the .h files which failed with the error. OMG, how the hell on earth did it get there?

Anyway, for those who find my post - check the source file which has includes to the header files which are failing, then check preceeding code - something is already wrong when compiler goes into the header files.