Issues with "recovery" button
#1
Hello PBP users!

I am currently trying to work with the "rkdeveloptool", and I'm having trouble getting my PBP to show up as a USB device. I have successfully installed the "rkdeveloptool" on Ubuntu 19.04 (amd64). With my PBP I removed the bottom cover and, with no OS booted and the power off, pressed the "recovery" button once. As I understand it, this should cause the SoC to start in to a alternate mode (maskrom) where I can then manipulate it via USB on my other PC. I am using a USB A to USB C cable to do this. After connecting this cable, the PBP does not show up in Ubuntu. lsusb does not see the device, neither does the tool from rock-chip. I tried this again with all bootable media removed, it did not make any difference, also the only cable connected is USB C.

Any help would be amazing! Has anyone else had this issue? Am I stupid and missing something obvious?

Thanks!
#2
...why are you doing this? (curious)
#3
(01-26-2020, 09:54 AM).LANStrider Wrote: Hello PBP users!

I am currently trying to work with the "rkdeveloptool", and I'm having trouble getting my PBP to show up as a USB device. I have successfully installed the "rkdeveloptool" on Ubuntu 19.04 (amd64). With my PBP I removed the bottom cover and, with no OS booted and the power off, pressed the "recovery" button once. As I understand it, this should cause the SoC to start in to a alternate mode (maskrom) where I can then manipulate it via USB on my other PC. I am using a USB A to USB C cable to do this. After connecting this cable, the PBP does not show up in Ubuntu. lsusb does not see the device, neither does the tool from rock-chip. I tried this again with all bootable media removed, it did not make any difference, also the only cable connected is USB C.

Any help would be amazing! Has anyone else had this issue? Am I stupid and missing something obvious?

Thanks!

Mask rom will use the USB on-the-go controller and I believe the type A USB3 socket is connected to this controller rather than to the type-C socket. In other words I think you might need a USB-A to USB-A cable (which are a pain to purchase because it is hard to craft a suitable search engine query ;-) ).
PineTime: wasp-os and MicroPython, Pinebook Pro:  Debian Bullseye
#4
I've done this on some other HW supporting RK3399, the NanoPC T4

I tell here what I've done on this platform to get RK3399 in bootrom mode

You need a USB-A cable to USB-C plugged into toe USB-C port
Press MASKROM and Powerup (maybe also reconnect your powerplug)

Also they is maybe some issue with the USB-C cable, due the flipping mode of this plug.
Try to "reverse plug" the USB-C port.

Maybe there is some difference here, but I must check the schematics ...
Also it's possible, you don't need to connect USB-C in the first place ...
#5
Thanks for all the suggestions! I will give it another try. Smile

I am try to to this as I flashed a misconfigured bootloader to my eMMC card. As the boot order is hardcoded on to the SoC, the only way that I can boot an OS right now is with the eMMC disabled. I found that if I can reprogram the SPI to boot the SD first, then I should be able to mount and access the eMMC. The problem is that the mtd-utils toolkit is not able to wright to the SPI flash (as mtd0) as it is locked, and I am not able to do a unlock. I get "error 110-time out" when ever I try to modify it. In essence, its stuck in read-only mode. I was hopping that I would be able to access it with the tools from rock-chip, but have had no luck so far with that. If all else fails I have an eMMC reader on order, how ever I would still like to be able to connect to it.

Anyone else have trouble with the SPI Flash module? I have no problems on my RockPro64...
#6
Star 
Eureka! I've found it!

I have successfully flashed an image to my SPI device. I was not able to do this from within Linux.

Here are the steps required to flash an image to the SPI Flash on the PBP. You will need a USB C to A cable and second PC to do this. This is the same cable that many newer phones use to recharge. If you need to open the device, please follow the proper disassembly instructions on the wiki.

1) On your other Computer install the "rkdeveloptool" Click here for institutions on how to do this.
2) With the PBP powered off, remove all bootable media from the device. This includes all SD cards as well as the eMMC. If you have an eMMC installed you will need to open the case and flip the eMMC switch down towards the trackpad. With nothing to boot from, the SoC will default to Maskrom mode.
3) Connect your other Computer to the PBP with the USB cable, attaching the USB C connector to the PBP. Then press and hold the power key for 10 seconds.
4) Run the following comand on your PC - "rkdeveloptool ld". Your PBP should now show up, if it does not, verify the last few steps. ld means "list device"
5) In order to flash, "rkdeveloptool" needs a db file for the product you want to work with. For the PBP this file worked well for me. Download the DB and run this command:
Code:
# rkdeveloptool db /path/to/rk3399_*.bin

6) With all that out of the way, we can finally flash our image of choice to the SPI Flash chip. "wl" means wright to, the 0 tells it to start at the beginning of the memory.
Code:
# rkdeveloptool wl 0 /path/to/spi*.img

