Lichee Pi Nano with W25N01GV support [Complete Guide]

Hi, It’s quite a while now, and it been ~1 year since I bought Lichee pi nano and tried to upgrade from 16M SPI-NOR flash to QSPI-NAND W25N01GV 128M flash, I f**ked around with U-boot for year to make it boot but I didn’t until 10 days ago (from the time of writing). I can FINALLY make it boot ! YAY!!! but I didn’t stop there. Let get started

Hardware requirement

  1. Lichee pi nano x1
  2. W25N01GVZE (WSON-8 package) x1
  3. Micro SD card, the size at lease 1GB
  4. USB to UART at 3.3v logic level

U- boot compilation

first you need to install the dependencies software on your PC (next time will be called “Host“). Install followings

swig python-dev python3-dev libncurse5-dev zlib1g-dev gcc-arm-linux-gnueabi

plus other dependencies that I recommended to lookup on google and using keyword like “building uboot” or “install build essential”

Then next you need to git clone my repo from github by using command :

git clone https://github.com/TiNredmc/u-boot.git

after that, lets build the u-boot image

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- licheepi_nano_spinand_defconfig

wait until the “.config” file is created and then : NOTE N is your CPU core number.

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -jN

after compiled, there will be the file name “u-boot-sunxi-with-spl.bin” you need to convert the image into boot-able nand image by running command :

sh f1c100s_uboot_spinand.sh uboot_nand.bin u-boot-sunxi-with-spl.bin

There will be output image called “uboot_nand.bin” that you can later flash to the nand.

Linux kernel compilation

TBH, I’m not sure about the dependencies on Host side but you can google up for “Building Linux dependencies

Now lets clone the repo

git clone https://github.com/TiNredmc/linux.git

Then : NOTE N is your CPU core number. “.config” build configuration file is already in the repo

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -jN

wait and wait… and there will be 2 files you need to grab from

(at the kernel folder)/arch/arm/boot/zImage

(at the kernel folder)/arch/arm/boot/dts/suniv-f1c100s-licheepi-nano.dtb

we need two of these file before we deploy the rootfs

Buiding Buildroot

as always, git clone

git clone https://github.com/TiNredmc/f1c100s-buildroot.git

the BUILD the BUILDROOT !!! : You probably notice the -jN and know what to do ;D

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -jN

after it done copy 2 files(one for SPI-NAND and one for SD card).

(at the buildroot folder)/output/images/rootfs.ubifs

(at the buildroot folder)/output/images/rootfs.tar.gz

Gather all the files into one place

uboot_nand.bin , suniv-f1c100s-licheepi-nano.dtb , zImage and rootfs.ubifs

install sunxi-fel

I won’t go through this step but you can google up

Flash U-boot, Device tree blob and kernel

first you need 2 special u-boot as a flashing tools, They are inside folder of u-boot name “util-images

First one is “u-boot-usb.bin” this will be used when flashing U-boot and DTB files

The second one is “u-boot-8M-usb.bin” this will be used when file is between 1MiB and 8MiB, In this case it’s zImage.

Before using sunxi-fel command

MAKE SURE THAT YOUR BOARD IS IN FEL MODE

AND ALREADY OPENED THE TTY SERIAL ON LICHEE PI NANO,

AND YOU HAVE TO RELEASE THE SPI CS PIN HOLDING AFTER ENTERED FEL MODE EACH TIME.

U-boot flash command

sunxi-fel -p uboot u-boot-usb.bin write 0x80000000 uboot_nand.img

after that, if you see in the Lichee’s tty serial , the flashing progress will happen automatically. your can type “reset” in the TTY to exit u-boot fel .

DTB flash command

on Host do

sunxi-fel -p uboot u-boot-usb.bin write 0x80000000 suniv-f1c100s-licheepi-nano.dtb

on TTY SERIAL do

PRESS ANY KEY BEFORE COUNTDOWN STOP

>mtd list

>mtd write spi-nand0 0x80000000 0x80000 0x2800

HOLD CS PIN PREPARING TO ENTER FEL MODE

>reset

RELEASE CS PIN HOLDING

zImage flash command

on Host do

sunxi-fel -p uboot u-boot-8M-usb.bin write 0x80000000 zImage

on TTY SERIAL do

PRESS ANY KEY BEFORE COUNTDOWN STOP

>mtd list

>mtd write spi-nand0 0x80000000 0xA0000 0x400000

HOLD CS PIN PREPARING TO ENTER FEL MODE

>reset

RELEASE CS PIN HOLDING

now I recommend you to try booting the nano up, if nothings went wrong, it should boot into kernel and KERNEL PANIC since we haven’t deploy rootfs yet.

Deploy rootfs

at this part is the most trickiest part of all. let start !

  1. get your micro sd card totally formatted and delete all partition
  2. create 2 partitions one with first, FAT16 at 16M and the second one EXT4 at all the space left
  3. grab the u-boot-tf.img and boot.scr from (u-boot folder)/util-images
  4. run following command on Host ,X is your sd card drive letter like sda sdb….

sudo dd if=/dev/zero of=/dev/sdX bs=1024 seek=8 count=512

sud dd if=u-boot-tf.img of=/dev/sdX bs=1024 seek=8

Next is to copy boot.scr suniv-f1c100s-licheepi-nano.dtb and zImage to the FAT16 partition.

Now we gonna deploy the rootfs onto sd card and will later on our pi nano ❤

  1. mount the Ext4 partition somewhere, assuming at /mnt/sdroot
  2. on Host run

sudo tar xzvf rootfs.tar.gz -C /mnt/sdroot

sudo cp rootfs.ubifs /mnt/sdroot/root

after that, put sd card into the lichee pi nano, power it up and wait until login prompt on TTY SERIAL

Username and password are “root

inside the TTY SERIAL type

ubiformat /dev/mtd3

ubiattach -p /dev/mtd3

ubimkvol /dev/ubi0 -N rootfs -s 100MiB

ubiupdatevol /dev/ubi0_0 rootfs.ubifs

after that, you can disconnect lichee pi nano from power, remove sd card and boot up the nano again and viola ! Lichee Pi Nano with W25N01GV NAND chip.

SHARP Memory LCD with STM32F3

For anyone who already own this display and having stm32 in-hand. I’m appreciate to get help from you testing the driver.

Recently, I came across the display that I’ve been waiting to buy since last year. It’s SHARP Memory Display. I first saw this on WaveShare AliExpress store and it was 128×128 pixels (iirc) up for selling for about $20 including breakout board with Vreg and Logic level converter. I almost buy one of that for just $18 (11/11 discount). I googled for the data sheet but suddenly found other mem lcd but with different resolution. Two things I did is grab the part number and search for datasheet on google and search for listing on AliExpress. Then I came across with one of the display that seems to fit the “Pocket PC” project since I already own 2 Lichee pi nanos that are capable of running Linux

The one that I went with is LS027B7DH01. The Digikey is selling for $28.52, which is pricey to me. But fortunately found the cheaper one on AliExpress. And it seems to has a good review for it. So I grab one off for just 14 Bucks (Discounted) plus FREE SHIPPING (YAY, trackable too).

I already made the driver / controller code for my stm32f3 discovery board. but It should work with other board (Tweaks needed). Plus I’m start using “git” command line and GUI very seriously.

All the things I left to do is to buy some 0.5mm 10 pin FPC breakout board for connecting up the display and test it. Probably arrive next year…

Here are what you wanted
The Driver : https://github.com/TiNredmc/SharpMEMDisp
The Listing : https://www.aliexpress.com/item/4000388720940.html?


New project : ComeNCapture

ComeNCapture is a small project, Quick and Dirty logic analyzer based on STM8L mcu. I wrote a little code for this project. Using timer 4 interrupt for adjustable data sampling rate. By manipulating 2 variables, ARR and prescaler. By using USART and baud rate of 115200. With USART interrupt, I can control when to start ot stop the data sampling. By sending 3 bytes {Start/Stop, ARR, Prescaler}. The start and stop is 0x01 and 0x00. ARR and Prescaler are the important for timer interrupt. I will get into this later.

