How to develop applications on 700 MHz (non-linux) core?

I’m interested in developing applications on the second (non-linux) core of MILK-V board. Could anybody tell me where to begin?

P.S. Please, answer in English only.

1 Like

Hi @sminder ,

I’ve only briefly looked at the milk-v setup, so definitely not an expert, but as far as I could gather the use of the second core is a little odd at the moment. The freertos application gets built as part of the linux image. See freertos/cvitek/task/comm/src/riscv64/comm_main.c in the duo-buildroot-sdk for the code that drives the example. Everything looks nice - particularly the abstraction of the mailbox for communication between the two cores, but the development process looks a little strange right now. I think it’s possible to just replace the freertos app in the existing image rather than having to write the entire sdcard from scratch, but I haven’t tried yet - waiting for the right project to come along for this board. It would be nice if in the future we could replace the running freertos app from the command line in the Linux core without rebooting the board, but maybe there are restrictions that make that impossible.

https://community.milkv.io/t/duo-firmware-v1-0-5-has-been-released-with-freertos-source-code/812/3

1 Like

I agree, it sounds ridiculous to build small-core application with a whole image.

Could you tell me where the binary FreeRTOS application is situated in a file system?

This post describes how fip.bin can be replaced to update the rtos app:

Wow, your description is absolutely amazing!
But I’ve got a little problem when I follow your example: I can’t find the file source milkv/boardconfig-milkv-duo.sh in SDK directory. Where did you get it?
I followed these instructions for build the image: https://milkv.io/docs/duo/getting-started/buildroot-sdk

@sminder I simply chose the one-click compilation option:

git clone https://github.com/milkv-duo/duo-buildroot-sdk.git --depth=1
cd duo-buildroot-sdk/
./build_milkv.sh

This last command automates building everything. You can read more in the README.md file here:

The bin-file which you burn onto a TF (microSD) card contains three partitions.
/boot is a FAT32 filesystem where system finds its Linux bootloader and FreeRTOS firmware.
/ is an Ext4 filesystem where rootfs for the beefier Linux-operated core lives.
The third one will be an empty partition.

Not only you can find it out when inspecting such an image yourself, but it is explicitly defined in milkv/genimage-milkv-duo.cfg:

image boot.vfat {
	vfat {
		label = "boot"
		files = {
			"fip.bin",
			"rawimages/boot.sd",
		}
	}
	size = 128M
}

image rootfs.ext4 {
	ext4 {
		label = "rootfs"
	}
	size = 768M
}

image milkv-duo.img {
	hdimage {
	}

	partition boot {
		partition-type = 0xC
		bootable = "true"
                image = "boot.vfat"
	}

	partition rootfs {
		partition-type = 0x83
		image = "rootfs.ext4"
	}

	partition empty {
		partition-type-uuid = 0657fd6d-a4ab-43c4-84e5-0933c84b4f4f
		size = 256M
	}
}

You asked where in the filesystem you can find the binary FreeRTOS application, and it is fip.bin.
You can find fip.bin both on /boot and in the folder duo-buildroot-sdk/install/soc_cv1800b_milkv_duo_sd/ after you compiled the FreeRTOS firmware.

Once you recompiled fip.bin, you can copy it to the /boot partition by powering off the board, mounting the SD FAT32 filesystem and replacing fip.bin on it; or you can do the same thing on the Milk-V board via SCP.

GL;HF

Thanks a lot for the suggestions. Now I know where to find sources for RTOS core, I know how to build application and I know where to put binary file.
So now I try to build my application for RTOS core. The first question after I had a look at the sources is where does RTOS core output “printf” to? I guess it doesn’t output into RNDIS connection.

I can’t verify it yet myself; but I guess it could send it to a UART interface.

Yes, it does write to UART.

1 Like

I found out it’s UART0 interface (pins 16-17 of Duo board).
There is an example log of starting my board

