[Solved] Asus TB S

This is for any ARMv7 device that we do not officially support.

Re: Asus TB S

Postby summers » Tue Aug 07, 2018 4:43 pm

Usually in arm arch I think its the device tree that enables things like UARTs. e.g in https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/rk3288-tinker.dts the text:
$this->bbcode_second_pass_code('', '&uart0 {
status = "okay";
};

&uart1 {
status = "okay";
};

&uart2 {
status = "okay";
};

&uart3 {
status = "okay";
};

&uart4 {
status = "okay";
};')
Is enabling all 4 uarts that are defined in https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/rk3288.dtsi
Only one pwm is enabled
$this->bbcode_second_pass_code('', '&pwm0 {
status = "okay";
};')
So will need to check in the rk3288 data sheet which pins that is connected to. Just checked. its pwm2 and pwm3 that use pins H28 and J25 that uart2 is on. pwm0 uses pin H22, so shouldn't clash with uart2.

Oh yes, I checked that the same uart is used in uboot and the device tree, for both they use the uart at 0xff690000 which is uart2. u-boot won't use the pwm ...
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Asus TB S

Postby TheSaint » Wed Aug 08, 2018 4:22 am

So they arrange a messy setup :)
They (Tinker staff) tell to monitor on UART2, in case of debugging, but in facts they didn't set it to work, because that is off and the pwm2 is on. Just because they like to show off the SBC capabilities, IMHO.
Anyway I understood which way is working and perhaps I route the debug to UART4.

Yesterday, impatiently,I've made this small setup. For the TX is good, but for RX isn't able to detect the level change, this from the converter side. I realized that isn't 3.3V compatible, as it was advertised. I'll wait the new one.
TheSaint
 
Posts: 346
Joined: Mon Jul 23, 2018 7:57 am

Re: Asus TB S

Postby summers » Wed Aug 08, 2018 8:36 am

Problem with diverting the output to UART4 is that there are several things which will access the uart:
1) the kernel
2) u-boot
3) the boot rom

Now 1) we can redirect with the kernel line "console=..." so its easy, but we can access the kernel messages with "dmesg" anyway, as long as we can boot into an operational system.

For u-boot, the output is set in the config file "CONFIG_DEBUG_UART_BASE=0xff690000" so thats the memory location for uart2. So to change that, we would need to recompile u-boot, and flash it to the disk in the right place. Now we aren't yet sure on how to do that. So thats a difficulty.

For the boot rom, its rom - and its done by rock chip. So we neither see the code, nor have the ability to change it.

So what I'd conclude, is that we are stuck with uart2.

Now sideline onto overlays, I can see from your config that tinker does overlays. I've only come across them with the beagle bone set up (You could see overalys done in the boot.txt I posted for the BBB). Now in the beagle world, overlays used to be done in userland via the kernel. That never used to work well, e.g. if you remove the hdmi from a running operating system, then things tend to complain. So where the beagle world went is via doing overlays by device tree modification in u-boot. The beagle people did this by forking u-boot, and adding a whole lot of code to it to do the overlays. Its not how mainline u-boot does it - that has to be via "ftd apply" which I posted above.

Now what does the tinkerboard do, obvious the tinkerOS does overlays. How though, I don't know. Probably either in kernel, or in an fork of u-boot. Can't say I like either. Anyway yes however you can disable pwm 2 and pwm3. has to be a good idea, as it will mess with uart2. You should also check "dmesg" to see if uart2 comes up ok.

Onto u-boot env variables. They are a bit odd, in mainline u-boot they are set via the "CONFiG_ENV" options e.g. "CONFIG_ENV_IS_IN_MMC=y" says save the env to the MMC. Now usually you would configure where to save with "CONFIG_ENV_OFFSET=" - mainline doesn't do that, which means it would save the env variable to the beginning of the MMC, That is bad I think, its where the partition information is, so writing there would trash the partition table. On the tinkerOS, I searched the image for the env variables - and haven't managed to find them yet. Hence I conclude that the set up on mainline u-boot is slightly broken - which is what the doc says. Also that whats in tinker-OS must have been modified. How we don't know.