For example. I want to capture the 50Hz square wave to see the duty cycle. I need the sample rate of 100Hz. A.K.A 2x ; x is the target frequency that we want to capture.

But the big problem is I’m not sure that it will work. And if yes from my perspective, It’s 0% reliable.

Link to project is Here

Six years of finding the datasheet and pinout of the MN15439A

Chapter 1 : Beginning

6 years ago. I got the old CD car player made by SONY. It’s CDX-GT700D and this CD car play having such a fascinating feature. That is the Graphical Display with the the Blue-ish like 488nm laser ! So I don’t delay de-solder-ed that day. removing the display and thrown the rest panel board, leaving only bare Display. It’s turned out to be Vacuum Fluorescent Display  or VFD .

Here’s the demo :

Chapter 2 : Hunting Haunted

Year later, I just finding old stuffs that I have and found this Display, I took it from the box and start looking at the back of the display. Then I noticed the the weird shiny brand “Noritake itron JAPAN” and marking MN15439A on the opposite side (We’re still on the back).

then I googled this up but found nothing, I start by going to the Noritake Itron ‘s Website in the VFD section also found nothing, but at that time (Grade 8) my English skill isn’t great likes today, So I gave up on that. Then I contacted to one of employee by the contact email on their website. They said

Dear classified name / Thailand
The P/N : MN15439A is designed for particular customer.
Unfortunately we can not open any of the information
about this exclusive customer.
Thank you for your understanding.

OK. Not what I expected though …

Another year passed still no clue what the heck is this stuff, I went to their website again to grab the similar display’s datasheet and compare with this SUCKER (oops, little explicit xD). and I draw the pinout of the MN15439A (At then, I guess that it’s right, and absolutely YES!) not exactly remember what display is used as reference (possibly MN14440A or MN14416A). back then my hand writing still sucks as right now lol.

Chapter 3 : Electrically thinking

Everyday I went to school, And I known one teacher (who used to be an adviser of friend’s school project) He is the top form in Electronics, He design his own switching power supply, making his own Sumo robot and a lots more of electronics things (including Microprocessor/controller this from ASSEMBLY to BASIC and C/C++). I ask him for some help for how to correctly drive the Display’s filament heater (electron shooter) and he said that it both works with DC and AC at about 3.3 volt (which is right).  Big thanks to him. but unfortunately He passed away 2 years ago (2018) due to cancer. but his wife told me that he’s very smart guy but since he was teacher. He works hard and some day he doesn’t event come back home, his wife said. Anyway don’t be sad -> Lets dig deeper

Today, I decided to write this blog (2020/5/1) because something just hit my brain and telling me to pick this old display up along with my GU280x16G-7000 from project  FakeGrayscale. I start to search again after 6 years. Now I have the better English language that 6 years ago (I believe xD).  I went to [Noritake Itron] website again to download ALL of datasheet that available for downloading. Finally found two that having exactly same pin number are the MN14440A and MN14416A. . But I’m skeptical that the custom made likely having entirely different pinout. new Idea just pooped up in my head. I quickly go to google my activities site and use keyword CDX (that What I remember) and the “CDX-GT700D” trigger my memory. quickly search for service manual.

Chapter 4 : Reveal the truth

Good luck, I found the service manual online and download them, surprisingly found the PCBs and Schematics. And boom !!! the Display PCBs

The first page of service manual :

service_manual

PCB layout :

service_manual2

YEAHHHHHH. Finally. after 6 years of finding. It’s here ! The MN15439A

service_manual3

Comparing with the actual thing :

Great match, After that I took some look at my drawing from many years ago and I was right back then.

Chapter 5 : What’s next ?

*at this point. I forgot to tell you that the MN15439A uses the Chip In Glass – CIG Technology by putting few shift register on the glass inside display. Each shift register has hundreds of bits (up to 288 bit !)*

