OK3588 6.1.99 Android 14 U-Disk Upgrade Solution
I. Background
In the deployment and maintenance of Android devices, the system upgrade solution remains a key focus for customers. Common local upgrade methods are OTA upgrades and SD/TF card flashing. The Over-The-Air (OTA) upgrade method, which is the standard for Android updates, allows for both full and incremental packages to be installed through local and network upgrades. While it offers strong functionality, there are limitations in specific situations. These limitations include the inability to roll back an upgrade after a failure and a lack of flexibility when it comes to flashing third-party or custom systems. On the other hand, SD/TF card flashing is more straightforward but requires the hardware platform to have a dedicated card slot.
To address these practical project needs, the OK3588 Android 14 platform offers a more flexible local upgrade method: U-disk upgrade via USB interface. This solution does not rely on TF/SD card interfaces and is suitable for scenarios such as on-site maintenance, offline upgrades, and rapid system recovery.
II. Core Implementation Approach
1. Enabling USB Boot in U-Boot
Before entering Recovery, it is crucial to ensure that U-Boot can recognize the U-disk and successfully boot from the USB device. Boot capability from the U-disk is confirmed when the boot logs display messages such as “Booting from USB.” The default U-Boot in the public version image mainly supports booting from TF/SD cards. If USB boot functionality is required, you must use a version of U-Boot that supports booting from U-disks. For assistance, please contact Forlinx engineers for the necessary support.
2. Recovery Support for USB Storage Flashing (Default support in public version image, no modification required)
The source code for Android 14 Recovery can be found in the directory OK3576-android14-source/bootable/recovery. The current version of the Android 14 Recovery source code supports flashing from USB storage media by default, which means that additional modifications to Recovery are usually not required. Once you enter Recovery, the system will follow the standard upgrade procedure to recognize the upgrade package and execute the flashing process.
2.1 Entering Recovery
OK3576-android14-source/bootable/recovery/recovery_main.cpp
if (usb_config != usb_state) {
if (!SetUsbConfig("none")) {
LOG(ERROR) << "Failed to clear USB config";
}
if (!SetUsbConfig(usb_config)) {
LOG(ERROR) << "Failed to set USB config to " << usb_config;
}
}
ui->SetEnableFastbootdLogo(fastboot);
auto ret = fastboot ? StartFastboot(device, args) : start_recovery(device, args, &rksdboot); //Enter recovery
if (ret == Device::KEY_INTERRUPTED) {
ret = action.exchange(ret);
if (ret == Device::NO_ACTION) {
continue;
}
}
switch (ret
2.2 Start_recovery Flashing
OK3576-android14-source/bootable/recovery/recovery.cpp
OK3576-android14-source/bootable/recovery/recovery.cpp
ui->SetBackground(RecoveryUI::INSTALLING_UPDATE);
ui->SetProgressType(RecoveryUI::DETERMINATE);
printf("start USB upgrade...\\n");
ui->Print("start USB upgrade...\\n");
if (bUpdateIDBlock)
bRet= do_rk_firmware_upgrade(pFwPath,(void *)handle_upgrade_callback,(void *)handle_upgrade_progress_callback); //Updating the API for firmware
else
bRet = do_rk_partition_upgrade(pFwPath,(void *)handle_upgrade_callback,(void *)handle_upgrade_progress_callback);
ui->SetProgressType(RecoveryUI::EMPTY);
if (!bRet)
{
prksdboot->sdboot_set_status(INSTALL_ERROR);
ui->Print("SD upgrade failed!\\n");
}
else
{
prksdboot->sdboot_set_status(INSTALL_SUCCESS);
printf("USB upgrade ok.\\n");
ui->Print("USB upgrade ok.\\n");
forlinx_clear_env_partition();
}
III. USB Flashing Implementation and Process
1. Creating a Bootable U-disk
First, prepare a FAT32-formatted U-disk and create the upgrade medium according to the flashing rules.
In essence, this process is similar to creating a traditional SD card flashing package, but the storage medium is switched from a TF/SD card to a U-disk.
2. U-boot Booting from the U-disk and Entering Recovery
After the device powers on, the USB boot-enabled U-Boot scans various USB buses and storage devices.
scanning bus usb@fc000000 for devices... 1 USB Device(s) found scanning bus usb@fc800000 for devices... 2 USB Device(s) found scanning bus usb@fc840000 for devices... 1 USB Device(s) found scanning bus usb@fc880000 for devices... 1 USB Device(s) found scanning bus usb@fc8c0000 for devices... 2 USB Device(s) found scanning bus usb@fc400000 for devices... 1 USB Device(s) found scanning usb for storage devices... 1 Storage Device(s) found //Scan USB storage device Scanning usb 0 ... === Booting from usb 0 === //Boot from USB 0 device Minidump: init... RESC: ‘boot', blk@0x0001f600
3. Flashing via the Update Process in Recovery
After entering Recovery, the system invokes the corresponding upgrade interfaces based on the selected upgrade mode and initiates the upgrade process.
bSDBoot = 0, sdboot_update_package=1 bSDBoot = 0, sdboot_update_package=1 enter sdboot_set_bUpdateModel ! enter sdboot_get_bSDBoot ! enter sdboot_get_bUsbBoot ! UsbBoot do_rk_mode_update UsbBoot do_rk_mode_update enter sdboot_set_status ! start USB upgrade... start USB upgrade... librkupdate_Start to upgrade firmware... Start to upgrade firmware... [ 16.889130][ T195] usb 2-1: new SuperSpeed USB device number 2 using xhci-hcd [ 16.909900][ T195] usb 2-1: New USB device found, idVendor=2c7c, idProduct=0900, bcdDevice= 4.04 [ 16.909939][ T195] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 16.909955][ T195] usb 2-1: Product: RM500U-CN [ 16.909968][ T195] usb 2-1: Manufacturer: Quectel [ 16.909982][ T195] usb 2-1: SerialNumber: 0123456789ABCDEF [ 16.969799][ T195] cdc_ncm 2-1:1.0: MAC-Address: 2a:fa:91:8d:90:36 [ 16.970415][ T195] cdc_ncm 2-1:1.0 usb0: register 'cdc_ncm' at usb-xhci-hcd.3.auto-1, CDC NCM (NO ZLP), 2a:fa:91:8d:90:36 [ 16.970967][ T195] option 2-1:1.2: GSM modem (1-port) converter detected [ 16.971155][ T195] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB0 [ 16.971384][ T195] option 2-1:1.3: GSM modem (1-port) converter detected [ 16.971537][ T195] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB1 [ 16.971780][ T195] option 2-1:1.4: GSM modem (1-port) converter detected [ 16.971939][ T195] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB2 [ 16.972224][ T195] option 2-1:1.5: GSM modem (1-port) converter detected [ 16.972365][ T195] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB3 [ 16.972613][ T195] option 2-1:1.6: GSM modem (1-port) converter detected [ 16.972762][ T195] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB4 [ 17.253090][ T138] Freeing drm_logo memory: 2704K [ 18.049006][ T101] rk_pcie_establish_link: 451 callbacks suppressed [ 18.049025][ T101] rk-pcie fe170000.pcie: PCIe Linking... LTSSM is 0x3 [ 18.069521][ T99] rk-pcie fe190000.pcie: PCIe Linking... LTSSM is 0x3 [ 18.070269][ T101] rk-pcie fe170000.pcie: PCIe Linking... LTSSM is 0x3 [ 18.090759][ T99] rk-pcie fe190000.pcie: PCIe Linking... LTSSM is 0x3 [ 18.091471][ T101] rk-pcie fe170000.pcie: PCIe Linking... LTSSM is 0x3 [ 18.112025][ T99] rk-pcie fe190000.pcie: PCIe Linking... LTSSM is 0x3 [ 18.112680][ T101] rk-pcie fe170000.pcie: PCIe Linking... LTSSM is 0x3 [ 18.133184][ T99] rk-pcie fe190000.pcie: PCIe Linking... LTSSM is 0x3 [ 18.133882][ T101] rk-pcie fe170000.pcie: PCIe Linking... LTSSM is 0x3 [ 18.154435][ T99] rk-pcie fe190000.pcie: PCIe Linking... LTSSM is 0x3 [ 18.470438][ T99] rk-pcie fe190000.pcie: PCIe Link Fail, LTSSM is 0x3, hw_retries=1 [ 18.472362][ T101] rk-pcie fe170000.pcie: PCIe Link Fail, LTSSM is 0x3, hw_retries=1 librkupdate_INFO:emmc_point-->is /dev/block/mmcblk0 librkupdate_INFO:is emmc devices... flashSize is 61865984000 CRKUsbComm INFO m_bEmmc=1 m_ufs=0 librkupdate_INFO:CRKUsbComm-->is emmc. librkupdate_INFO:CRKUsbComm EMMC_DRIVER_DEV_VENDOR-->/dev/vendor_storage=18 librkupdate_INFO:CRKUsbComm emmc_point-->/dev/block/mmcblk0=20 In Md5Check [ 19.341061][ T195] rockchip-dp fded0000.edp: failed to read max link rate [ 19.493155][ T99] rk-pcie fe190000.pcie: failed to initialize host [ 19.498111][ T101] rk-pcie fe170000.pcie: failed to initialize host [ 19.673244][ T195] rockchip-dp fded0000.edp: failed to read max link rate New Md5: 61 35 33 36 39 37 32 65 63 66 65 31 31 38 35 38 34 65 35 33 37 36 63 61 33 30 63 34 66 39 36 39 Old Md5: 61 35 33 36 39 37 32 65 63 66 65 31 31 38 35 38 34 65 35 33 37 36 63 61 33 30 63 34 66 39 36 39 librkupdate_uid: 52 4F 43 4B 43 48 49 50 E1 5C A1 69 6B 7B 98 73 74 49 94 4C A3 E8 58 AB 2E B7 A9 46 A1 BE uid: 52 4F 43 4B 43 48 49 50 E1 5C A1 69 6B 7B 98 73 74 49 94 4C A3 E8 58 AB 2E B7 A9 46 A1 BE librkupdate_Get FlashInfo... Get FlashInfo... librkupdate_INFO:FlashInfo: 00 00 80 00 00 04 04 00 28 00 01 librkupdate_INFO:m_flashInfo.uiFlashSize=59000 MB, RKU_GetFlashSize=120832000 sectors librkupdate_IDBlock Preparing... Complete the Flashing Through the Recovery Update Process
4. Flashing Completion Prompt
RKA_SparseFile_Check entry.name=super librkupdate_INFO:Start to check super,offset=0x1fd400,size=I64u INFO:Start to check super,offset=0x1fd400,size=I64u RKA_SparseFile_Check entry.name=super Done! librkupdate_Finish to upgrade firmware. Finish to upgrade firmware. enter sdboot_set_status ! USB upgrade ok. USB upgrade ok. enter sdboot_get_status ! enter sdboot_set_status ! prksdboot->do_rk_mode_update Successful! prksdboot->do_rk_mode_update Successful! enter sdboot_get_bSDBoot ! enter sdboot_get_bUsbBoot ! enter sdboot_get_status ! Doing Actions succeeded.please remove the usb disk...... enter sdboot_get_bUpdateModel ! enter sdboot_get_usb_device_path ! enter sdboot_get_usb_device_path ! enter sdboot_get_usb_device_path ! enter sdboot_get_usb_device_path ! enter sdboot_get_usb_device_path ! enter sdboot_get_usb_device_path ! enter sdboot_get_usb_device_path ! Flashing completion screen display is as shown in the figure.
IV. Application Value of the USB Flashing Solution
For the OK3588 Android 14 platform, the USB flashing solution is not merely a supplement to existing upgrade methods, but a more practical upgrade path better suited to project field requirements.
1. Reduced Dependence on Hardware Interfaces
It does not require reserved TF/SD card slots, making it suitable for terminal devices with limited structural space or interface resources.
2. Enhanced On-site Maintenance Convenience
Local upgrades can be performed simply using a U-disk. The operation is straightforward, suitable for after-sales maintenance and rapid system recovery in engineering environments.
3. Favorable for Custom System Deployment
In scenarios where preserving existing user data is not required, USB flashing serves as a more direct method for full system updates.
4. Facilitates Batch Deployment and Standardized Promotion
For projects requiring offline upgrades, batch delivery, or system recovery, this solution offers good replicability and promotional value.
Summary
Implementing USB local flashing on the OK3588 Android 14 platform involves establishing a USB boot link in U-Boot, enhancing the existing Android Recovery upgrade capability to create a comprehensive U-disk upgrade solution.
Compared to traditional OTA and TF/SD card flashing methods, this solution offers significant advantages in offline upgrades, on-site maintenance, structural adaptability, and system recovery efficiency.
For projects that require local upgrades, rapid recovery, and flexible deployment, USB flashing undoubtedly is a solution with greater practical engineering value.