FSBL Jb28g9:ga33685bae-dirty:2023-12-29T21:40:01+03:00
st_on_reason=d0000
st_off_reason=800c0003
P2S/0x1000/0x3bc0da00.
SD/0xca00/0x1000/0x1000/0.P2E.
DPS/0xda00/0x2000.
SD/0xda00/0x2000/0x2000/0.DPE.
DDR init.
ddr_param[0]=0x78075562.
pkg_type=3
D3_1_4
DDR2-512M-QFN68
Data rate=1333.
DDR BIST PASS
PLLS.
PLLE.
C2S/0xfa00/0x83f40000/0x3600.
[R2TE:. 0/0x3600/0x3600/0.RSC.
.1M.S6/808x111330]0P0r/e0 xs8y0s0t0e0m0 0i0n/i0tx 1dbo0n0e0
RT: [1.694433]CVIRTOS Build Date:Dec 29 2023  (Time :21:40:01)
RT: [1.700436]Post system init done
RT: [1.703752]create cvi task
RT: [1.706578][cvi_spinlock_init] succeess
RT: [1.710472]prvCmdQuRunTask run
SD/0x13000/0x1b000/0x1b000/0.ME.
L2/0x2e000.
SD/0x2e000/0x200/0x200/0.L2/0x414d3342/0xcafe4625/0x80200000/0x1fa00/0x1fa00
COMP/1.
SD/0x2e000/0x1fa00/0x1fa00/0.DCP/0x80200020/0x1000000/0x81500020/0x1fa00/1.
DCP/0x42c05/0.
Loader_2nd loaded.
Use internal 32k
Jump to monitor at 0x80000000.
OPENSBI: next_addr=0x80200020 arg1=0x80080000
OpenSBI v0.9
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name             : Cvitek. CV180X ASIC. C906.
Platform Features         : mfdeleg
Platform HART Count       : 1
Platform IPI Device       : clint
Platform Timer Device     : clint
Platform Console Device   : uart8250
Platform HSM Device       : ---
Platform SysReset Device  : ---
Firmware Base             : 0x80000000
Firmware Size             : 132 KB
Runtime SBI Version       : 0.3

Domain0 Name              : root
Domain0 Boot HART         : 0
Domain0 HARTs             : 0*
Domain0 Region00          : 0x0000000074000000-0x000000007400ffff (I)
Domain0 Region01          : 0x0000000080000000-0x000000008003ffff ()
Domain0 Region02          : 0x0000000000000000-0xffffffffffffffff (R,W,X)
Domain0 Next Address      : 0x0000000080200020
Domain0 Next Arg1         : 0x0000000080080000
Domain0 Next Mode         : S-mode
Domain0 SysReset          : yes

Boot HART ID              : 0
Boot HART Domain          : root
Boot HART ISA             : rv64imafdcvsux
Boot HART Features        : scounteren,mcounteren,time
Boot HART PMP Count       : 16
Boot HART PMP Granularity : 4096
Boot HART PMP Address Bits: 38
Boot HART MHPM Count      : 8
Boot HART MHPM Count      : 8
Boot HART MIDELEG         : 0x0000000000000222
Boot HART MEDELEG         : 0x000000000000b109


U-Boot 2021.10 (Dec 29 2023 - 21:39:49 +0300)cvitek_cv180x

DRAM:  63.3 MiB
gd->relocaddr=0x82435000. offset=0x2235000
MMC:   cv-sd@4310000: 0
Loading Environment from <NULL>... OK
In:    serial
Out:   serial
Err:   serial
Net:
Warning: ethernet@4070000 (eth0) using random MAC address - 8e:a6:e2:4f:e4:0b
eth0: ethernet@4070000
Hit any key to stop autoboot:  0
Boot from SD ...
switch to partitions #0, OK
mmc0 is current device
2886892 bytes read in 155 ms (17.8 MiB/s)
## Loading kernel from FIT Image at 81400000 ...
   Using 'config-cv1800b_milkv_duo_sd' configuration
   Trying 'kernel-1' kernel subimage
   Verifying Hash Integrity ... crc32+ OK