Finally on your mod. Not a great way to use a difference voltage device, as it depends on the internal resistance of the uart device. If they are high impedance, then the external resistors won't make a difference. However what the external resistors will do, is to current limit what flows in the wires. Hopefully that should stop anything burning out. Me, I'd probably wait for the 3.3V uart to arrive ...
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Asus TB S

Postby TheSaint » Wed Aug 08, 2018 5:31 pm

So we are in a lot of unknown tricks that the Tinker staffs might have done.
The whole bunch seems to be at https://github.com/TinkerBoard/debian_kernel.
$this->bbcode_second_pass_quote('summers', 'b')ut we can access the kernel messages with "dmesg" anyway

You got it ;) . But the difference is when the kernel won't start and the console will tell the story. And that could be the point it we want to see what Arch kernel doing during boot time ;)
$this->bbcode_second_pass_quote('summers', 'F')or the boot rom, its rom
.
I doubt it is. I rather presume that is a flash, like many MCU have (e.g Arduino). Also I read that TB allows a fastboot, which is probably the way that the first boot stage is written inside the MCU.I hardly guess how much flash there could be, but it might be some 256 Kbytes, at least.
$this->bbcode_second_pass_quote('summers', 'w')e are stuck with uart2.

Not completely, when I disable pwm2, the UART2 is accessible.

$this->bbcode_second_pass_quote('summers', 'H')opefully that should stop anything burning out

Fortunately I didn't damage it, so the resistor are a safeguard against the odd. I received the new converter, with a big disappointment. It does the same like the other. Just the voltage is for 3.3 Volts. But the sensibility is bad. It works just if i cross RX with TX. And that TB doing the same.
I even try to put 1 KOhm resistor between RX and TX, for the converter alone, then it works. That means even with few mA there's no issue, but if I connect to TB, doesn't give anything in both communication directions :(
Should I put an buffer ?
TheSaint
 
Posts: 346
Joined: Mon Jul 23, 2018 7:57 am
Top

Re: Asus TB S

Postby summers » Wed Aug 08, 2018 9:30 pm

Yes i'm running short of ideas.

With uart2 don't forget to disable both pwm2 AND pwm3, one is on TX and one RX ....

The boot rom is probably on the cpu chip, newer arms - especially those with secure set ups, seem to do that. Even my old TI am335x (used on beagle) does that - its rom scans the first partition for an file called MLO which u-boot spl.

What I expect though, is as long as its not secure, once we understand the boot rom, we could come up with a fairly standard u-boot set up for bringing up arm. What makes it hard is that all other rock chip devices are chromebooks, and they have their own set of hassles.

It may be worth contacting Simon Glass, he's the uboot rock chip maintainer - so he'll probably know as much as anyone.
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Asus TB S

Postby TheSaint » Thu Aug 09, 2018 6:13 am

OK friend, you've done great efforts for me and the community, I won't forget it. So you may have a bit of rest ;) then I'll try to find newer details and report it here.

EDIT

I got the converter working, but I don't even imaging what could be the way that made it work. Perhaps an oversight.