reaching this part. I’ve mad a plan to design the 50-ish VoltDC boost converter for the VFD and do some code with STM8L (seriously ?!?!?). I will include the links to the display I used as the pinout reference (which is match) and some more details of that display.

All the data I used is here.

MN14440A – brief datasheetMN14440A full datasheetCDX-GT700D service manual

LTL-7100M-HB : The super weird bi-color LED bar graph.

Month ago, I got some very rare LED bar graph from yoycart ( Chinese taobao agent) here.

And this is some bit from datasheet with the Charlieplex-like connection of bi-color LED (green,Yellow)

Annotation 2020-04-28 100104

Now we have the diagram, It’s time for the real thing up and running ! As again. No arduino this time, just bare metal STM8L151F3U6. My choice beside Arduino for quick prototyping.

DSC_0100

Looks like Photoshop-ed uh? Now some closer look. Compare to my stm8l dev board.

DSC_0114

Lovely TINY. Barely sit on the bread board

 

DSC_0108

DSC_0111

Back-lit TI-82 is done !

Hi guys, I’ve been working for several days, And now it working !

Originally, I plan to use (and should use) the 560uH inductor. but due to COVID-19 outbreak. It cause most of economy shipping companies to slow the process down. All of the parts arrived fine except the inductor (which is suppose to arrive first but not).

u0e98c7019a944badb2a6174c030a934ev

So I need to find the inductor that not less than 560uH, and luckily found one. the 1mH. Technically should be store energy mush more than the 560uH, but it uses for voltage boosting, So it works fine.

Then I build up the things, soldering everything together on the PCB. ( Also I got fake HV823 !).

DSC_0026

DSC_0054

And Everything works fine ! Here I connected to the DC-DC booster from 5 volt to 9 volt and it very bright !!!!

DSC_0060

after gone through many process (both off and on camera). Everything seems fine until now 😀 (Note that ripple effect caused by camera, In person is flicker-free).

DSC_0078DSC_0077

some Reflection reveal the tape I used to stick the EL panel with LCD together, as well as the soldering spot on the EL panel.

IMG_20200425_143343

After reach this part, It mean that this time I’m typing, the project is done and still in process of video making.

COVID-19 affected all of my project

Hello guys. After couple months of covid-19 lockdown, pandemic, etc… My projects had been delayed and no where to be finished. Including

  1. FlexWatch 0.1
  2. ELmod82
  3. <CPU load monitoring via i2c bus on PC monitor for pc running linux, haven’t got the name yet 😅>

But at lease, I have enough time to made some video series for the stm8l for noob (not really for noob lol). Anyway stay tune on my YT channel.

STM8L template updates!

I’ve made some update to the stm8L template, The updates including

  • USART is working ! with the example code !!!
  • Also made the configurable USART speed in usart_init();
  • I added my new little library call “dev_id” for reading Device Unique ID (according to datasheet), as well as example code
  • I also ported the TIM4 delay and made example (the delay with TIM4 originally coded by Shawon Shahryiar on embedded-lab.com). This delay will soon replace original delay. This one way more precise (soon will make one compatible with external clock source)
  • added LEDring code, soon will replace the AVRingLED project.
  • changed the CPU speed to 16MHz at default

I will made more update (Incuding Hardware SPI , I2C, BEEP and some IrDA (SIR) Things! So please calm down and wait me done my stuff. I won’t make you disappointed 😀

Link goes here 

TI-82 calculator !

Yesterday (2020/2/2) I received my Graphing calculator from Denmark , but that is not t he point. It’s TI-82 calculator. The USER-FRIENDLIER TI-85. Although, the online world in 2020 still lack of the useful Information and modification, But I found on the ticalc and someone made the TI-link compatible cable (Black link compatible) and someone had jammed the EL backlight for illuminating the screen !, So in think 2 months of vacation, I would like to make it better by adding EL backlight and made my own TI-link the linking cable ! and here is a bit of some photos I took.

So I will put some link down below for the PCBs order link from OSHpark. (Will include github repo as well on that link)

SerialLink (My TI-link clone)

ELmodPCB