Jump to content

Recommended Posts

Posted (edited)

On my NanoPi-R6C I have been doing several U-boot updates (writes with dd to areas in 1st 32k) and so far so good. But behavior has changed w.r.t. eMMC v.s. SD-card.

I want to do some U-boot build config changes, so the risk it that something might go wrong and I would need USB MASKROM mode to do writes to eMMC I think.

The NanoPi-R6C wiki is not very clear with 'connect USB', but it turn out that  this should be a connection via type-A to type-A and it does not work in the USB2 port.

 

I have a USB2-only type-A to type-A cable and used that.

The NanoPi-R6C appears in the USB device list ('lsusb') and also the tool is seeing the device:

/tmp/upgrade_tool_v2.30_for_linux/upgrade_tool LD
Using /tmp/upgrade_tool_v2.30_for_linux/config.ini
List of rockusb connected(1)
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=12     Mode=Maskrom    SerialNo=

However, as soon as I want to read blocks from eMMC for example or try any other commands, connection is lost.

 

Now I think that maybe for actual data transfer, USB3 wires in the cable are needed, so the question is: Will it work when I buy/use an USB3 type-A to type-A cable?

 

Edited by eselarm
Posted

I think you lose the connection because the kernel is loaded. I do not use the friendly elec tools. I just boot from an OpenWRT image.

  • Get a USB-A to USB-C cable
  • Connect USB-A to PC
  • Connect USB-C to DEBUG port
  • Use screen to connect to the NanoPi: (you might need sudo)
    screen /dev/ttyUSB0 1500000
  • Get OpenWRT NanoPi-r6c image and write to sdcard
  • Boot from sdcard with maskrom
  • then you can use scp to transfer files
  • and dd to write/erase/backup

I think I did something similar here:

 

Posted

@dantes

"You might need sudo" generally means "if you regularly use a serial console or maskrom connection you will want to configure user permissions for /dev/ttyusbX" (i.e. adding the user to the "dialout" group).

Back when modems were still frequently used adding a user to dialout might have been a serious problem.

 

I think nowadays using sudo for pretty much anything is the greater risk.

Posted

@DantesWhen I still had the original 2017 U-boot on the eMMC (from the OpenWRT that came pre-installed), inserting an SD-card with some recent Armbian image booted always from the SD-card. So in serial/debug console I had full control of the eMMC (and also an NVME in the M.2 slot). So that is also how I recently wrote a new/latest 2024 U-boot from the current-branch Armbian to the eMMC with dd.

But that 2024 U-boot is more flexible and I needed quite some time to and figure out what was what (after stop autoboot prompt):

1 - SD-card with a known good simple basic Armbian Bookworm

2 - eMMC where the custom kernel did not work

3 - NVME with an EFI boot partition with grub.efi and some variant of openSUSE and some Debian flavor

After reading U-boot command docs like 'bootflow', I somehow booted from NMVE. Fine but I want also operation with no NVME in the M.2 slot inserted.

So eMMC and SD-card can be selected in U-boot but was a bit guessing as I had to rely on some addresses, so 3rd try or so I started the good simple basic Armbian Bookworm from SD-card and from there I could put a working kernel Image/uInitrd/DTB on the eMMC again.

 

But what will happen if the somehow the U-boot on eMMC is corrupt? That has not happened, but when it would, will it then always somehow re-init and try SD-card? That is my point, that is why I thought I should also get to know USB loading, like I know from Android smartphones with fastboot tool.

 

But you state: "Boot from sdcard with maskrom", that I had not thought of. Does that skip eMMC always?

 

And scp? You mean the ethernet port(s) is/are up and running then? Or something over serial cable downloading what is known from simple old processor boards?

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines