uConsole - R-01 and RISC-V thread

just got the R-01 in the mail - we have snow on the ground so this is a good project - from other threads there have been issues with the keyboard - I think it works great for thumb typing - nice unit - working on some network tools etc on it - will be a great console and good for jotting notes. thanks for the notes on this thread!

1 Like

The Allwinner D1 doesnā€™t have cpufreq support, but the clock controller is very easy to poke at, and thereā€™s loads of overclocking headroom (at least on my machine):

use this at your own risk, you are directly poking SOC CCU registers! this should all reset back to safe defaults on a reboot, but it may be possible to cause hardware damage with this(!). the user manual wants you to switch the CPU clock to something that isnā€™t the PLL before modifying PLL settings (3.2.4.1), but I havenā€™t seen this crash yet (with reasonable overclocks). At your own risk!

see the Allwinner D1 user manual for the background.

to set the PLL multiplier for CPU domain, poke PLL_CPU_CTRL_REG-

busybox devmem 0x02001000 32 0xFA00XX00 (where XX is your multiplier value (N) - 1, in hex)

to set for DDR domain, poke PLL_CPU_CTRL_REG: busybox devmem 0x02001010 32 0xF800XX00 (where XX is your multiplier value (N) - 1, in hex).

the actual clock frequency for each domain is (24MHz * N). stock values are CPU N=0x30, DDR N=0x42. On my uConsole, I can overclock with reasonable stability to CPU N=0x46 (1700MHz CPU clock!), DDR N=0x61 (2328MHz)

This improves CPU performance by more than 50%, according to my benchmarks. (there may be even more room if youā€™re brave enough to increase voltagesā€¦ which is also fairly easy to do but is even more likely to cause hardware damage so iā€™m not going to give instructions for it here). Naturally, it will increase power consumption.

3 Likes

Did anyone try or researched osdev with R-01? So no linux, no nothing, just straight up bare metal?

Hi, I tried bare metal in R-01 and unfortunately, it was a complete fiasco, I would be very grateful if someone who succeeded could share the results.
Alwinner has a big Chinese community but I canā€™t find anything about the problem I tried to solve.

So what I personally have - yes is possible to boot Allwinner D1 by SPL and work with UART and GPIO absolutely fine (example projects like baremetal-lichee-rv or d1-nezha-baremeta), but if you want something more serious is almost not possible. In my case, I want to operate with a ClockworkPi Devterm display :joy:!

Display controlled by MIPI DSI interface in Allwinner documentation nothing about this, and no any open HAL or library.
Only what I found are drivers in the Linux kernel and look like the same drivers but adopted for RT-thread OS. Driver is a thousand lines of code mixed for all Allwinner platforms and with my programming experience is impossible to adapt to bare metal, wonder if someone can do this.
I tried to build a project only with these drivers and cut everything from OS specific, as a result, is compiled great, UART and GPIO work, but the Display is still black, why ? I donā€™t know.
Debugging is another headache to be solved.
I donā€™t want to upset you but I am disappointed and thinking of throwing D1 in the trash and buying some ARM.

I would be very grateful if someone could share the project where they managed to assemble the RT-thread for D1 with Sunxi HAL, I have a compilation error now.

4 Likes

any idea whereā€™s the normal blinking cursor at?

jesus christ, this hit the spot!

1 Like

A generic update ( sorry for my radio silence all, hella busy on this end ). The RISC-V / R-01 unit got me deep into ā€˜i3ā€™, by following rabbit holes with the display, the back-light, and not seeing the cursorā€¦ Deep into i3 enough that Debian + i3 are my daily driver at work.

That being said I wanted to add to this thread @katmai 's amazing thread and notes.

If youā€™ve put effort in on the R-01 @katmai has some great sd card is imaged ā†’ usable uConsole notes, add to em if you have the notes or configs to spare!

sudo dd if=image.card of=/dev/mmcblk0 bs=512
62333952+0 records in
62333952+0 records out
31914983424 bytes (32 GB, 30 GiB) copied, 6665.29 s, 4.8 MB/s

took only a million fucking years to write

wget https://www.bioget.com/image.card
dd if=image.card of=/dev/mmcblk0 bs=512

Hi, post with my img ready-to-run ubuntu 22.04

OS for R-01 RISC V board (UCONSOLE & DEVTERM) - uConsole - clockworkpi

1 Like

Just a heads up, iā€™ve made the code available for getting a cleaner terminal/console experience. This is intended to use with a freshly flashed R01 DevTem.
Highlights:

  • Added fan control.
  • Temp control.
  • Bigger font.
  • Less ape on disabling services.
  • Ability to wind back to how it all was.
  • Snappier.

Code available here:

1 Like

hey, all. just got my r01 in the mail the other day, neat little device. iā€™m one of those people who intends to try and replace their phone with the r01, since i donā€™t really use my phone as a phone - just a crappy linux box in my pocket. iā€™m not a fan of the default image though, so i want to try and port KISS Linux (https://kisscommunity.bvnf.space/) to the r01. itā€™s a musl and busybox-based system oriented towards minimal overhead and posix compliance so it should be much smoother than the stock system given the SoMā€™s limited capabilities.

that being said, iā€™ve only ever tinkered with this sort of stuff in the x86 world - never RISC-V, or even ARM. i was using CLFS as a guide, but then started looking for source code and tools and heard that there are violations of the GPL wrt: distribution being locked behind an NDA or something. i did see @PotatoMania mention their github, and i grabbed the kernel w/ bsp, but the toolchain appears to only be available as a binary there - a problem, because my main system uses an aarch64 CPU.

would someone with experience be able to clarify if a standard cross toolchain is applicable here?

also, unrelated, is there a centralized community space for work on the r01? obviously the r01 tag exists here, but i a) donā€™t particularly love the interface and b) thereā€™s still lots of cross-talk from the cm4 people. is there an irc or git presence controlled by community members?

thanks a ton. looking forward to working with everyone to get the ball rolling. :muscle::muscle::muscle:

Hi, @midfavila I believe this toolchain can be suitable for your task GitHub - riscv-collab/riscv-gnu-toolchain: GNU toolchain for RISC-V, including GCC. Also, this article in general, is very helpful Building boot software and Debian from sources for a RISC-V board (Sipeed Lichee RV with D1 processor) - Andreas' website and this Allwinner Nezha - linux-sunxi.org.
About centralized community, I donā€™t know but it is a great idea

@ylyamin thanks a ton for the pointers, iā€™ll review them over the next few days along with the other stuff iā€™ve grabbed. if thereā€™s sufficient interest iā€™m sure we could register some officially unofficial channels for uconsole talk on libera.chat - i know that thereā€™s a discord, but i think itā€™s unusual to lock talk about open source hardware and software behind a closed system (even moreso considering that outside of libpurple i donā€™t know of any way to effectively use discord on the r01ā€¦).