Modificare le Env_Variables senza ri-flashare tutto

Ho ricevuto una domanda tramite la form per l’invio dei files:
“… Dopo modifiche software e hardware mi è venuto un dubbio che ho appena postato:
How can I update env_boot without flashing all the system?

As of is so difficult to find the correct number for our tablet we have to try many time…but is really necessary to flash completely your tablet or is possible to change only env_boot?
I don’t know…for example with an empty wmt_scriptcmd (?)


Tu hai idea se sia possibile? …”
Rispondo a Marco: le “environment variables” possono essere modificate agendo con un apposito comando del programma U-Boot ; naturalmente per poter usare il programma, bisogna collegare un terminale seriale. Raccomando la lettura di questo articolo per “entrare in argomento”. Aggiungo che il file wmt_scriptcmd può effettuare le stesse operazioni, cioè è possibile crearne uno in cui si settano solo le env_variables e non si fa niente altro. Il programma U-Boot, infatti, come prima operazione va a vedere se c’è una MMC (la microSD) inserita nello slot, poi – se c’è – verifica se all’interno è contenuto il file wmt_scriptcmd ed eventualmente esegue le varie istruzioni programmate. E’ da notare che il file wmt_scriptcmd NON è un semplice file di testo, perché contiene all’inizio uno speciale “header” con un codice CRC per verificare che sia compilato correttamente e sia in grado di lavorare sul sistema su cui lo si sta lanciando. Partendo da un file di testo, si può utilizzare il programma mkimage.exe per ottenere il file idoneo ad essere eseguito sulla microSD.

Modificare le env_variables da terminale seriale.
Una volta entrati in connessione con il programma U-Boot, per cambiare una env_variable basta dare il comando setenv ; per esempio, se vogliamo cambiare il tempo di bootdelay, basterà scrivere setenv bootdelay 3 (da notare che in tutti i comandi setenv NON deve essere scritto il segno “=”, anche se si sarebbe indotti a farlo perché il comando printenv lo mostra a fianco della variabile ; esempio: bootdelay = 3). Con questo comando diciamo al sistema che il ritardo al boot (quello che ci permette di fermare l’autostart) sarà di 3 secondi. Per salvare questa variabile in modo permanente, basterà dare il comando saveenv ; per verificare le modifiche e per avere la lista di tutte le variabili memorizzate sulla memoria SPI flash (sì, è lì che vengono memorizzate) si potrà dare il comando printenv.

Così come per la variabile bootdelay, qualsiasi altra variabile può essere modificata nello stesso modo ; resettando il tablet, il successivo boot avverrà con i nuovi valori delle variabili salvate. Attenzione: se si scrivono valori “a casaccio” oppure semplicemente errati, si corre il rischio di rendere il tablet “un mattone” (a brick) e perciò è imperativo conoscere ciò che si fa, prima di operare ! Esiste anche un modo per eliminare una delle env_variables : basta scrivere il comando setenv e il nome della variabile, senza assegnare alcun valore. La variabile sarà eliminata. Naturalmente, anche questo comando va usato con ESTREMA cura 🙂

