Skip to content

Instantly share code, notes, and snippets.

@squeuei
Last active October 14, 2023 20:58
Show Gist options
  • Save squeuei/280339368e85b9faf4d756aad8171379 to your computer and use it in GitHub Desktop.
Save squeuei/280339368e85b9faf4d756aad8171379 to your computer and use it in GitHub Desktop.
How to enter FEL mode on Lichee nano

How to enter FEL mode on Lichee nano

If SPI flash isn't on the board, just remove the TF(microSD) card from the board and supply the power. It's the same if SPI flash is empty,

If your board have a SPI flash with preloaded image, pull D4(SPI CLK) down to GND. You can use the metal part of USB micro B or TF card slot as GND. Diagram is in the comment below. Thanks: @ernestp for the correction and providing a diagram.

Or you can use the special boot image [link]. Just write it to a TF card and boot.

Don't forget to remove the GND connection after entering FEL mode otherwise you will never be able to write the boot image to the SPI flash.

Even though the host Linux PC recognizes the board (like as Onda (unverified) V972 tablet in flashing mode on lsusb), sudo sunxi-fel version may return ERROR: Allwinner USB FEL device not found!. In that case, you need to make a udev rule.

/etc/udev/rules.d/50-sunxi-fel.rules:

SUBSYSTEMS=="usb", ATTRS{idVendor}=="1f3a", ATTRS{idProduct}=="efe8", MODE:="0666"

References

Off topic

If you want to build u-boot by yourself, python must be Python 2.x as of 2020-02-08. For example, you can't use the latest Fedora (F31) because the default interpreter of python is python 3.x.

@ernestp
Copy link

ernestp commented Jun 17, 2021

I have Lichee Nano with programmed SPI Flash, I tried all methods above but was not able to enter FEL mode.
(BTW D4 and SPI CLK is different pins, but neither of them was working to enter FEL mode.)

What was working for me is the following diagram:

Screen Shot 2021-06-17 at 08 31 04

@squeuei
Copy link
Author

squeuei commented Jun 22, 2021

Judging from the diagram, you made 5th pin down to GND. It's SDC0 D2 and not related to SPI0.
I attached an image to show you which pin to be grounded. When you try to do this, F1C100s SoC should be seen on the top side.
In addition, you can use 1st to 4th pin because they are all related to SPI0.

Sorry for late response. I hope this still helps you.

LN

@ernestp
Copy link

ernestp commented Jun 22, 2021

It looks like I used SPI0 CS

122316949-de598080-cf46-11eb-8057-087a0b205e89

@squeuei
Copy link
Author

squeuei commented Jun 23, 2021

I'm sorry, it seems that you're right.
I must have misunderstood the schematics.
I'll update the article after testing, but I'm out and don't have physical access to the board right now.

Have you tried to short pins of SPI flash directly?
Pin 1 CS is easy to find. It's near the small circle on the package.
A small test hook / grabber will help you to keep contacting to the terminal.

@ernestp
Copy link

ernestp commented Jun 23, 2021

yes, 1st pin of SPI flash does the same

@squeuei
Copy link
Author

squeuei commented Jun 23, 2021

Do you mean that neither throughhole on the board nor SPI flash IC pins work? That's strange.
Have you tried to see UART or LCD output to check if the board boots up normally? What's the distro of your host Linux PC? It may not work on WSL2 (I haven't tried though.)

@ernestp
Copy link

ernestp commented Jun 23, 2021

I mean both 1st pin of SPI flash and pin 18 on your schematic does the same, (and pin highlighted on my image) switching to FEL mode on boot. I guess SPI CLK will also work, but not tried. I'm using UART (USB-TTL) from Mac.

@squeuei
Copy link
Author

squeuei commented Jun 23, 2021

Let me confirm. Have you succeeded to enter FEL mode? Or it's it just an advice for me to update this article? If you have already succeeded, please ignore the sentences below.

Lichee nano should be connected to a Linux host PC via USB micro B. (Optionally you can use USB to UART converter to see the boot message from u-boot or Linux.)
Before connecting to the host, connect some SPI0 pin to GND. And then connect the USB cable to the host.

It should be in FEL mode (so that no messages are shown on UART.)

On the Linux host you can confirm that the board of in FEL mode by using lsusb command.

@ernestp
Copy link

ernestp commented Jun 23, 2021

I was unable to enter FEL mode using your article as well as provided links.

Only way I was able to enter FEL mode is by grounding SPI0 CS as on my diagram (found on YouTube video).
I was able to confirm entering FEL mode by enumeration of USB (which not happens during normal mode).

I see you already strike out D4 in your article.
I just wanted to add diagram because this article is one of first links on Google so other people may find diagram useful.

@squeuei
Copy link
Author

squeuei commented Jun 23, 2021

Okay, I finally see what you mean.

I thought that you were still in trouble. But, in fact, you already solved the problem and corrected my mistake.
So, thank you for providing the right information and clarifying things by illustrations.

I'm so sorry for taking your time on my misunderstanding. I much appreciate you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment