Month: January 2012

Scanner para metais pesados e ligas metálicas

Este é um scanner usado para detectar, por exemplo, a quantidade de chumbo existente em peças plasticas:

http://www.olympus-ims.com/en/innovx-xrf-xrd/

O governo dos EUA regulamentou em 2009 o limite de 600 ppm como sendo a quantidade maxima de chumbo aceitavel em brinquedos para crianças com menos de 12 anos de idade.

Converting a STM32VLDISCOVER on versalon programmer

A guy called “Bingo” converted the ST-Link v1 (STM32VLDISCOVER) into a Versalon programmer which can be used by OpenOCD application to program many other micro-controller over SWD interface.

If you have 2 STM32VLDISCOVER boards you are a luck guy and could just follow this tutorial:
http://takenapart.com/?p=82

If you (like me) is a humble guy and have only 1 STM32VLDISCOVER then you need to use your creativity to convert ST-Link in a Versalon board.

It is common for people who work with embedded system to have some J-Link programmers around (J-Link is like a gift included in many evaluation boards). Then I decide to use it to program Versalon firmware into STM32VLDISCOVER.

This is like I connect J-link pins to STM32VLDISCOVER:

J-LINK                    STM32DISCOVER
V-ref (pin 1)             3.3V
SWDIO (pin 7)             SB10
SWCLK (pin 9)             SB6
5V-supply (pin 19)        5V
GND (pin 20)              GND

Then I used “J-Flash ARM” to Unsecure and Erase Chip and used “J-Link Commander” to program Versalon firmware (firmwares-svn-986.tar.gz):

SEGGER J-Link Commander V4.40b ('?' for help)
Compiled Dec 22 2011 10:55:05
DLL version V4.40b, compiled Dec 22 2011 10:54:45
Firmware: J-Link ARM V8 compiled Sep 22 2011 16:23:23
Hardware: V8.00
S/N: 20100214
Feature(s): RDI,FlashDL,FlashBP,JFlash,GDBFull
VTarget = 3.080V
Info: TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
No devices found on JTAG chain. Trying to find device on SWD.
Info: Found SWD-DP with ID 0x1BA01477
Info: TPIU fitted.
Info:   FPUnit: 6 code (BP) slots and 2 literal slots
Info: Found Cortex-M3 r1p1, Little endian.
Cortex-M3 identified.
JTAG speed: 100 kHz
J-Link>exec device = STM32F103C8
Info: Device "STM32F103C8" selected (64 KB flash, 20 KB RAM).
J-Link>loadbin c:\versa.bin, 0x0
Loading binary file... [c:\versa.bin]
Writing bin data into target memory @ 0x00000000.

WARNING: CPU is running at low speed (8031 kHz).
Info: J-Link: Flash download: Flash programming performed for 1 range (28672 byt
es)
Info: J-Link: Flash download: Total time needed: 13.330s (Prepare: 2.459s, Compa
re: 0.191s, Program: 8.869s, Verify: 0.159s, Restore: 1.650s)
J-Link>

Update: There a way to use the serial programmer native of STM32 chip to update its firmware, this way you don’t need other board or external programmer, but needs a USB/Serial 3.3V: http://miosix.org/boards/stm32vldiscovery-linux-support.html

Impressora Laser Samsung ML-1865W

Se você está procurando uma impressora Laser para comprar eu recomendo a Samsung ML-1865W. Ela é uma impressora relativamente barata (R$ 250,00) e muito compacta (é uma das menores impressoras Laser do mercado). Outra vantagem desta impressora é que você conseguirá imprimir nela a partir de um smartphone ou tablet com Android, pois a Samsung disponibilizar no Android Market uma aplicativo chamado MobilePrint que permite qualquer aparelho Android imprimir nela. Eu testei e realmente funciona.

Se você comprou esta impressora e esta com preguiça de ler o manual, então aqui vai o default password do servidor web interno dela (SyncThru Web Service):

User: admin
Passord: sec00000

Erro instalando o ADT do Android no Eclipse no Linux

Fui instalar o plugin do Android no Eclipse e obtive este erro:

Cannot complete the install because one or more required items could not be found.   Software being installed: Android Development Tools 16.0.1.v201112150204-238534 (com.android.ide.eclipse.adt.feature.group 16.0.1.v201112150204-238534)   Missing requirement: Android Development Tools 16.0.1.v201112150204-238534 (com.android.ide.eclipse.adt.feature.group 16.0.1.v201112150204-238534) requires 'org.eclipse.wst.sse.core 0.0.0' but it could not be found

