代码仓:https://codechina.csdn.net/fu851523125/rtos

    下载HI3516DV300官方板子的固件,烧写到自己的板子上,虽然不能正常使用,但主要看一些信息。

官方教程

https://device.harmonyos.com/cn/docs/start/introduce/oem_camera_start_first_example-0000001051610926

EMMC 分区

0x00000000 – 0x00100000  1M u-boot.bin
0x00100000 – 0x00a00000  9M OHOS_Image.bin
0x00a00000 – 0x01900000 15M rootfs.img
0x01900000 – 0x33900000 50M userfs.img

启动命令与参数

setenv bootcmd “mmc read 0x0 0x80000000 0x800 0x4800; go 0x80000000”;
setenv bootargs “console=ttyAMA0,115200n8 root=emmc fstype=vfat rootaddr=10M rootsize=15M rw”;

启动信息

## Starting application at 0x80000000 …

******************Welcome******************

Processor   : Cortex-A7 * 2
Run Mode    : SMP
GIC Rev     : GICv2
build time  : Sep  9 2020 22:59:54
Kernel      : Huawei LiteOS 2.0.0.35/release

*******************************************

main core booting up…
[ERR][HDF:E/hcs_blob_if]CheckHcsBlobLength: the blobLength: 13128, byteAlign: 1, totalSize: -13108
releasing 1 secondary cores
cpu 0 entering scheduler
random dev init …
cpu 1 entering scheduler
 

 

”双核 SMP“ 之前已经知道了,”使用GICv2“也可以搜索到

”releasing 1 secondary cores“之后先是”cpu 0 entering scheduler“

LITE_OS_SEC_TEXT_INIT VOID OsStart(VOID)
{
    LosProcessCB *runProcess = NULL;
    LosTaskCB *taskCB = NULL;
    UINT32 cpuid = ArchCurrCpuid();

    OsTickStart();

    LOS_SpinLock(&g_taskSpin);
    taskCB = OsGetTopTask();

    runProcess = OS_PCB_FROM_PID(taskCB->processID);
    runProcess->processStatus |= OS_PROCESS_STATUS_RUNNING;
#if (LOSCFG_KERNEL_SMP == YES)
    /*
     * attention: current cpu needs to be set, in case first task deletion
     * may fail because this flag mismatch with the real current cpu.
     */
    taskCB->currCpu = cpuid;
    runProcess->processStatus = OS_PROCESS_RUNTASK_COUNT_ADD(runProcess->processStatus);
#endif

    OS_SCHEDULER_SET(cpuid);

    PRINTK(“cpu %d entering scheduler\n”, cpuid);
    OsStartToRun(taskCB);
}

main()

{

    PRINT_RELEASE(“\nmain core booting up…\n”);

    uwRet = OsMain();
    if (uwRet != LOS_OK) {
        return LOS_NOK;
    }

#if (LOSCFG_KERNEL_SMP == YES)
    PRINT_RELEASE(“releasing %u secondary cores\n”, LOSCFG_KERNEL_SMP_CORE_NUM – 1);
    release_secondary_cores();
#endif

    CPU_MAP_SET(0, OsHwIDGet());

    OsStart();

    while (1) {
        __asm volatile(“wfi”);
    }

}

而在release_secondary_cores()使用了WFE等待,说明正常情况下WFE被唤醒,唤醒后,CPU0先调度,再是CPU1调度。

这个前面应该是有唤醒,只是自己没注意。所以我之前的想法是错误的。

  只要启动调度了,那么剩下的系统启动过程,也都差不多一样的了。

proc fs init …
Mount procfs finished.
MMC dev init …[ERR]No console dev used.
[ERR]No console dev used.
mem dev init …
spi nor flash init …
spinor_get_dev_id(56): Spi(cs0) have no device.
Cs[0] have no device!!!
spinor_get_dev_id(56): Spi(cs1) have no device.
Cs[1] have no device!!!
hifmc100_attach(130): Error:spinor scan fail!
net init …

tcpip_init start

tcpip_init end
Ethernet start.hisi_eth: User did not set phy mode, use default=rmii
disk_init : register /dev/mmcblk0 ok!
hisi_eth: User did not set phy addr, auto scan…
No OTP data, festa PHY use default ATE parameters!
festa PHY wait autotrim done timeout!
Detected phy addr 1, phyid: 0x1cc816
spinor_get_dev_id(56): Spi(cs0) have no device.
Cs[0] have no device!!!
spinor_get_dev_id(56): Spi(cs1) have no device.
Cs[1] have no device!!!
hifmc100_attach(130): Error:spinor scan fail!
netif_is_link_up overtime!

************************************************************
usb init …

******** usb_init in **********
usb v3.05 2019-11-20 10:40
xhci_init (xhci0): 64 bytes context size, 32-bit DMA
usb_bus_attach (usbus0): 5.0Gbps Super Speed USB v3.0
spinor_get_dev_id(56): Spi(cs0) have no device.
Cs[0] have no device!!!
spinor_get_dev_id(56): Spi(cs1) have no device.
Cs[1] have no device!!!
hifmc100_attach(130): Error:spinor scan fail!
******** usb_init ok**********

