FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    Write a simple Hello World program

     

    First, write a simple Hello World program Write a Hello World program is relatively simple, you can refer to the official website: https://device.harmonyos.com/cn/docs/start/introduce/oem_wifi_start-0000001050168544 This article is summarized here. 1.1, determine the directory structure When developers write a business, be sure to create a directory (or a directory structure) in the ./applications/sample/wifi-iot/appl path, for the traffic source file file, for example: add business my_first_app under App, Among them, hello_world.c is a business code, build.gn's compilation script, the specific planning directory structure is as follows: 1.2, write business code Newly create a new service entry function HelloWorld in Hello_World.c and implement business logic. And at the bottom of the code, use the HARMONYOS to start the recovery module interface SYS_RUN () to start the business. (Sys_RUN is defined in the ohos_init.h file) 1.3, writing build.gn files for building a static library As described in step 1, the build.gn file consists of three parts content (target, source file, header file path), which is required to be fill in by the developer. Take my_first_app as an example, it is necessary to build ./applications/sample/wifi-ioot/app/my_first_app/build.gn, and configure it as follows. Static_library specifies the compilation result of the service module, which is a static library file libmyapp.a, and the developer is completed according to the actual situation. The .c file and its path depends on the Sources .a dependent. If "//" is included in the path indicates the absolute path (here the code root path), if "//" is not included, the relative path is indicated. The .h file path required to specify the Source required in Include_DIRS. 1.4, write module build.gn files, specify the feature module that needs to participate in Configure ./applications/sample/wifi-ioot/app/build.gn file, add an index in the Features field to enable the target module to participate in compilation. Features field Specifies the path and target of the service module, exemplified by my_first_app, the Features field is configured as follows. My_first_app is a relative path, pointing ./applications/sample/wifi-ioot/App/my_first_app/build.gn. MyApp is the target, pointing ./applications/sample/wifi-ioot/App/my_first_app/build.gn in static_library ("myApp"). Second, HI3861 related code structure At present, the Hi3861 is used by the Liteos-M kernel, but the Liteos-M at the current Hi3681 is currently the chip ROM, cured inside the chip. So the HARMONYOS code is not found to find the kernel portion of the Hi3861. But this does not hinder the other code structure of the Hi3861. Hi3861 platform configuration file BuildlitePlatformhi3861v100_liteos_riscvplatform.json This file describes the code path associated with the Hi3681 platform, such as Application, Startup, etc. Here I am listed in a few more important: Subsystem: Applications Path: Applications / Sample / WiFi-IoT / APP Role: This path stores the application code written by Hi3681, for example, the Hello World code we just wrote is placed under this path. Subsystem: IoT_hardware Path: Base / IoT_hardware / frameworks / wiFiiot_lite Role: The Hi3681 chip is stored, such as SPI, GPIO, UART, etc. Subsystem: vendor Path: vendor / hisi / hi3861 / hi3861 Role: The files such as the manufacturer SDK related to the Hi3681 are stored. The most important thing is Vendorhisihi3861hi3861appwifiIOT_APPinitApp_io_init.c VendorhisiHi3861hi3861AppwifiOT_APPSRCAPP_MAIN.C Among them, App_IO_INIT.C is the IO-related setting of the Hi3681 kernel startup, and the user needs to reasonably select the IO multiplexing configuration of each peripheter according to the application scenario. App_main.c is an application entry that the kernel starts entering. Third, Hi3861 launch process Since the Liteos-M of the Hi3681 is chemically in the chip, it is cured inside the chip. So we mainly look at the first inlet function after the kernel is started. Code path: App_main first prints the SDK version number, and the last line will call HOS_SYSTEMINIT (); functions for the initialization of the Hongmeng system. We will go in to see which movements do. Path: Base / Startup / Services / Bootstrap_Lite / Source / System_init.c We can see that some related modules are initialized, the system, including BSP, DEVICE. The ultimate is Module_init (RUN), which is responsible for calling all the code of all RUN segments, then which of the RUN segment is? In fact, we use the function name of the SYS_RUN () macro in front Application. Remember the Hello World app written earlier? That is to say, all functions with sys_run () macro will be used in using module_init (run); when it is called, in order to verify this, we can add some print information, as follows: We recoiled and burned. Open the serial port to view print information, as follows: You can see the information of the Hello World after 35 lines. In line with expectations. Editor in charge: LQ, read full text, original title: As long as three steps! Even the teacher takes you to the Hi3861 code structure Article Source: [Micro Signal: HARMONYOS_COMMUNITY, WeChat public number: Huawei Qilin] Welcome to add attention! Please indicate the source of the article.

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us