Jump to content

RK3399 Orange Pi


Igor

Recommended Posts

I finally managed to install the OrangePi HDMI-IN image to the eMMC, but still have to figure out how to handle the camera.

Anyway...
While I'm working with the OrangePi Debian Stretch, is there anything I can grab that could help the Armbian build?

I finally have the logs thanks to the UART, so that I should be able to setup

setenv devnum 1

followed by

run mmc_boot

. This way, I could start Armbian from SDCard anytime.

 

Unfortunately, I can't build a kernel on my Lubuntu laptop for the time being.
I will try to setup an Armbian build environment on it.

Link to comment
Share on other sites

After reading this excellent blog post by Dieter Reuter, I said to myself that compiling the kernel on this very same board could be a good idea.
I cloned the kernel:

git clone   https://github.com/orangepi-xunlong/OrangePiRK3399_kernel.git


Unfortunately, 

zcat /proc/config.gz > .config

does not work.

    1. /proc/config.gz 
    2. /boot/config 
    3. /boot/config-$(uname -r) 

do not work either, I suspect the config extension have not been built for this kernel.

 sudo modprobe configs
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.103/modules.dep.bin'
modprobe: FATAL: Module configs not found in directory /lib/modules/4.4.103

Then, I thought I could get the configuration from the kernel image file.
It was nowhere to be found...

So, I unzipped the img I flashed on the device on a X86 Linux machine, mounted the boot img

sudo mount -t msdos -o loop boot.img /mnt/firmware/
gounthar@maurice:~/Desktop/rk-linux/out$ ll /mnt/firmware/
total 19212
drwxr-xr-x 3 root root    16384 janv.  1  1970 ./
drwxr-xr-x 3 root root     4096 mai    2 16:22 ../
drwxr-xr-x 2 root root     2048 oct.  16  2018 extlinux/
-rwxr-xr-x 1 root root 19568648 oct.  16  2018 image*
-rwxr-xr-x 1 root root    78885 oct.  16  2018 rk3399~1.dtb*

and it does not work

/usr/src/linux-headers-4.18.0-17/scripts/extract-ikconfig /mnt/firmware/image >config
extract-ikconfig: Cannot find kernel config.

The file command says image is just data. Could it be linked that I'm doing that on a X86 machine?
I then transfered the image file to the RK3399 to see if I have a different result:


root@linaro-alip:/home/linaro/OrangePiRK3399_kernel# file /tmp/image
/tmp/image: data
root@linaro-alip:/home/linaro/OrangePiRK3399_kernel# ./scripts/extract-ikconfig /tmp/image
extract-ikconfig: Cannot find kernel config.

 

Link to comment
Share on other sites

So... I somehow managed to compile a kernel for this board, then a whole image, and burned it on a SDCard with Etcher.
The problem I have is that I can't make this card boot the SDCard unless I do the shorting trick.
I tried what is indicated on the dedicated Armbian download page, but it failed:

In:    serial
Out:   serial
Err:   serial
Model: OrangePi RK3399 Board
Net:   eth0: ethernet@fe300000
Hit any key to stop autoboot:  0
=> mmc list
dwmmc@fe320000: 1
sdhci@fe330000: 0 (eMMC)
=> setenv devnum 1
=> run mmc_boot
mmc_init: -5, time 4
=>
mmc_init: -5, time 4
** Bad device mmc 1 **
mmc_init: -5, time 4
** Bad device mmc 1 **
=>
=>

I'm sure I missed something, but what?
I have the very same behaviour with the standard Armbian image on the SDCard.

Link to comment
Share on other sites

2 hours ago, gounthar said:

I'm sure I missed something, but what?
I have the very same behaviour with the standard Armbian image on the SDCard.


It's important which u-boot you have on eMMC. If you used their tools, it gets overwritten. Xunlong's u-boot is not capable of such tricks. See:

Spoiler

U-Boot 2019.04-armbian (May 16 2019 - 19:31:31 +0200)

Model: OrangePi boards based on Rockchip RK3399
DRAM:  2 GiB
MMC:   dwmmc@fe310000: 2, dwmmc@fe320000: 1, sdhci@fe330000: 0
Loading Environment from EXT4... ** File not found /boot/boot.env **

** Unable to read "/boot/boot.env" from mmc0:1 **
In:    serial@ff1a0000
Out:   serial@ff1a0000
Err:   serial@ff1a0000
Model: OrangePi boards based on Rockchip RK3399
rockchip_dnl_key_pressed: adc_channel_single_shot fail!
Net:   
Error: ethernet@fe300000 address not set.
eth-1: ethernet@fe300000
Hit any key to stop autoboot:  0 
=> 
=> mmc list
dwmmc@fe310000: 2
dwmmc@fe320000: 1
sdhci@fe330000: 0 (eMMC)
=> setenv devnum 1
=> run mmc_boot
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
Found U-Boot script /boot/boot.scr
2949 bytes read in 7 ms (411.1 KiB/s)
## Executing script at 00500000
Boot script loaded from mmc 1
188 bytes read in 6 ms (30.3 KiB/s)
5132109 bytes read in 353 ms (13.9 MiB/s)
14107136 bytes read in 956 ms (14.1 MiB/s)
75813 bytes read in 16 ms (4.5 MiB/s)
1847 bytes read in 9 ms (200.2 KiB/s)
Applying kernel provided DT fixup script (rockchip-fixup.scr)
## Executing script at 39000000
## Loading init Ramdisk from Legacy Image at 04000000 ...
   Image Name:   uInitrd
   Image Type:   AArch64 Linux RAMDisk Image (gzip compressed)
   Data Size:    5132045 Bytes = 4.9 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01f00000
   Booting using the fdt blob at 0x1f00000
   Loading Ramdisk to 7da41000, end 7df25f0d ... OK
   Loading Device Tree to 000000007d9c6000, end 000000007da40fff ... OK

Starting kernel ...

 

 

Self-made image build right now: http://ix.io/1Jer HDMI is operational.

SATA port is operating normally (when detected):

Samsung SSD 840 Pro 256 GB

                                                               random   random
              kB  reclen    write  rewrite    read    reread     read    write
          102400       4    22774    25859    25432    29342    13257    28937
          102400      16    87006    98004    90769    90676    30192    42623
          102400     512   267113   275145   262877   268858   267872   250340
          102400    1024   306113   319568   286351   290406   296207   289848
          102400   16384   313688   313882   287926   294911   296778   301239

 

P1130557.JPG

Link to comment
Share on other sites

Thanks a lot for this info! :thumbup:
You are right, with my test, I was using OrangePi's U-boot, not Armbian's! :mellow: The pads for the shorting are getting worn out, and I would like to get it to boot to the SDCARD with a softer method...

Are you using the +5V+12V connectors to power up your SATA disk? I don't get it... Aren't they supposed to be in, not out?
I'm still trying to figure out how to power my SSD...

For the time being, I'm stuck with the OrangePi Os (even if I rebuild it myself), as I need to have an HDMI-IN solution for the 3rd of July.
While I'm there, if I can bring anything from the OrangePi OS for Armbian, please let me know.

 

My goal would be to have one of these days this board with Armbian handling sound-in, sound-out, hdmi-in, IR, Ethernet, OV18350 and WIFI.

Link to comment
Share on other sites

8 hours ago, gounthar said:

For the time being, I'm stuck with the OrangePi Os (even if I rebuild it myself), as I need to have an HDMI-IN solution for the 3rd of July.
While I'm there, if I can bring anything from the OrangePi OS for Armbian, please let me know.


Most likely you should be able to boot OrangeOS from Armbian u-boot. Then you can skip flashing system to eMMC but boot from SD the same way as we boot Armbian from SD once new boot is on the eMMC. Sadly there seems like a lot of work (and we already struggle with regular maintenance) to merge yet another private fork into join rockchip64-default kernel.

 

7 hours ago, martinayotte said:

so it can switch them off by software.


Which is why sometimes just does't power on :)

Link to comment
Share on other sites

10 hours ago, martinayotte said:

No ! Look at the schematic ...

They are out and controlled by the SATA controller so it can switch them off by software.

 

 

My bad, that's very good news indeed! I had not read that part of the schematics, just read the documentation where it is noted

