[gcds.lt Blog]

Student from Lithuania

Growing up from 8/16-Bits to 32-Bits (ARM Cortex-M3/M0)

leave a comment

Introduction

Then I started embedded development I was using only Atmel AVR family devices like ATTiny2313, ATmega8, ATmega128, ATmega2560 and so on. But as economics grows and also ideas I cannot fit inside small 8-bit processor (AVR for 16bit multiply uses 15 ASM operations then ARM 32bit uses only one instruction). So I got now LPCXpresso with Cortex-M0 (LPC11c24) and Cortex-M3 (LPC1769).  Personally I hate IDE like Code Red supplies for arm development I prefer more universal tools.

Toolchain

To develop something for ARM processors you need to compile it so here comes ARM Toolchain based on gcc, binutils, newlib. I am user of Mac OS X and Complete one click installation tools don’t exists so I have to build this toolchain for myself. I know it’s hard but I will do step by step showing how to do it.

Whole step-by-step instruction in more section.

Read the rest of this entry »

Written by gcds

January 13th, 2012 at 4:07 pm

AVR devices Makefile

leave a comment

Several days ago I started creating several projects and I needed more universal Makefile for my AVR projects. Week ago I was developing some project with ARM Cortex M3 so I learned to write Makefile. Before I was not used to write my own Makefiles because I didn’t know how so after several hours studying Makefile reference I write my Makefile with support for avrdude programmer and arduino based bootloader.

The Makefile template is located in my github: https://github.com/gcds/AVR-devices-Makefile

To use it fast you can just clone it and start developing fast:

1
$ git clone git://github.com/gcds/AVR-devices-Makefile.git

To install it as CrossPack-AVR avr-project template execute this commands:

1
2
3
4
$ cd /usr/local/CrossPack-AVR/etc/templates/
$ mv TemplateProject TemplateProject.old
git clone git://github.com/gcds/AVR-devices-Makefile.git
$ mv AVR-devices-Makefile  TemplateProject

If you have any suggestions just write a comment :P

Written by gcds

January 12th, 2012 at 1:54 pm

Posted in AVR,Programming

iSpeakers V2.0 User Interface

leave a comment

User interface is most important thing for every device that interacts with user. For my iSpeaker v2.0 I have chosen big 128×64 RGB graphic lcd from Electronic Assemblies and 4 vandal switches (They always caught my eyes). UI has own separate module board which connects to main board over UART. It has it owns micro processor ATMega128. I know ATMega128 is way to big for this simple operation but this MCU does a big job it interacts with lcd creates all animation, menu, graphics and other stuff.

Here is some kind of schematic of this UI module:

It consist of several darlington switches (they always help then you need a little more current than you mcu can supply), 4050 not inverting buffer, ATmega128 with 16Mhz crystal and jtag connector (I really love to see how everything works :D ), 4 connectors for switches with illumination (PWM).

Here is kind finished product just the main thing is being built up so I put everything i carton box :D

   

Ok it’s enough for hardware side lets write something about this beast brains :P

Here is some feature list:

  • Purely C language only
  • Has independent status bar
  • Unlimited (Theoretically) depth of menu and sub menus
  • Every menu element has own view with labels, inputs, radio, checkbox, buttons
  • Build all UI menus elements on computer flash via usb-uart and module only sent then something happens to main board
  • Ability to extend RAM memory with external ram
  • Really lightweight (Written entirely on C not C++)

So this is my User interface Which I think I will use for a lot of projects because it’s simple to implement and use :P

Written by gcds

January 5th, 2012 at 3:47 pm

WordPress Automatic Updates over Secure Shell (SSH)

leave a comment

WordPress has one good feature which is called Automatic Updates. It can download and install updates via FTP or FTPS (SSL) without getting hands dirty. In my server neither FTP or FTPS is running so this feature for me is useless. Of course if you are lazy you can just simply install FTP on your server and that’s it. But I am not so lazy to open most insecure file transfer protocol on my server to suggest hackers to come inside.

After several hours of research I found out that WordPress supports SSH2 out of box but it isn’t implemented in user interface so several hard coded settings in wp-config.php file and you can use this feature like a boss over SSH.

  1. Open wp-config.php and add this lines
    1
    2
    3
    4
    5
    6
    7
    8
    9
    define('FS_METHOD', 'direct'); // you could also use ssh but it wasn't working on my server don't know why :/
    define('FTP_BASE', '/www/blog.gcds.lt/'); // Wordpress root path
    define('FTP_CONTENT_DIR', '/www/blog.gcds.lt/wp-content/'); // Wordpress wp-content path
    define('FTP_PLUGIN_DIR ', '/www/blog.gcds.lt/wp-content/plugins/'); // Wordpress plugins path
    define('FTP_PUBKEY', '/root/.ssh/id_rsa.pub'); // Location of ssh public key
    define('FTP_PRIKEY', '/root/.ssh/id_rsa'); // Location of ssh private key
    define('FTP_USER', 'root'); // SSH username ****@localhost
    define('FTP_HOST', 'localhost:22'); // you can leave this as localhost because you connecting to your server
    define('FTP_PASSWORD', 'password'); // SSH password
  2. You should also create authorized key by copying public key to authorized keys and set proper permissions.
    1
    2
    3
    4
    5
    cd ~/.ssh
    cp id_rsa.pub authorized_keys
    cd ~/
    chmod 755 .ssh
    chmod 644 .ssh/*

Around 90% of installers should also change permissions of wordpress root folder because php is running on different user and folder is created most of the time with root user.

  1. Connect to ssh and run ps auxw | grep -E 'http|apache|www'
  2. You should get something like this:
    1
    2
    3
    root 436 0.0 2.0 36124 5260 ? Ss 2011 0:08 /usr/sbin/apache2 -k start
    www-data 17183 0.6 11.8 60588 30964 ? S 13:53 0:18 /usr/sbin/apache2 -k start
    www-data 17326 0.1 11.4 59584 29888 ? S 14:01 0:05 /usr/sbin/apache2 -k start
  3. As you can see first column gives username of which apache runs php ‘www-data’
  4. Execute this two command in ssh to change permission of you wordpress root folder
    1
    2
    chgrp -R www-data /www/blog.gcds.lt/
    chmod -R g+w /www/blog.gcds.lt/

That’s it :) Now you can go to admin page and install plugins, themes, updates without getting your hands dirty :P If something does not work write in comments and I will try to help you.

Written by gcds

January 4th, 2012 at 1:53 pm

Posted in Programming

Small Launch Miracle

leave a comment

Today for launch I wanted something different than simple launch so I made dough baked salmon with steamed vegetables which was awesome :P

Written by gcds

November 1st, 2011 at 11:25 pm

Posted in Cooking & Food

Small hack for better UI in Autogidas.lt website

leave a comment

Week ago I was living in website called Autogidas.lt and every time you see something interesting you need to open that post and take a look in bigger images because in listings images are small and you cant seen anything. So I made small hack which changes image url to bigger and changes it size.

Here is bookmarklet: Bigger Images

Also I have made Google chrome extension which will automatically change size when page loads

Google Chrome Extension

Before:

After:

Written by gcds

November 1st, 2011 at 8:18 pm

Posted in Hacks,Programming

Hello world!

one comment

Hi everybody! I am Aurimas Senior from Lithuania. In this blog I am going to publish things I have done mostly related to electronics or computer. It is really hard to keep blog updated even in this hardest period of life but I will try to not forget it :P

Kind Regards
Aurimas

Written by gcds

November 1st, 2011 at 4:08 pm

Posted in Uncategorized