Date:Sep  9 2020.
Time:23:00:53.
ugen0.1: <vendor 0x0000> at usbus0
OsMountRootfs start …
device_set_usb_desc (uhub0): <vendor 0x0000 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0
disk_init : register /dev/mmcblk0 ok!
DiskAddPart : register /dev/mmcblk0p0 ok!
DiskAddPart : register /dev/mmcblk0p1 ok!
DiskAddPart : register /dev/mmcblk0p2 ok!
OsMountRootfs end …
g_mmz_start=0x88000000, g_mmz_size=0x180
mmz param= anonymous,0,0×88000000,384M
<6>Hisilicon Media Memory Zone Manager
Load hifb.ko OK!
[VERSION]:Hi3881V100R001C00SPC020 2020-07-16 23:15:00
oam_main_init SUCCESSFULLY!
wal_customize_init SUCCESSFULLY!
oal_main_init SUCCESSFULLY
frw_main_init SUCCESSFULLY!
hi_wifi_plat_init SUCCESSFULLY
uhub_attach (uhub0): 1 port with 1 removable, self powered
[472045][E:184]sdio rescan failed.
[472045][E:2134]No SDIO card

[472045][E:1625]hcc_host_init:: sdio_probe failed!
[472050][E:2120]No SDIO card

[472053][E:583]hcc_host_init fail![1]
[472056][E:272]hi_wifi_host_init: hcc_hmac_init return error code: 1
[472062][E:151]wifi host initialize fail.
[ERR][HDF:E/HDF_LOG_TAG]HdfWifiChipInit:init chip hisi error ret=1
[ERR][HDF:E/HDF_LOG_TAG]HdfWifiDriverInit:init chip 0 error ret=-210, feature 65535 is unavailable!
[ERR][HDF:E/devhost_service_clnt]Install hdfwifi driver failed, ret = -204
[ERR][HDF:E/HDF_LOG_TAG]ioctl HI_MIPI_TX_GET_CMD error ret=-1

[ERR][HDF:E/devhost_service_clnt]Install LCD_MIPI_ICN9700 driver failed, ret = -204
[ERR][HDF:E/i2c_hi35xx]HibvtI2cRescure: wait Timeout!
[ERR][HDF:E/i2c_hi35xx]HibvtI2cRescure: done!
[ERR][HDF:E/i2c_hi35xx]HibvtI2cWaitIdle: wait idle timeout, RIS: 0x410, SR: 0xa0000

[ERR][HDF:E/HDF_LOG_TAG]InputI2cRead: i2c read err
[ERR][Hsdk init end
cat log shell end
[Init] ****/****/****/****/OpenHarmony/****/****/3/OpenHarmony 1.0/release
[Init] DoMount, failed for vfat /dev/mmcblk0 /sdcard rw,umask=000, err -1.
[ERR]Failed to find block driver /dev/mmcblk1
[Init] DoMount, failed for vfat /dev/mmcblk1 /sdcard rw,umask=000, err -1.
[Init] start service shell invalid, please check /bin/shell.
[Init] StartServiceByName, service shell start failed!
[Init] start service apphilogcat succeed, pid 3.
[Init] SigHandler, SIGCHLD received.
[Init] start service foundation succeed, pid 4.
[UnRegisteDeathCallback : 960]Wrong cbId:4294967295.
[UnRegisteDeathCallback : 960]Wrong cbId:4294967295.
[UnRegisteDeathCallback : 960]Wrong cbId:4294967295.
[DISCOVERY] InitLocalDeviceInfo ok
[DISCOVERY] CoapReadHandle coin select begin
[AUTH] StartBus StartListener fail
[DISCOVERY] InitService BusManager(1) fail
[DISCOVERY] InitService ok
[DISCOVERY] PublishCallback publishId=1, result=0
[Init] start service bundle_daemon succeed, pid 5.
[UnRegisteDeathCallback : 960]Wrong cbId:4294967295.
[UnRegisteDeathCallback : 960]Wrong cbId:4294967295.
[Init] start service appspawn succeed, pid 6.
[UnRegisteDeathCallback : 960]Wrong cbId:4294967295.
[UnRegisteDeathCallback : 960]Wrong cbId:4294967295.
[Init] start service media_server succeed, pid 7.
Media server initialize succeed.
[Init] start service wms_server succeed, pid 8.
[DISPLAY I/] LayerInitialize: layer initialize success
[DISPLAY I/] HdmiStart: start hdmi success
[Init] DoChown, failed for 0 99 /dev/hdfwifi, err 2.
[Init] main, entering wait.
[DISPLAY I/] HdmiStart: start hdmi success
[DISPLAY I/] HdmiIntfInit: hdmi connected
[DISPLAY I/] StartVoLayer: start vo layer success
[DISPLAY I/] PrintLayerInfo: layerInfo:
[DISPLAY I/] PrintLayerInfo: type = 0
[DISPLAY I/] PrintLayerInfo: width = 1920
[DISPLAY I/] PrintLayerInfo: height = 1080
[DISPLAY I/] PrintLayerInfo: bpp = 16
[DISPLAY I/] PrintLayerInfo: pixFormat = 9
[DISPLAY I/] OpenGraphicLayer: open graphic layer success, layerId = 0!
[DISPLAY I/] GfxInitialize: gfx initialize success
GetInputInterface: enter
GetInputInterface: exit succ
[UnRegisteDeathCallback : 960]Wrong cbId:4294967295.OpenInputDevice: open dev1 succ
RegisterReportCallback: create monitor thread succ, index = 1
RegisterReportCallback: device1 register callback succ, callbackNum = 1
OpenInputDevice: dev2 does not exist

[UnRegisteDeathCallback : 960]Wrong cbId:4294967295.
[DISPLAY I/] GfxInitialize: gfx initialize success
[DISPLAY I/] GrallocInitialize: gralloc initialize success
[DISPLAY I/] GrallocInitialize: gralloc initialize success

 

HDMI输出图像

 

本文地址:https://blog.csdn.net/fu851523125/article/details/108992657