Quote

external power supply interface

I guessed (wrong) it was another way to power up the board...

 

@Igor: would you happen to have a link to buy the power connector you used (amazon, aliexpress, ...)?
Thanks!

Link to comment
Share on other sites

2 hours ago, gounthar said:

would you happen to have a link to buy the power connector you used (amazon, aliexpress, ...)?


It's from the Cubietruck :) but you need to reverse + and - on both connectors.

Link to comment
Share on other sites

I see, thanks. I already have a parent-size Molex Sata power connector, I "just" have to get two tiny weeny Molex connectors, and a little bit of solder I guess. ;)
I received today my test heatsink, let's hope it doesn't short anything...

image.thumb.png.8001b58e3c1012bd085e936042222680.png

Link to comment
Share on other sites

On 5/17/2019 at 10:40 AM, Igor said:


It's from the Cubietruck :) but you need to reverse + and - on both connectors.

As I will be using an SSD, I found this connector that will only give 5V.
And I still have to try that, I really have to figure out this Msata/pcie/m2 thingie...
IMG_20190405_155732.jpgIMG_20190405_155721.jpg

Link to comment
Share on other sites

52 minutes ago, martinayotte said:

This cable is really for SATA, not MSATA, they don't even have the same size ...


He probably meant why this (mSATA) drive is not working on mPCI ... while the connector is compatible.

Link to comment
Share on other sites

<rant-on>

Why in the hell do we have to use that stupid shortening trick to get a Linux image written on the eMMC? :angry:
Android images can be written under Windows by just using the recovery button (LOADER mode), why can't we do the same for Linux images (MASKROM)? <_<
As I wrote quite a few images on this board, the pads worn out, we soldered a pin to make it easier and more durable, which worked for a while...
It failed after some time, the testing pad just quit and I am now stuck with a useless board... until a colleague makes another better solder.
I know, this was bound to happen, a recipe for catastrophy, but, come on, two small testing pads!
I could have gone Armbian the whole way, and avoid that, but I did not know what I would loose with switching u-boot, as I need HDMI-IN, sound in, CSI camera and network.

I asked OrangePi if they could make another version with a switch or a jumper, and they answered they could modify if I order 2.000 boards, which I won't (and can't). :wacko:
</rant-on>

Link to comment
Share on other sites

Did anyone get HDMI-IN working on this board? I tried following these instructions in the mentioned post but rkcamsrc plugin is missing from the build,

 

I'm trying to use gstreamer to encode camera input from on-board HDMI-IN connector.  I'm getting the following errors when v4l2src plugin.

Link to comment
Share on other sites

2 hours ago, dimaxus said:

Good day to all.
Question to experts. How to change the resolution of the HDMI output in Armbian. Which file to make changes to: boot.cmd or armbianEnv.txt?
If you can a couple of specific examples.

1080p display
xrandr --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync &&  xrandr --addmode HDMI-1 1920x1080_60.00 && xrandr --output HDMI-1 --mode 1920x1080_60.00
720p display
xrandr --newmode "1280x720_60.00" 74.50 1280 1344 1472 1664 720 723 728 748 -hsync +vsync && xrandr --addmode HDMI-1 1280x720_60.00 && xrandr --output HDMI-1 --mode 1280x720_60.00
https://linuxconfig.org/how-to-configure-your-monitors-with-xrandr-in-linux

 

You can add the line to armbianEnv.txt if I remember well.

Link to comment
Share on other sites

"once you have Armbian booting from eMMC, you can boot SD card in more simple manner: stop booting from UART console and execute those commands: setenv devnum 1 followed by run mmc_boot"

Good day to all.
A question also to experts. And you can explain everything in more detail, in steps, for beginners. How to stop which keys to press, something I can’t do in any way.

Link to comment
Share on other sites

19 hours ago, dimaxus said:

Is it to press some key on the keyboard or close TP50265 and GND?

This depends which U-Boot is present on eMMC ...

If you never install Armbian, your U-Boot is probably the original one from factory, then you need to short TP50265.

After installing Armbian on eMMC once, you will then been able to stop U-Boot from keystroke.

Link to comment
Share on other sites

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