In the previous article, I described how I gained access to Linux inside the Carlinkit U2W Mini, modified its firmware, and enabled ADB.
The next challenge was to run my own software on the device.
Initially, Carlinkit served as an MFi authentication device for CaRaBack running on a Raspberry Pi. However, gaining access to its Linux system opened up the possibility of moving the entire backend directly onto the Allwinner V851.
The first step was to prepare a development environment and verify that I could run my own C++ programs on this platform.
The First Hello World
I developed the software on Windows, using WSL as the Linux environment for compilation.
Since the Allwinner V851 uses an ARM architecture, a regular x86-64 compiler was not suitable. I needed to find an appropriate cross-compilation toolchain.
After configuring the compiler, I built a simple program:
#include <iostream>
int main()
{
std::cout << "Hello World!" << std::endl;
return 0;
}
I transferred the resulting executable to Carlinkit using ADB:
adb push hello /tmp/hello
adb shell chmod +x /tmp/hello
adb shell /tmp/hello
The output was:
Hello World!
This was the first custom executable I successfully ran on the V851.
With that working, I could move beyond firmware experiments and start developing software specifically for the device.
Testing I²C and MFi
The next step was to test the built-in MFi chip.
CaRaBack already had two separate classes:
I2cTransport— responsible for communication over I²C.MfiAuth— responsible for reading the certificate and performing MFi authentication.
This separation proved useful when moving to the new platform.
The I²C device path and MFi chip address were supplied through configuration, so the class implementations did not need to be modified.
For the initial tests, I wrote a small main() function that read a register from the MFi chip and checked the returned value.
I compiled the program in WSL, transferred it to Carlinkit using ADB, and ran it directly on the V851.
The response matched the expected value.
This confirmed that the built-in MFi chip was accessible from Linux and that the existing CaRaBack code worked on the new platform.
Later, MFi initialization in the main application looked like this:
I2cTransport i2c(
config.mfiI2cDevice,
config.mfiI2cAddress
);
if (!i2c.open())
{
log_e("Failed to open MFi I2C");
return 1;
}
MfiAuth mfiAuth(i2c);
This code shows that the application is not tied to a particular I²C bus number.
Moving from Raspberry Pi to V851 only required changing the device path in the configuration.
Setting Up the Development Environment
I compiled and ran the first test programs manually. That was sufficient for Hello World, but it would quickly become inconvenient when working on the complete CaRaBack application.
The next step was therefore to configure an IDE and a build system.
Compilation still took place in WSL using the cross-compiler, but I could now start the build directly from the development environment.
I used CMake for the project.
A shortened version of the CaRaBack configuration looks like this:
cmake_minimum_required(VERSION 3.16)
project(CaRaBack VERSION 0.1.0 LANGUAGES CXX)
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp"
)
add_executable(CaRaBack ${SOURCES})
target_compile_features(CaRaBack PRIVATE cxx_std_17)
target_include_directories(CaRaBack PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/src"
)
target_link_libraries(CaRaBack PRIVATE
plist-2.0
ssl
crypto
)
The configuration lists the project's main dependencies, while source files are automatically collected from the src directory.
The cross-compiler settings were configured separately.
Building and Running Through ADB
Once the development environment was configured, the workflow looked like this:
Windows / IDE
|
v
WSL + CMake + toolchain
|
v
Executable for Allwinner V851
|
| ADB
v
Carlinkit U2W Mini
|
v
Execution on Linux
|
v
Debug output in the IDE console
I modified the source code and started a build. The resulting executable was then transferred to Carlinkit and executed directly on the device.
Diagnostic messages appeared in the IDE console.
This allowed me to work with the application almost as if it were a regular local project, even though compilation took place in WSL and execution happened on a separate ARM device.
Initially, I used ADB to transfer files and launch programs. It was already available after modifying the original firmware, so there was no need to configure additional network access.
Later, I installed SSH and switched to using it for communication with the device. However, the initial development stages were carried out entirely through ADB.
Starting the CaRaBack Port
After successfully testing MFi and configuring the development environment, I began porting CaRaBack from Raspberry Pi to V851.
The port was carried out step by step, from the bottom up — starting with low-level components and moving toward more complex protocols.
The order was:
- MFi — communication with the authentication chip over I²C.
- Bluetooth — handling the Bluetooth connection.
- iAP2 — exchanging data with the iPhone.
- AirPlay — receiving audio and video streams.
- IPC — transferring data to the CaRadio client application.
Each component was ported and tested separately.
This approach allowed me to adapt the backend to the new platform gradually, rather than attempting to run the entire system at once.
The first stage, MFi, went particularly smoothly. Because the transport layer and authentication logic were separated, the existing classes continued to work without modification.
Result
At this point, I had a complete development environment for building C++ applications for the Allwinner V851.
I had found a suitable toolchain, configured cross-compilation in WSL, successfully run the first Hello World program, and verified communication with the built-in MFi chip.
Using CMake and an IDE, I set up a workflow for building executables, transferring them to Carlinkit, and receiving diagnostic output.
Most importantly, it became clear that the V851 could be used not merely as an auxiliary MFi device, but as a standalone platform for CaRaBack.
The next stage was to port Bluetooth, iAP2, AirPlay, and IPC.
Only after that could the Carlinkit U2W Mini become a fully functional CarPlay server running my own software instead of just an ordinary adapter.