Felizmente a solução foi simples de encontrar:

www.youtube.com/watch?v=HCNC34BflOo

Basta adicionar o repositório para fazer update do seu Eclipse:
http://download.eclipse.org/releases/indigo

E marcar a instalação do “Linux Tools”. Muito simples!!!

Testando a placa STM32VLDISCOVERY no Linux

Hoje recebi a placa de desenvolvimento STM32Discovery e comecei a pesquisar pelo suporte a ela no Linux.

Rapidamente encontrei um programa chamado stlink-download criado pelo projeto ARMUtilities.

$ sudo stlink-download /dev/stlink reset
$ sudo stlink-download /dev/stlink flash:w:helloworld.bin
$ sudo stlink-download /dev/stlink run
$ sudo stlink-download /dev/stlink status

Getting android_x86 source code

I was trying to clone android x86 and got this error:

$ repo init -u http://git.android-x86.org/manifest -b froyo-x86
$ repo sync
git.android-x86.org[0: 210.240.39.201]: errno=Connection refused
fatal: unable to connect a socket (Connection refused)

I solved it just replacing “git://” by “http://” in the file:

$ vi .repo/manifest.xml

This guy got same issue: http://groups.google.com/group/android-x86/browse_thread/thread/b85e8ca3e445c608

Also replace the “korg” from git://android.git.kernel.org by git://codeaurora.org

Acendendo os LEDs azul de Power e de WAN do roteador D-Link DIR-825

Agora que ja’ fiz o Wireless funcionar corretamente no OpenWrt (ver post anterior), foi a vez de investigar por que os LEDs de Power e WAN (Planet) nao acendiam. A solucao foi simples:

Basta acrescenter em /etc/config/system:

config led
    option sysfs        'dir825b1:orange:power'
    option default        0

config led
    option sysfs        'dir825b1:blue:power'
    option default        1

config led
    option sysfs        'dir825b1:blue:planet'
    option trigger       netdev
    option dev           eth1
    option mode          link

Apos reiniciar o roteador os LEDs ficaram azul, como esperado.

Fonte: https://forum.openwrt.org/viewtopic.php?id=24928

Entendendo como o OpenWRT organiza as coisas

Continuando a saga com o roteador D-Link DIR-825…

Estou começando a entender um pouco mais sobre o OpenWRT (puxa vida, por que demorei tanto a usa-lo?) e então descobri que preciso definir “option disabled 0” no arquivo /etc/config/wireless, do contrário a interface wireless não vai iniciar automaticamente.

root@OpenWrt:/# cat /etc/config/wireless 
config wifi-device  radio0
        option type     mac80211
        option channel  11
        option macaddr  00:18:e7:XX:XX:XX
        option hwmode   11g
        option htmode   HT20
        list ht_capab   SHORT-GI-40
        list ht_capab   TX-STBC
        list ht_capab   RX-STBC1
        list ht_capab   DSSS_CCK-40
        # REMOVE THIS LINE TO ENABLE WIFI:
        option disabled 0

config wifi-iface
        option device   radio0
        option network  lan
        option mode     ap
        option ssid     OpenWrt
        option encryption none

config wifi-device  radio1
        option type     mac80211
        option channel  36
        option macaddr  00:18:e7:XX:XX:XX
        option hwmode   11na
        option htmode   HT20
        list ht_capab   SHORT-GI-40
        list ht_capab   TX-STBC
        list ht_capab   RX-STBC1
        list ht_capab   DSSS_CCK-40
        # REMOVE THIS LINE TO ENABLE WIFI:
        option disabled 0

config wifi-iface
        option device   radio1
        option network  lan
        option mode     ap
        option ssid     OpenWrt2
        option encryption none

Agora já consigo conectar na rede wifi dele e acessar através do “telnet 192.168.1.1”, portanto não preciso mais ficar usando o conversor USB/Serial o tempo todo. Mas minha interface ethernet WAN ainda continua instável.

Outra coisa interessante que descobri sobre o OpenWRT é que toda vez que reinicio ele eu preciso executar um “opkg update”, pois ele só salva a lista de pacotes na memória RAM, pois memória Flash é coisa preciosa.

A listagem dos pacotes é armagenada em /var/opkg-lists/snapshots