## Loading fdt from FIT Image at 81400000 ...
   Using 'config-cv1800b_milkv_duo_sd' configuration
   Trying 'fdt-cv1800b_milkv_duo_sd' fdt subimage
   Verifying Hash Integrity ... sha256+ OK
   Booting using the fdt blob at 0x816bba84
   Uncompressing Kernel Image
   Decompressing 6437376 bytes used 1053ms
   Loading Device Tree to 0000000081be5000, end 0000000081becd04 ... OK

Starting kernel ...

[    0.000000] Linux version 5.10.4-tag- (user@user-virtual-machine) (riscv64-unknown-linux-musl-gcc (Xuantie-900 linux-5.10.4 musl gcc Toolchain V2.6.1 B-20220906) 10.2.0, GNU ld (GNU Binutils) 2.35) #1 PREEMPT Fri Dec 29 21:40:05 +03 2023
[    0.000000] earlycon: sbi0 at I/O port 0x0 (options '')
[    0.000000] printk: bootconsole [sbi0] enabled
[    0.000000] efi: UEFI not found.
[    0.000000] Ion: Ion memory setup at 0x0000000082473000 size 26 MiB
[    0.000000] OF: reserved mem: initialized node ion, compatible id ion-region
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000080000000-0x0000000083f3ffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080000000-0x0000000083f3ffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x0000000083f3ffff]
[    0.000000] On node 0 totalpages: 16192
[    0.000000]   DMA32 zone: 222 pages used for memmap
[    0.000000]   DMA32 zone: 0 pages reserved
[    0.000000]   DMA32 zone: 16192 pages, LIFO batch:3
[    0.000000] SBI specification v0.3 detected
[    0.000000] SBI implementation ID=0x1 Version=0x9
[    0.000000] SBI v0.2 TIME extension detected
[    0.000000] SBI v0.2 IPI extension detected
[    0.000000] SBI v0.2 RFENCE extension detected
[    0.000000] riscv: ISA extensions acdfimsuv
[    0.000000] riscv: ELF capabilities acdfimv
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 15970
[    0.000000] Kernel command line: root=/dev/mmcblk0p2 rootwait rw console=ttyS0,115200 earlycon=sbi riscv.fwsz=0x80000 loglevel=9
[    0.000000] Dentry cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.000000] Sorting __ex_table...
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 29040K/64768K available (3882K kernel code, 486K rwdata, 1704K rodata, 152K init, 210K bss, 35728K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000]  Trampoline variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] riscv-intc: 64 local interrupts mapped
[    0.000000] plic: interrupt-controller@70000000: mapped 101 interrupts with 1 handlers for 2 contexts.
[    0.000000] random: get_random_bytes called from start_kernel+0x2e0/0x41c with crng_init=0
[    0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0]
[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x5c40939b5, max_idle_ns: 440795202646 ns
[    0.000008] sched_clock: 64 bits at 25MHz, resolution 40ns, wraps every 4398046511100ns
[    0.008426] Calibrating delay loop (skipped), value calculated using timer frequency.. 50.00 BogoMIPS (lpj=100000)
[    0.019132] pid_max: default: 4096 minimum: 301
[    0.024038] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.031459] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.041062] ASID allocator initialised with 65536 entries
[    0.046774] rcu: Hierarchical SRCU implementation.
[    0.052141] EFI services will not be available.
[    0.057213] devtmpfs: initialized
[    0.065246] early_time_log: do_initcalls: 4931410us
[    0.070863] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.080916] futex hash table entries: 16 (order: -4, 384 bytes, linear)
[    0.087908] pinctrl core: initialized pinctrl subsystem
[    0.093810] NET: Registered protocol family 16
[    0.098846] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
[    0.106174] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.114996] thermal_sys: Registered thermal governor 'step_wise'
[    0.130318] OF: /gpio@03020000/gpio-controller@0: could not find phandle
[    0.143546] OF: /gpio@03021000/gpio-controller@1: could not find phandle
[    0.150536] OF: /gpio@03022000/gpio-controller@2: could not find phandle
[    0.157523] OF: /gpio@03023000/gpio-controller@3: could not find phandle
[    0.164507] OF: /gpio@05021000/gpio-controller@4: could not find phandle
[    0.173408] clk reset: nr_reset=64 resource_size=8
[    0.178969] get audio clk=24576000
[    0.182510] cvitek-i2s-subsys 4108000.i2s_subsys: Set clk_sdma_aud0~3 to 24576000
[    0.202252] dw_dmac 4330000.dma: CVITEK DMA Controller, 8 channels, probe done!
[    0.210781] SCSI subsystem initialized
[    0.215075] usbcore: registered new interface driver usbfs
[    0.220823] usbcore: registered new interface driver hub
[    0.226398] usbcore: registered new device driver usb
[    0.234992] Ion: ion_parse_dt_heap_common: id 0 type 2 name carveout align 1000
[    0.242874] Ion: rmem_ion_device_init: heap carveout base 0x0000000082473000 size 0x0000000001acd000 dev (____ptrval____)
[    0.254156] ion_carveout_heap_create, size=0x1acd000
[    0.259479] cvi_get_rtos_ion_size, rtos ion_size get:0x0
[    0.394811] platform carveout: [ion] add heap id 0, type 2, base 0x82473000, size 0x1acd000
[    0.403802] Advanced Linux Sound Architecture Driver Initialized.
[    0.411347] clocksource: Switched to clocksource riscv_clocksource
[    0.419857] NET: Registered protocol family 2
[    0.425526] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.434240] TCP established hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.442035] TCP bind hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.449304] TCP: Hash tables configured (established 512 bind 512)
[    0.455909] UDP hash table entries: 128 (order: 0, 4096 bytes, linear)
[    0.462677] UDP-Lite hash table entries: 128 (order: 0, 4096 bytes, linear)
[    0.470122] NET: Registered protocol family 1
[    0.475251] RPC: Registered named UNIX socket transport module.
[    0.481391] RPC: Registered udp transport module.
[    0.486251] RPC: Registered tcp transport module.
[    0.491173] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.500439] Initialise system trusted keyrings
[    0.505329] workingset: timestamp_bits=62 max_order=13 bucket_order=0
[    0.518188] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.525166] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[    0.532316] Key type asymmetric registered
[    0.536531] Asymmetric key parser 'x509' registered
[    0.547480] cvi_rtos_cmdqu_init
[    0.550895] cvi_rtos_cmdqu_probe start ---
[    0.555096] name=1900000.rtos_cmdqu
[    0.558958] res-reg: start: 0x1900000, end: 0x1900fff, virt-addr(ffffffd005c60000).
[    0.566863] RTOS_CMDQU_INIT
[    0.569772] mbox_reg=(____ptrval____)
[    0.573619] mbox_done_reg=(____ptrval____)
[    0.577920] mailbox_context=(____ptrval____)
[    0.582437] cvi_rtos_cmdqu_probe DONE
[    0.586398] cvi_rtos_cmdqu_init done
[    0.590064] [cvi_spinlock_init] success
[    0.594274] Serial: 8250/16550 driver, 5 ports, IRQ sharing disabled
[    0.602760] printk: console [ttyS0] disabled
[    0.607292] 4140000.serial: ttyS0 at MMIO 0x4140000 (irq = 15, base_baud = 1562500) is a 16550A
[    0.616416] printk: console [ttyS0] enabled
[    0.616416] printk: console [ttyS0] enabled
[    0.625019] printk: bootconsole [sbi0] disabled
[    0.625019] printk: bootconsole [sbi0] disabled
[    0.635267] 41c0000.serial: ttyS4 at MMIO 0x41c0000 (irq = 16, base_baud = 1562500) is a 16550A
[    0.647883] cvi-spif 10000000.cvi-spif: unrecognized JEDEC id bytes: 00 00 00 00 00 00
[    0.656141] cvi-spif 10000000.cvi-spif: device scan failed
[    0.661845] cvi-spif 10000000.cvi-spif: unable to setup flash chip
[    0.674699] libphy: Fixed MDIO Bus: probed
[    0.679624] bm-dwmac 4070000.ethernet: IRQ eth_wake_irq not found
[    0.685987] bm-dwmac 4070000.ethernet: IRQ eth_lpi not found
[    0.691976] bm-dwmac 4070000.ethernet: Hash table entries set to unexpected value 0
[    0.700056] bm-dwmac 4070000.ethernet: no reset control found
[    0.706282] bm-dwmac 4070000.ethernet: User ID: 0x10, Synopsys ID: 0x37
[    0.713204] bm-dwmac 4070000.ethernet:       DWMAC1000
[    0.718107] bm-dwmac 4070000.ethernet: DMA HW capability register supported
[    0.725333] bm-dwmac 4070000.ethernet: RX Checksum Offload Engine supported
[    0.732558] bm-dwmac 4070000.ethernet: COE Type 2
[    0.737451] bm-dwmac 4070000.ethernet: TX Checksum insertion supported
[    0.744228] bm-dwmac 4070000.ethernet: Normal descriptors
[    0.749839] bm-dwmac 4070000.ethernet: Ring mode enabled
[    0.755362] bm-dwmac 4070000.ethernet: Enable RX Mitigation via HW Watchdog Timer
[    0.763165] bm-dwmac 4070000.ethernet: device MAC address 8e:a6:e2:4f:e4:0b
[    0.797043] libphy: stmmac: probed
[    0.801906] bm-dwmac 4070000.ethernet: Cannot get clk_500m_eth!
[    0.808352] bm-dwmac 4070000.ethernet: Cannot get gate_clk_axi4!
[    0.815890] dwc2 4340000.usb: axi clk installed
[    0.820665] dwc2 4340000.usb: apb clk installed
[    0.825391] dwc2 4340000.usb: 125m clk installed
[    0.830204] dwc2 4340000.usb: 33k clk installed
[    0.834926] dwc2 4340000.usb: 12m clk installed
[    0.839739] dwc2 4340000.usb: EPs: 8, dedicated fifos, 3072 entries in SPRAM
[    0.847653] dwc2 4340000.usb: DWC OTG Controller
[    0.852529] dwc2 4340000.usb: new USB bus registered, assigned bus number 1
[    0.859803] dwc2 4340000.usb: irq 37, io mem 0x04340000
[    0.866156] hub 1-0:1.0: USB hub found
[    0.870182] hub 1-0:1.0: 1 port detected
[    0.875620] usbcore: registered new interface driver usb-storage
[    0.882263] i2c /dev entries driver
[    0.888047] sdhci: Secure Digital Host Controller Interface driver
[    0.894487] sdhci: Copyright(c) Pierre Ossman
[    0.899018] sdhci-pltfm: SDHCI platform and OF driver helper
[    0.905159] cvi:sdhci_cvi_probe
[    0.955364] mmc0: SDHCI controller on 4310000.cv-sd [4310000.cv-sd] using ADMA 64-bit
[    0.963534] cvi_proc_init cvi_host 0x(____ptrval____)
[    0.969518] usbcore: registered new interface driver usbhid
[    0.979377] usbhid: USB HID core driver
[    0.985200] cvitek-i2s 4100000.i2s: cvi_i2s_probe
[    0.995636] cvitek-i2s 4120000.i2s: cvi_i2s_probe
[    1.001103] cvitek-i2s 4130000.i2s: cvi_i2s_probe
[    1.006967] cviteka-adc sound_adc: cviteka_adc_probe, dev name=sound_adc
[    1.019413] cviteka-adc sound_adc: cviteka_adc_probe start devm_snd_soc_register_card
[    1.028007] cvitekaadc 300a100.adc: cvitekaadc_probe
[    1.034125] cviteka-dac sound_dac: cviteka_dac_probe, dev name=sound_dac
[    1.041599] cvitekadac 300a000.dac: cvitekadac_probe
[    1.047056] cvitekadac_probe gpio_is_valid mute_pin_l
[    1.053706] NET: Registered protocol family 10
[    1.060224] Segment Routing with IPv6
[    1.064292] NET: Registered protocol family 17
[    1.069243] Loading compiled-in X.509 certificates
[    1.103456] mmc0: new high speed SDHC card at address b368
[    1.114007] cviteka-adc sound_adc: cviteka_adc_probe, dev name=sound_adc
[    1.121531] mmcblk0: mmc0:b368 SD16G 14.7 GiB
[    1.126217] cviteka-adc sound_adc: cviteka_adc_probe start devm_snd_soc_register_card
[    1.137740]  mmcblk0: p1 p2 p3
[    1.146831] cviteka-dac sound_dac: cviteka_dac_probe, dev name=sound_dac
[    1.159998] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    1.170855] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    1.177989] cfg80211: failed to load regulatory.db
[    1.183177] ALSA device list:
[    1.186708] dw-apb-uart 4140000.serial: forbid DMA for kernel console
[    1.225421] random: fast init done
[   48.967460] EXT4-fs (mmcblk0p2): recovery complete
[   49.366243] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[   49.374727] VFS: Mounted root (ext4 filesystem) on device 179:2.
[   49.381688] devtmpfs: mounted
[   49.384988] Freeing unused kernel memory: 152K
[   49.389623] Kernel memory protection not selected by kernel config.
[   49.396144] Run /sbin/init as init process
[   49.400451]   with arguments:
[   49.403556]     /sbin/init
[   49.406357]   with environment:
[   49.409629]     HOME=/
[   49.412097]     TERM=linux
[   49.414898] early_time_log: run_init_process: 54281074us
[   49.473587] EXT4-fs (mmcblk0p2): re-mounted. Opts: errors=remount-ro
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Initializing random number generator: OK
Saving random seed: [   49.625424] random: dd: uninitialized urandom read (512 bytes read)
OK
Starting network: OK
Starting dhcpcd...
dhcpcd-9.4.0 starting
[   50.309631] random: dhcpcd: uninitialized urandom read (112 bytes read)
DUID 00:01:00:01:c7:92:bc:82:2e:5a:75:72:75:d8
dhcp_vendor: Invalid argument
forked to background, child pid 131
Bad system call
[   50.394481] bm-dwmac 4070000.ethernet eth0: PHY [stmmac-0:00] driver [Generic PHY] (irq=POLL)
Starting ntpd: [   50.419412] dwmac1000: Master AXI performs any burst length
[   50.426463] bm-dwmac 4070000.ethernet eth0: No Safety Features support found
[   50.436179] bm-dwmac 4070000.ethernet eth0: IEEE 1588-2002 Timestamp supported
[   50.444964] bm-dwmac 4070000.ethernet eth0: configuring for phy/rmii link mode
OK
Starting dropbear sshd: OK
Starting dnsmasq: [   50.581473] random: dnsmasq: uninitialized urandom read (128 bytes read)
OK
init mpp system...
[   50.614625] cv180x_sys: bad vermagic: kernel tainted.
[   50.619941] Disabling lock debugging due to kernel taint
[   50.625864] cv180x_sys: loading out-of-tree module taints kernel.
[   50.649903] res-reg: start: 0xa0c8000, end: 0xa0c801f, virt-addr(ffffffd0040cd000).
[   50.658349] CVITEK CHIP ID = 22
[   50.673801] cif a0c2000.cif: cam0 clk installed
[   50.678614] cif a0c2000.cif: cam1 clk installed
[   50.683807] cif a0c2000.cif: vip_sys_2 clk installed
[   50.689275] cif a0c2000.cif: clk_mipimpll clk installed (____ptrval____)
[   50.696515] cif a0c2000.cif: clk_disppll clk installed (____ptrval____)
[   50.703666] cif a0c2000.cif: clk_fpll clk installed (____ptrval____)
[   50.710543] cif a0c2000.cif: (0) res-reg: start: 0xa0c2000, end: 0xa0c3fff.
[   50.718026] cif a0c2000.cif:  virt-addr((____ptrval____))
[   50.723909] cif a0c2000.cif: (1) res-reg: start: 0xa0d0000, end: 0xa0d0fff.
[   50.731434] cif a0c2000.cif:  virt-addr((____ptrval____))
[   50.737315] cif a0c2000.cif: (2) res-reg: start: 0xa0c4000, end: 0xa0c5fff.
[   50.744799] cif a0c2000.cif:  virt-addr((____ptrval____))
[   50.750683] cif a0c2000.cif: (3) res-reg: start: 0x3001c30, end: 0x3001c5f.
[   50.758166] cif a0c2000.cif:  virt-addr((____ptrval____))
[   50.764034] cif a0c2000.cif: no pad_ctrl for cif
[   50.769172] cif a0c2000.cif: request irq-27 as cif-irq0
[   50.774946] cif a0c2000.cif: request irq-28 as cif-irq1
[   50.780693] cif a0c2000.cif: rst_pin = 424, pol = 1
[   50.791991] snsr_i2c snsr_i2c: i2c:-------hook 0
[   50.797060] snsr_i2c snsr_i2c: i2c:-------hook 1
[   50.802441] snsr_i2c snsr_i2c: i2c:-------hook 2
[   50.807703] snsr_i2c snsr_i2c: i2c:-------hook 3
[   50.812907] snsr_i2c snsr_i2c: i2c:-------hook 4
[   50.861203] vi_core_probe:203(): res-reg: start: 0xa000000, end: 0xa07ffff, virt-addr(ffffffd004380000).
[   50.871116] vi_core_probe:216(): irq(29) for isp get from platform driver.
[   50.879176] vi_tuning_buf_setup:253(): tuning fe_addr[0]=0x8181f490, be_addr[0]=0x81817290, post_addr[0]=0x81800000
[   50.890400] vi_tuning_buf_setup:253(): tuning fe_addr[1]=0x817df490, be_addr[1]=0x817d7290, post_addr[1]=0x817c0000
[   50.901572] vi_tuning_buf_setup:253(): tuning fe_addr[2]=0x817ff490, be_addr[2]=0x817f7290, post_addr[2]=0x817e0000
[   50.912683] sync_task_init:177(): sync_task_init vi_pipe 0
[   50.918645] sync_task_init:177(): sync_task_init vi_pipe 1
[   50.924596] sync_task_init:177(): sync_task_init vi_pipe 2
[   50.931012] vi_core_probe:252(): isp registered as cvi-vi
[   50.984998] cvi_dwa_probe:487(): done with rc(0).
[   51.012990] cv180x-cooling cv180x_cooling: elems of dev-freqs=6
[   51.019330] cv180x-cooling cv180x_cooling: dev_freqs[0]: 850000000 500000000
[   51.027198] cv180x-cooling cv180x_cooling: dev_freqs[1]: 425000000 375000000
[   51.034814] cv180x-cooling cv180x_cooling: dev_freqs[2]: 425000000 300000000
[   51.042504] cv180x-cooling cv180x_cooling: Cooling device registered: cv180x_cooling
[   51.076753] jpu ctrl reg pa = 0xb030000, va = (____ptrval____), size = 256
[   51.084433] end jpu_init result = 0x0
[   51.199502] cvi_vc_drv_init result = 0x0
[   51.214695] sh (167): drop_caches: 3
Starting app...

[root@milkv-duo]~# cd /root/
[root@milkv-duo]~# ./mailbox_test
RT: [96.219492]prvQueueISR
RT: [96.221839]recv cmd(19) from C906B, param_ptr [0x00000002]
RT: [96.227570]recv cmd(19) from C906B...send [0x00000004] to C906B
C906B: cmd.param_ptr = 0x4
RT: [100.234548]prvQueueISR
RT: [100.236982]recv cmd(19) from C906B, param_ptr [0x00000003]
RT: [100.242804]recv cmd(19) from C906B...send [0x00000004] to C906B
C906B: cmd.param_ptr = 0x3
[root@milkv-duo]~#

Also I built an example application called “mailbox_test” and you can see the mix output of the application and RTOS-core (messages with RT prefix) on UART0.

Actually I didn’t understand in which moment the RTOS core is started? I wonder if it started by uboot?