Using Android tablet as SIRC remote control (#2)

This is my second program to use a tablet as a remote control. The first one (read here for additional infos) was based on a simple IR-Led plus resistor, placed on the “hidden” serial port present on the tablet’s dongle. Such solution was very cheap, but needed for some firmware modding and and for dongle opening, to solder wires on (sometimes) difficult points. So, I modified the software (and the hardware) to make it easier to install on every “original” Android tablet. The only mandatory request is that the tablet must have a “driver” for USB to RS232 interfaces. I tried with units based on popular PL2303 chip (from Prolific) or CP210x chips (from Silicon Labs) and both were detected (as ttyUSB5). The whole system is shown in the picture below :

Note that the “dongle” is open, but it’s only ‘cause all my devices are always “under testing” 🙂 . You don’t need to “look inside”, just plug the USB to RS232 interface in the USB socket and go. Note that the interface shown in the picture is based on PL2303 chip. Obviously, the USB to RS232 isn’t enough to send SIRC commands to your TV. You must build (or ask to a friend to build for you) this VERY SIMPLE interface :

As you can see, there is one DB9-F connector (for RS232), one resistor, one IR-Led and one diode. With such components, I can control my Sony Bravia TV from up to 1.5 meters distance (aiming the receiver spot). If you add some active components (transistors), that distance can be widely enlarged.

Well, now let’s look at the software. When you install the apk on your tablet and start the program, you will receive a screen like this :

The program was written for 800×480 screen tablets, landscape orientation. For my tests I used a LAVA 7″ (original firmware) tablet. This tablet recognized the USB to RS232 interface and assigned the /dev/ttyUSB5 name to it. My program, actually, uses this name as fixed setting. It will NOT work if the interface is recognized with another name (you will receive an error). Obviously, this can be modified, but I will do it in a next release.

In the “display” box, you can see “cmd: 21” ; this is the default command the device will send to your TV when you touch the button “Send”. This command is the TV-On or TV-Off. If you want modify the command, for example to send a Channel+, type on the numeric keys “16” then touch “Set” and your display will show “cmd:16”. Now, touching “Send” will send the command to your TV that will ( if powered-on ! ) skip on next channel. The “Can” key will erase a bad typed number. Note that this behaviour isn’t particular “user friendly”, just ‘cause I developed the program as a “tool” for my experiments. Not a problem to write some “fixed” keys, more user friendly  🙂

For a list of available commands, you can take a look at the following picture (the red rectangle at the right) :

Note that all the images in this article can be enlarged clicking on the miniatures.

Finally, the apk to be installed can be download directly from this link. It doesn’t exists on “the market”, ‘cause I don’t like that way to distribute software. I think it’s too monopolistic way and I don’t agree with such terms. So, the disclaimer is : TRY THIS PROGRAM AT YOUR OWN RISKit’s my original work, and is not certified or approved by others than me 🙂

Double the size of LocalDisk on Evodroid tablet (WM8505)

Hello, I purchased an old, used, working tablet based on obsolete processor WM8505. Why an obsolete model ? The reason is very simple : there is, on the internet, a full datasheet of the processor and good documentation, in general. When new products reach the market, they are still very technical, so well documented and simple to use. When it goes to be a business, the “commercials” come in and say to technicians : “you must hide all the infos and introduce some strange key to make impossible for anyone to look inside”. This is ‘cause the “commercials” are not able to produce ideas, they are able just to speak about things they can’t understand, and always have blinded vision of the future. Someone, any time, breaks the locks and looks inside,  ‘cause the “perfect lock” doesn’t exists. The result of this stupid behaviour is that the mankind is slowered and uses 20 years to reach the results that can be achieved in two. But the “commercials” are so happy, they sell and make big business. Absolutely haven’t a long view into the future.

Ok, I opened my tablet, just for look what’s inside. Here is a picture :

Just in the middle, you can see the “coreboard”, the hearth of the system, with the processor, the SPI flash with boot program, the ram, the oscillators and … the NAND FLASH ?  I can’t see the NAND flash, the “hard disk” of my tablet. Where is the NAND flash ?

ooooh, I found it, Is on a small board, hidden under the main board. But… there are only four wires ! Naaah, the NAND flash is a very common USB memory key ! That’s incredible, so the boot program in SPI flash is able to launch the system from an USB memory… VERY interesting !

I decided to disconnect the module from the tablet and wire it to a standard USB plug, in order to analyze it with my PC.

So, now I have an USB memory key with the hard disk of my tablet… Immediatly put in my PC and use the program Win32 Disk Imager, it’s open source, it’s simple, it works very well. I create a copy (img) of full pendrive and saved to disk for cloning on another USB memory key. Obviously, for using a standard usb memory key, I mounted a female usb plug in the tablet, using the 4 wires where was attached the original board. I used a 4GB memory key as destination of image file and tried to restart my tablet with such pendrive…

Ok, wires are connected, try to boot the tablet :

Uhmmm, animation starts, but continues “ad libitum” without starting the Android OS. There must be something wrong. Now, I extracted my pendrive and put it in another PC, running Puppy Linux. This is for a simple reason, Puppy Linux is my favourite “distro” and has the great GParted program, a powerful application to “look” inside disks and partitions. Inserting the pendrive, I discovered that has MANY partitions inside !

I see the main partition (the start) hasn’t the ‘boot’ flag. May be that’s the reason for tablet not starting ? Mmhh, let’s try to check. Modified the flags adding the ‘bootable’ to the first partition, then extracted the pendrive and tried again on the tablet…

WOW, now it works ! Ok, now, coming back to the Puppy Linux, I looked at all the partitions and the contents. First, the partitions list:

and now, the contents of each one : first SDB1

then, SDB5

then, SDB6

then, SDB7

and, finally, the SDB8

This is our “localDisk” ! Now, the original NAND flash was 2 GB and I have the new one that is 4GB, so i will resize the partition, using the GParted going from this situation :

to this new organization, filling all available space :

OK, all done. Now back again to the tablet and reboot. The led lights, the system starts…

And now, let’s go to measure how big is our LocalDisk 🙂

Wow… very good. Now, I can’t have an USB memory key attached to my tablet, so I opened the pendrive’s case and discovered that the small board inside is VERY similar to the original one…

So, I desoldered the USB plug and soldered the new circuit in place of the old one. All worked perfectly, tablet closed, disk space doubled.


Very simple wifi enhancement for tablet

Hello, my tablet has so many moddings… but when far from the router it has some difficulties to connect to the internet. So I soldered a 32 mm long enamelled wire at the base of printed CS antenna. The gain was more than aspected. Now I can connect from places where it wasn’t possible before.
Obviously, the enamelled wire must be “scratched” in the point where it’s soldered to the circuit. In this picture below you can see my version of this very basic antenna…
P.S. to the R.F. gurus : I know that this is NOT a clean way, but it works…

LAN connection without dongle on WM8650 tablet

When using a LAN connection with a tablet that hasn’t the RJ connector on-board, you can have some problem to gain the Heaven, ‘cause very often the “dongle” with the attached LAN cable detaches from the tablet, breaking all the connections (and probably your active work) and you, in such situation, may automatically start a sequence of @#@#@# and @@#@#@ that are not good to make points to your future “seat” up into the Sky.

So, what’s the simplest way to add an RJ connector to a tablet that hasn’t one ? It’s very simple : open the tablet and look for the transformer. Every tablet I’ve seen has all the circuitry inside, just the connector is outside, on the dongle. The transformer is the better place to solder wires, ‘cause has (usually) the pins spaced of 1.27 mm that is a measure easy to solder. In this picture, you can see one model of these transformers :

Even if your model is different, you will always have four small wires (look at the red arrows in the image) that comes from the “black bug” and go to the dongle’s socket. In my tablet’s specific case, the pins are named this way :

  • pin 16  RX + goes to RJ45 connector pin 6
  • pin 15  RX – goes to RJ45 connector pin 3
  • pin 10  TX + goes to RJ45 connector pin 8
  • pin  9   TX – goes to RJ45 connector pin 7

To clarify what are the positions of the pins on the RJ female connector / socket, here is a picture of the one that’s normally placed on the tablet’s dongle : note that the pin 1 is at the left ; the pinout suggested in the list above uses this standard.

Note that the pairs RX and TX are always “physically separated” (it’s a transformer !), so if in doubt when connecting a different type, consider that the TX and RX pairs are : one on a side, the other on the opposite. Also note that all the components on the circuit, needed for a correct ESD protection, are not mounted. It’s for sparing some money. In the practical use, if you just connect the tablet to a 1 meter cable tied to a router or another PC, you don’t need for it. Remember : you’re playing with very cheap devices. Anyway… soldering isn’t difficult, look here how I connected 4 wires of typical flat cable :

Not too difficult… and now, on the other side, I connected the RJ45 socket that will be used as tablet’s LAN connector. After testing the connection with success, use something like hot glue to make it “solid” and electrically insulated.

And finally, using a normal 1,5 meters LAN cable, I connected the tablet at my router and gained access to Google, as you can see in this final picture (note that wifi isn’t enabled !)

If you look a little bit deeply, you can see also other 2 cables coming out from the tablet… One is the serial port that actually is connected to IR led to work as remote control for my Sony TV, and the other is an USB female port, active and working (but unconnected in this picture), that I often use for my wireless KB / Mouse. Obviously… I hate tablet dongles 🙂


WM8650 tablet as remote control for Sony TV

Hello, here I am, again, with a simple mod for our tablets. In this picture you can see how it’s possible to control a TV set with our tablet using just one resistor and one IR Led ! In the picture you can see the tablet “dongle” (free of the plastic case) with the additional components needed. The circuit is the same proposed at point 3. of my article at this link (in Italian), just the led “color” is IR and the resistor is of lower value to gain some additional emitting “power”.

The IR led anode is directly connected to the 3.3V pad and the cathode to the resistor and this to the TXD pad ; the resistor value is 220 Ohm and must not be decreased in value.

Obviously, the distance you can reach with this small interface is very low, about 20 cm, but I will add in next days a driver circuit to make it working at longer distance. This is just a “proof of concept” (I like this definition).
At this link you can find the zipped APK file (the application) that I’ve written to test the device. Starting the application, you can see 12 buttons keyboard for entering the code to be transmitted, one “display” that shows what you type, and 2 other buttons: one is named “SEND” and simply transmits the IR code while you hold it down, and the other is named “QUIT”, to exit the application.

The program is compiled in debug mode, so without keys or locks. Deflate it from the downloaded zip and copy to sdcard of your tablet, then install it. Obviously, you must have the “unknown source” flag active.

The default command is 21 that in my Sony Bravia TV is the power-on / Power-off ; also test the numbers from 0 to 8 that are for changing channel from 1 to 9 ; for other commands, search on the internet for the Sony IR protocol.

Note: the program needs a small modification in init.rc file (you must be able to do this or the program will open with an exception error). In the init.rc command you MUST disable the console service.

this is the original:

## Daemon processes to be run by init.
#service console /bin/sh
service console /bin/login

you must change it to :

## Daemon processes to be run by init.
#service console /bin/sh
#service console /bin/login
#    console

Obviously, this is a first try… so if there are errors, please, don’t shot me ! But give me your feedbacks and suggestions to improve it. Thanks

Home made tablet’s dongle

Yesterday I was in a supermarket for my normal needs for beer and chocolate (orange flavoured) and my attention was attracted by a big box with some “special offers” inside. It was full of old electronic devices like car chargers and wall power supply for cellphones. There was one for LG phones at 0.50 Euro ! I immediatly pick it up, thinking of use the 5V supply for some project or gadget of my own production.

When at home, I opened the plastic box (below you can see a picture of the label)

and cut the wire ; measuring the green and black wires my opinion was confirmed : 5.25V output and even if loading the wires with a low value resistor the power just decreased to 5.15V , so, now I have an efficient 5V wall power supply for 0,5 Euro.

But this isn’t the most important thing. Looking at the connector I just cut out from the wire (‘cause I don’t own an LG cellphone) I had a hearthbeat miss (just one eh)… the connector seemed VERY similar to the one (the 24 pin flat and small) that’s used in my tablet’s dongle (the one for expanding with 2 USB, LAN and pads for Serial Port). Look this picture:

Yes, is exactly the right connector ! Now, the problem is : for any normal use, I need at least for 4 pins, even for USB, even for LAN. In this days I’m using the LAN to connect my tablet to the PC to develop some applications, so will be VERY useful for me to have a supplemental dongle for my work. As you can see in the picture, the phone charger seems to have just 3 contacts, but isn’t true: the contacts are four ; the green wire is connected to 2 pins tied together as the black wire (but these pins are far and so more easy to see). Well, the 4 pins are placed, originally, in positions 4 and 5 for +5V (green wire) and 12 and 19 for GND (black wire). For my needs (the LAN connection) I must connect 7,8,10,12 pins, so only the 12 is at right place. The others must be moved. So you must extract, very carefully, from their original places and insert in the new ones. The pins are VERY small so you, probably will need for some “optical enhancement” ! After placing the pins in the right places, you can solder the wires, as shown in this picture :

After soldering the 4 wires, you can close the connector and use an appropriate LAN socket to do the rest of job. The final result will like as this :

The pinout for the connection is specific for the LAN. If you like to make a dongle, for example, useable for one USB keyboard, simply place the contacts in the positions of USB Vcc, D+, D- and GND (look at my Robotop’s Place on HcH / TK forum, in the section “Good quality schematics” and browse some tablet’s internals for the 24 pin connector pinout). Hope this will help someone to make his own tablet’s dongle, as I did. Please, note that most of tablets have a problem of thickness in the dongle insertion. The plastic thickness of the tablet’s border and the one of the dongle’s case, summed together, may give a unreliable electrical contact. The same is for this non-standard dongle. My solution, useful for both cases, was to reduce the tablet’s border thickness with generous use of a Dremel tool 🙂

Wireless mouse inside your tablet

Hello, I used old 7″ tablet (plus some circuit made by myself) as interface for house thermal control. The problem is that when I’m on the sofa and want to manual change some parameter, I must leave the sofa (and the cat) and go to the tablet, then press the buttons on touchscreen and change what I want. Now, I noticed that in this tablet there are 4 free pads for connection of USB camera. This tablet was developed for supporting dual camera, but in this arrangment there is only the CMOS one, so the USB isn’t used ; well, I decided to use the free USB pads to connect a wireless mouse !
Gone in a supermarket and purchased (expensive) 9,90 Euro wireless mouse. The miniaturized USB receiver is shown in the picture :

Wireless mouse USB receiver – new, never used

Ok : as first operation I removed the metallic chassis, to gain access to the contacts; the receiver now look as in this picture :

Oops, it has lost the metallic chassis 🙂

Now, I soldered the four wires necessary to connect to the tablet as you can see on next picture :

And now someone attached 4 wires…

Ok, now the last operation is to solder the wires to the main board. Look at the next picture :

Ok, wires connected to the pads (also 2 resistors have been added to mainboard)

OKAY, all right, turn on and… it doesn’t work 🙁

Ok, I have some schematic found on the Internet, so a quick look shown me that there are two missing resistors on CS: R141 and R144. The first one is just a jumper (0 Ohm resistor), while the second is a 100K resistor. I soldered both of them on the circuit and started again turning on…  et voilà, now it works  🙂

I have a wireless mouse inside my tablet. Now I can access my program by the sofa, ‘cause I used wide controls on the screen, for my application, and I can see them at (relatively) long distance…

Hope this will be useful for someone…

I did it again: removable SPI flash II

Yes, I did it again… purchased a bricked tablet, can’t revive it in a “soft” way, so decided to make the SPI flash removable to rewrite it with the external programmer ( look at the previous version here ).

This time I used a normal DIL socket (8 pins) connected to the pads of original smd chip via 0.2mm enamelled copper wires. Obviously, that means now I need for a DIL 8 memory chip. I looked on the on-line Farnell catalog and found the AMIC A25L040-F chip with ordering code: 1907077 at less than 1 Euro per unit.
But “I can’t wait, I can’t wait, I will test the circuit immediatly”, so decided to adapt one small smd SOIC 8 memory chip on a standard 0.100″ DIL 8 socket to create a “Frankenstein” DIL 8 IC. Look at the results in the picture below… (click on images to enlarge)

The circuit (incredibly) worked and the tablet was revived. Yeah. A little problem, now… the tablet can’t close (mechanically) due to height of the 2 sockets stacked one over the other. Okay, this time I must wait for the right component, but in meantime I updated the tablet firmware with the UBEROID option 36 that worked after a little change in the command file wmt_scriptcmd. This tablet has 1024×768 screen and the script tried to open a 1024×600, locking the device. You can download my version of this script at this LINK (if interested to). Now, the specific IC is arrived and I executed a dump of the contents of working SPI flash (the “Frankenstein” one) on a bin file. After that, I programmed the new chip (the “normal” one) using that file as data source ; then mounted the DIL 8 chip into the socket, turn tablet on and… GO ! All working fine… Look below at the picture of new chip in the socket

Here is another picture (wide) of the board

Obviously, I modified the programmer’s circuit adding an 8 pin DIL socket to host the device under programming. Nothing difficult, just wired the pins to the correspondant signals of the existent SD card connector. Look on my other pages on this subject for additional infos.

My Android tablet has removable SPI flash

After two rom upgrades with wrong files, my tablet’s SPI flash was unable to run again a new upgrade, so I decided to create a removable SPI flash that can be reprogrammed externally. Now my tablet can’t be “bricked” anymore. If something wrong happens, I simply store a fresh copy of U-Boot and W-Load on the SPI flash and start again… (click on images to enlarge)

Well, I used a microSD adapter like this…

then, with small cutter I opened the adapter…

and soldered the small 8 pin SOIC spi-flash memory to the contacts, using 0.2mm enamelled wires.

After that, I closed the adapter using cyanoacrylate glue. The plastic over the memory was removed for making contact available for electrical inspection and thickness oversize.

Next step was to build a programmer using an SD card socket as connector. I used the same schematic you can find in my page here.

As final step, I soldered another SD card socket in the tablet, connecting the contacts to the pads of the removed IC with small 0.2mm enamelled wires. That’s all. After spi-flash reprogramming, the tablet started again looking for microSD card with the upgrade firmware.