7) With that done, we can now test the device.

Code:
# rkdeveloptool td

8) If the last step was successful, you may now reboot, and test your new bootloader.

Code:
# rkdeveloptool rd

This is the only reliable way that I know of to access maskrom. If anyone was able to do this from a booted OS, I would love to know how you did it.


Have fun!
#7
Very useful info Smile

Can you paste output of below command ?


Code:
cat /proc/mtd0
#8
(01-28-2020, 03:51 AM)as400 Wrote: Very useful info Smile

Can you paste output of below command ?


Code:
cat /proc/mtd0

On Manjaro
Code:
[tux@pinebook ~]$ cat /proc/mtd
dev:    size   erasesize  name
mtd0: 01000000 00001000 "spi0.0"
[tux@pinebook ~]$ mtdinfo
Count of MTD devices:           1
Present MTD devices:            mtd0
Sysfs interface supported:      yes
[tux@pinebook ~]$ sudo flash_unlock -i /dev/mtd0
[sudo] password for tux:
Device: /dev/mtd0
Start: 0
Len: 0x1000000
Lock status: locked
Return code: 1

On Armbian

Code:
tux@pinebook:~$ cat /proc/mtd
dev:    size   erasesize  name
mtd0: 003f8000 00001000 "loader"
mtd1: 00008000 00001000 "env"
mtd2: 00040000 00001000 "vendor"
tux@pinebook:~$ mtdinfo
Count of MTD devices:           3
Present MTD devices:            mtd0, mtd1, mtd2
Sysfs interface supported:      yes
tux@pinebook:~$ sudo flash_unlock -i /dev/mtd0
[sudo] password for tux:
flash_unlock: error!: could not check lock status device: /dev/mtd0

             error 95 (Operation not supported)
tux@pinebook:~$ sudo flash_unlock -i /dev/mtd1
flash_unlock: error!: could not check lock status device: /dev/mtd1

             error 95 (Operation not supported)
tux@pinebook:~$ sudo flash_unlock -i /dev/mtd2
flash_unlock: error!: could not check lock status device: /dev/mtd2

             error 95 (Operation not supported)
#9
Have you all noted this from rockpro64.

@sigmaris has build a mianline u-boot with NVME boot enabled, and has an sd card image for flashing it.  I used it  at armbian "current" build on a rockpro64,  and am able to boot sd, emmc, usb2,usb3, and nvme all from spi flash.   Of course,  his u-boot for the device tree for the rockpro64 is more robust than the ones just recently developed for the pbp u-boot, but  the developers seem to have an NVme  branch now, too.

At any rate,  taking a look at the flash_spi.scr , you can see that it makes use of the "load" and "sf update" command in u-boot.   If you have a properly built image for writing to spi flash,  you could probably even stop u-boot through the serial console, and load and  sf update the image.  You'd still have to disable the emmc,  but that might be less trouble then flashing from maskrom mode....

I haven't tried yet.



[url=https://forum.pine64.org/showthread.php?tid=8685][/url]
#10
Just one correction for the tutorial.
You have to use this loader file ----> https://dl.radxa.com/rockpi/images/loade...15.114.bin

edit: and second Smile After disconnecting all boot devices it's enough to push power button to get into maskrom. You don't have to do it for 10 seconds.


Possibly Related Threads…
Thread Author Replies Views Last Post
  Issues with T-Mobile Home Internet? skinnyonthebebop 3 990 10-17-2023, 07:42 AM
Last Post: skinnyonthebebop
  Got a PBP - batch(August/September) and the audio is not good(2 big issues) crazyquark 2 1,397 10-01-2022, 10:16 AM
Last Post: crazyquark
  MiniConda Install Issues nixyhustle 0 740 09-16-2022, 10:06 PM
Last Post: nixyhustle
  new PBP issues jpjnh 9 3,706 08-22-2022, 07:26 AM
Last Post: wdt
  Issues with External Display After Recent Update reundo 0 1,336 11-18-2021, 06:37 PM
Last Post: reundo
  HArdware issues while charging user18130814200115 2 2,747 05-01-2021, 04:13 AM
Last Post: gabeeg
  Issues with chromium-docker PVD 4 6,256 12-17-2020, 10:11 PM
Last Post: warehouses
  App installation issues on PBP pineitup 0 1,648 10-21-2020, 06:23 PM
Last Post: pineitup
  issues with keyboard/trackpad in Manjaro, can't test other OSs joshw 11 12,566 06-25-2020, 08:11 AM
Last Post: joshw
  Intermittent Boot Issues MrRoosevelt 19 17,965 06-21-2020, 06:45 AM
Last Post: khanku

Forum Jump:


Users browsing this thread: 2 Guest(s)