So I tried a multiboot option in the extlinux.conf$this->bbcode_second_pass_code('', '$ cat /boot/extlinux/extlinux.conf
PROMPT 1
DEFAULT Alarm
SAY Select the kernel to boot within 10 seconds
TIMEOUT 100

LABEL Alarm
LINUX /zImage.bak
fdt /dtbs/rk3288-tinker.dtb
initrd initramfs-linux.img
console ttyS1,115200n8
append earlyprintk quiet console=tty1 rw root=LABEL=TB-SD-root

LABEL kernel-4.4
kernel /vmlinuz
fdt /rk3288-miniarm.dtb
append earlyprintk quiet splash plymouth.ignore-serial-consoles console=tty1 console=ttyS1,115200')
but the new entry is ignored and there's no messages coming on the serial port (of course, that's kernel business). I will study the option on u-boot, to see whether the extlinux.conf is hacked away.
So from the console over ttyS1 I have some different report that is written from dmesg itself$this->bbcode_second_pass_code('', '[ 0.000000] L2C: failed to init: -19
[ 0.000000] rockchip_clk_register_branches: unknown clock type 9
[ 2.174753] mali ffa30000.gpu: Failed to get regulator
[ 2.180454] mali ffa30000.gpu: Power control initialization failed
[ 2.206401] rk_gmac-dwmac ff290000.ethernet: phy regulator is not available yet, deferred probing
[ 2.837376] tinker-mcu: send_cmds: send command failed, ret = -6
[ 2.844077] tinker-mcu: tinker_mcu_probe: init_cmd_check failed, -6
[ 3.443485] tinker-ft5406: tinker_ft5406_probe: wait connected timeout
[ 3.469393] cpu cpu0: Failed to get cpu_reg
[ 3.474286] cpufreq-dt cpufreq-dt: failed register driver: -17
[ 3.628781] rockchip-vop ff940000.vop: invalid resource
[ 3.635454] rockchip-vop ff930000.vop: invalid resource
[ 3.642772] i2c i2c-6: of_i2c: modalias failure on /hdmi@ff980000/ports
[ 5.898054] cif_isp10_pltfrm_dev_init(1224) ERR: could not get default pinstate
[ 5.935921] ov7750.ov_camera_module_write_config(182) ERR: no active sensor configuration
[ 5.944863] ov7750.ov_camera_module_write_config(233) ERR: failed with error -14
[ 5.953460] ov7750.pltfrm_camera_module_read_reg(996) ERR: i2c read from offset 0x0000300a failed with error -6
[ 5.964861] ov7750.pltfrm_camera_module_read_reg(996) ERR: i2c read from offset 0x0000300b failed with error -6
[ 5.976121] ov7750.ov7750_check_camera_id(571) ERR: register read failed, camera module powered off?
[ 5.986311] ov7750.ov7750_check_camera_id(589) ERR: failed with error (-6)
[ 5.994002] ov7750.ov_camera_module_attach(256) ERR: failed with error -6
[ 6.001610] cif_isp10_img_src_v4l2_i2c_subdev_to_img_src(59) ERR: failed with error -6
[ 6.010448] cif_isp10_img_src_to_img_src(70) ERR: to_img_src failed!
[ 6.017537] cif_isp10_img_src_to_img_src(78) ERR: failed with error -14
[ 6.050629] imx219.pltfrm_camera_module_read_reg(996) ERR: i2c read from offset 0x00000000 failed with error -6
[ 6.062021] imx219.pltfrm_camera_module_read_reg(996) ERR: i2c read from offset 0x00000001 failed with error -6
[ 6.073270] imx219.imx219_check_camera_id(759) ERR: register read failed, camera module powered off?
[ 6.083457] imx219.imx219_check_camera_id(776) ERR: failed with error (-6)
[ 6.091133] imx219.imx_camera_module_attach(236) ERR: failed with error -6
[ 6.098832] cif_isp10_img_src_v4l2_i2c_subdev_to_img_src(59) ERR: failed with error -6
[ 6.107665] cif_isp10_img_src_to_img_src(70) ERR: to_img_src failed!
[ 6.114748] cif_isp10_img_src_to_img_src(78) ERR: failed with error -14
[ 6.122116] cif_isp10_img_srcs_init(1099) ERR: failed with error -14
[ 6.129200] cif_isp10_create(5772) ERR: cif_isp10_img_srcs_init failed
[ 6.136476] cif_isp10_create(5808) ERR: failed with error -14
[ 6.163977] devfreq ffa30000.gpu: Couldn't update frequency transition information.
[ 7.235080] asoc-simple-card sound-simple-card: call_usermodehelper fail, ret=-2, status=0
[ 7.245674] asoc-simple-card sound-simple-card: ASoC: DAPM unknown pin Headphones
[ 7.274272] /testcase-data/phandle-tests/consumer-a: could not get #phandle-cells-missing for /testcase-data/phandle-tests/provider1
[ 7.288029] /testcase-data/phandle-tests/consumer-a: could not get #phandle-cells-missing for /testcase-data/phandle-tests/provider1
[ 7.301807] /testcase-data/phandle-tests/consumer-a: could not find phandle
[ 7.309900] /testcase-data/phandle-tests/consumer-a: could not find phandle
[ 7.317953] /testcase-data/phandle-tests/consumer-a: arguments longer than property
[ 7.326795] /testcase-data/phandle-tests/consumer-a: arguments longer than property
[ 7.347437] overlay_is_topmost: #5 clashes #6 @/testcase-data/overlay-node/test-bus/test-unittest8
[ 7.360955] overlay_removal_is_ok: overlay #5 is not topmost
[ 7.370785] of_overlay_destroy: removal check failed for overlay #5
[ 7.396300] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
[ 7.409477] EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities
[ 7.413608] asoc-simple-card sound-simple-card: call_usermodehelper fail, ret=-2, status=0
[ 7.413615] asoc-simple-card sound-simple-card: ASoC: DAPM unknown pin Headphones
[ 7.799205] cgroup: cgroup2: unknown option "nsdelegate"')
$this->bbcode_second_pass_quote('summers', 'c')ontact Simon Glass

Forgive my ignorance, but I did look for hes contact, but unsuccessfully.
TheSaint
 
Posts: 346
Joined: Mon Jul 23, 2018 7:57 am
Top

Re: Asus TB S

Postby summers » Thu Aug 09, 2018 8:49 am

Simon's contact detail is on: http://git.denx.de/?p=u-boot.git;a=blob;f=MAINTAINERS he also wrote the first README.rockchip, so he understands the rock chip boot process.

With the "console=" line you just grab the kernel output (and looks like you also miss the early stages when the kernel is coming up). For us more interesting is what the boot rom, and u-boot write. Also you'll be able to interrupt u-boot, and see how its configured. Alas u-boot (and probably boot rom) only write on tty2 ...

My own gut feeling is that the extlinux (uboot-distro) is a side line, its something u-boot does to make OS distributors happy - but it isn't the main way of doing u-boot, and that will probably be more flexible.

Anyway good that the cable is working, means you know that bit is good, and so only need to dig into whats going wrong with tty2 ...
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Asus TB S

Postby TheSaint » Thu Aug 09, 2018 5:55 pm

$this->bbcode_second_pass_quote('summers', 'a')nd looks like you also miss the early stages when the kernel is coming up

Well I don't know yet how I can get hands on that. The ttyS2 is available only if declared on the kernel command line. As you mentioned, it was supposed that is compiled in, then I tried without that option. But it's working only if declared.

I'll try to understand how to add debugging to the kernel.
TheSaint
 
Posts: 346
Joined: Mon Jul 23, 2018 7:57 am
Top

Re: Asus TB S

Postby summers » Thu Aug 09, 2018 7:34 pm

You could try the "earlycon=" kernel option.

The boot-rom and u-boot will set up their own connection to tty2 though (well u-boot goes to tty2, its just a guess that the boot-rom does).

Oh yes, should have said the default device tree has a chosen node that IIRC sets up tty2 as the console. Think that may be set up from the start ...
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Asus TB S

Postby TheSaint » Fri Aug 10, 2018 1:15 pm

So having enabled verbosity for the kernel command line, but I can't have interactivity. I can see just the usual reports, like dmesg, but I can start only when it prompts for the login :(
I've to fix some strange console behavior, the last line goes overlapping the previous,
I need some time to study the boot......
TheSaint
 
Posts: 346
Joined: Mon Jul 23, 2018 7:57 am

PreviousNext

Return to Community Supported

Who is online

Users browsing this forum: No registered users and 7 guests