Merge pull request #6 from intel/master

sync
This commit is contained in:
Weining 2019-05-17 18:04:49 +08:00 committed by GitHub
commit 8aa9752ed8
9 changed files with 26 additions and 103 deletions

View File

@ -1,75 +0,0 @@
1. How to build iwasm in Linux
cd products/linux/
mkdir build && cd build
cmake .. && make
2. How to build iwasm in Zephyr system
(1) clone zephyr source code
git clone https://github.com/zephyrproject-rtos/zephyr.git
(2) copy <iwasm_root_dir>/products/zephyr/simple directory to zephry/samples/
cd zephyr/samples/
cp -a <iwasm_root_dir>/products/zephyr/simple simple
cd simple
(3) create a link to <iwasm_root_dir> and rename it to iwasm
ln -s <iwasm_root_dir> iwasm
(4) create a link to <shared-lib_root_dir> and rename it to shared-lib
ln -s <shared-lib_root_dir> shared-lib
(5) build source code
mkdir build && cd build
source ../../../zephyr-env.sh
cmake -GNinja -DBOARD=qemu_x86 ..
ninja
(6) run simple
ninja run
3. How to build iwasm in AliOS-Things platform
(1) clone AliOS-Things source code
git clone https://github.com/alibaba/AliOS-Things.git
(2) copy <iwasm_root_dir>/products/alios-things directory to AliOS-Things/middleware,
and rename it as iwasm
cp -a <iwasm_root_dir>/products/alios-things middleware/iwasm
(3) create a link to <iwasm_root_dir> in middleware/iwasm/ and rename it to iwasm
ln -s <iwasm_root_dir> middleware/iwasm/iwasm
(4) create a link to <shared-lib_root_dir> in middleware/iwasm/ and rename it to shared-lib
ln -s <shared-lib_root_dir> middle/iwasm/shared-lib
(5) modify sample source code of AliOS-Things to call iwasm_init() function
modify file app/example/helloworld/helloworld.c, in the beginning of
function application_start(), add:
bool iwasm_init(void);
iwasm_init();
modify file app/example/helloworld/helloworld.mk, change
$(NAME)_COMPONENTS := yloop cli
to
$(NAME)_COMPONENTS := yloop cli iwasm
(6) build source code
aos make helloworld@linuxhost
(7) run source code
./out/helloworld@linuxhost/binary/helloworld@linuxhost.elf

View File

@ -60,10 +60,10 @@ WASM VM and native extension method can be built into Zephyr, Then we can instal
`git clone https://github.com/zephyrproject-rtos/zephyr.git`</br> `git clone https://github.com/zephyrproject-rtos/zephyr.git`</br>
b. copy samples</br> b. copy samples</br>
`cd zephyr/samples/`</br> `cd zephyr/samples/`</br>
`cp -a <iwasm_root_dir>samples/littlevgl/vgl-wasm-runtime vgl-wasm-runtime`</br> `cp -a <wamr_root>samples/littlevgl/vgl-wasm-runtime vgl-wasm-runtime`</br>
`cd vgl-wasm-runtime/zephyr_build`</br> `cd vgl-wasm-runtime/zephyr_build`</br>
c. create a link to wamr core</br> c. create a link to wamr core</br>
` ln -s <iwasm_root_dir>/core core`</br> ` ln -s <wamr_root>/core core`</br>
d. build source code</br> d. build source code</br>
Since ui_app incorporated LittlevGL source code, so it needs more RAM on the device to install the application. Since ui_app incorporated LittlevGL source code, so it needs more RAM on the device to install the application.
It is recommended that RAM SIZE greater than 512KB. It is recommended that RAM SIZE greater than 512KB.
@ -82,27 +82,27 @@ Hardware Connections
``` ```
+-------------------+-+------------------+ +-------------------+-+------------------+
|NUCLEO-F767ZI || ILI9341 Display | |NUCLEO-F767ZI | ILI9341 Display |
+-------------------+-+------------------+ +-------------------+-+------------------+
| CN7.10 | CLK | | CN7.10 | CLK |
+-------------------+-+------------------+ +-------------------+-+------------------+
| CN7.12 | MISO | | CN7.12 | MISO |
+-------------------+-+------------------+ +-------------------+-+------------------+
| CN7.14 | MOSI | | CN7.14 | MOSI |
+-------------------+-+------------------+ +-------------------+-+------------------+
| CN11.1 | CS1 for ILI9341 | | CN11.1 | CS1 for ILI9341 |
+-------------------+-+------------------+ +-------------------+-+------------------+
| CN11.2 | D/C | | CN11.2 | D/C |
+-------------------+-+------------------+ +-------------------+-+------------------+
| CN11.3 | RESET | | CN11.3 | RESET |
+-------------------+-+------------------+ +-------------------+-+------------------+
| CN9.25 | PEN interrupt| | CN9.25 | PEN interrupt |
+-------------------+-+------------------+ +-------------------+-+------------------+
| CN9.27 | CS2 for XPT2046 | | CN9.27 | CS2 for XPT2046 |
+-------------------+-+------------------+ +-------------------+-+------------------+
| CN10.14 | PC UART RX | | CN10.14 | PC UART RX |
+-------------------+-+------------------+ +-------------------+-+------------------+
| CN11.16 | PC UART RX | | CN11.16 | PC UART RX |
+-------------------+-+------------------+ +-------------------+-+------------------+
``` ```

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
PROJECT_DIR=$PWD PROJECT_DIR=$PWD
ROOT_DIR=${PWD}/../../.. WAMR_DIR=${PWD}/../..
OUT_DIR=${PWD}/out OUT_DIR=${PWD}/out
BUILD_DIR=${PWD}/build BUILD_DIR=${PWD}/build
@ -13,7 +13,7 @@ rm -rf ${OUT_DIR}
mkdir ${OUT_DIR} mkdir ${OUT_DIR}
cd ${ROOT_DIR}/wamr/core/shared-lib/mem-alloc cd ${WAMR_DIR}/core/shared-lib/mem-alloc
if [ ! -d "tlsf" ]; then if [ ! -d "tlsf" ]; then
git clone https://github.com/mattconte/tlsf git clone https://github.com/mattconte/tlsf
fi fi
@ -36,7 +36,7 @@ echo "#####################build host-tool"
cd $BUILD_DIR cd $BUILD_DIR
mkdir -p host-tool mkdir -p host-tool
cd host-tool cd host-tool
cmake ${ROOT_DIR}/wamr/test-tools/host-tool cmake ${WAMR_DIR}/test-tools/host-tool
make make
if [ $? != 0 ];then if [ $? != 0 ];then
echo "BUILD_FAIL host tool exit as $?\n" echo "BUILD_FAIL host tool exit as $?\n"

View File

@ -16,14 +16,14 @@
#include "bh_platform.h" #include "bh_platform.h"
#include "runtime_lib.h" #include "runtime_lib.h"
#include "native_interface.h" #include "native_interface.h"
#include "app-manager-export.h" #include "app_manager_export.h"
#include "board_config.h" #include "board_config.h"
#include "bh_common.h" #include "bh_common.h"
#include "bh_queue.h" #include "bh_queue.h"
#include "bh_thread.h" #include "bh_thread.h"
#include "bh_memory.h" #include "bh_memory.h"
#include "runtime_sensor.h" #include "runtime_sensor.h"
#include "attr-container.h" #include "attr_container.h"
#include "module_wasm_app.h" #include "module_wasm_app.h"
#include "wasm_export.h" #include "wasm_export.h"

View File

@ -34,7 +34,7 @@ target_include_directories(app PRIVATE ${IWASM_ROOT}/runtime/include
${IWASM_ROOT}/runtime/platform/zephyr ${IWASM_ROOT}/runtime/platform/zephyr
${IWASM_ROOT}/runtime/platform/include ${IWASM_ROOT}/runtime/platform/include
${IWASM_ROOT}/runtime/utils ${IWASM_ROOT}/runtime/utils
${IWASM_ROOT}/runtime/vmcore_wasm ${IWASM_ROOT}/runtime/vmcore-wasm
${IWASM_ROOT}/lib/native/base ${IWASM_ROOT}/lib/native/base
${IWASM_ROOT}/lib/native/libc ${IWASM_ROOT}/lib/native/libc
${IWASM_ROOT}/lib/native/extension/sensor ${IWASM_ROOT}/lib/native/extension/sensor

View File

@ -43,10 +43,10 @@ message ("PLATFORM = " ${PLATFORM})
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections") set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections -Wall -Wno-unused-parameter -Wno-pedantic") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections -Wall -Wno-unused-parameter -Wno-pedantic")
set(REPO_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../../..) set(WAMR_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../..)
set(WASM_DIR ${REPO_ROOT_DIR}/wamr/core/iwasm) set(WASM_DIR ${WAMR_ROOT_DIR}/core/iwasm)
set(APP_MGR_DIR ${REPO_ROOT_DIR}/wamr/core/app-mgr) set(APP_MGR_DIR ${WAMR_ROOT_DIR}/core/app-mgr)
set(SHARED_DIR ${REPO_ROOT_DIR}/wamr/core/shared-lib) set(SHARED_DIR ${WAMR_ROOT_DIR}/core/shared-lib)
enable_language (ASM) enable_language (ASM)

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
CURR_DIR=$PWD CURR_DIR=$PWD
ROOT_DIR=${PWD}/../../.. WAMR_DIR=${PWD}/../..
OUT_DIR=${PWD}/out OUT_DIR=${PWD}/out
BUILD_DIR=${PWD}/build BUILD_DIR=${PWD}/build
@ -15,7 +15,7 @@ rm -rf ${OUT_DIR}
mkdir ${OUT_DIR} mkdir ${OUT_DIR}
mkdir ${OUT_DIR}/wasm-apps mkdir ${OUT_DIR}/wasm-apps
cd ${ROOT_DIR}/wamr/core/shared-lib/mem-alloc cd ${WAMR_DIR}/core/shared-lib/mem-alloc
if [ ! -d "tlsf" ]; then if [ ! -d "tlsf" ]; then
git clone https://github.com/mattconte/tlsf git clone https://github.com/mattconte/tlsf
fi fi
@ -34,7 +34,7 @@ cp -a simple ${OUT_DIR}
echo "#####################build simple project success" echo "#####################build simple project success"
echo "#####################build host-tool" echo "#####################build host-tool"
cd ${ROOT_DIR}/wamr/test-tools/host-tool cd ${WAMR_DIR}/test-tools/host-tool
mkdir -p bin mkdir -p bin
cd bin cd bin
cmake .. cmake ..

View File

@ -41,7 +41,6 @@ include (${SHARED_DIR}/utils/shared_utils.cmake)
include (${SHARED_DIR}/mem-alloc/mem_alloc.cmake) include (${SHARED_DIR}/mem-alloc/mem_alloc.cmake)
include (${CJSON_DIR}/cjson.cmake) include (${CJSON_DIR}/cjson.cmake)
include (${SHARED_DIR}/coap/lib_coap.cmake) include (${SHARED_DIR}/coap/lib_coap.cmake)
include (${SSG_LIB_DIR}/host_agent_lib.cmake)
if (CMAKE_SIZEOF_VOID_P EQUAL 8) if (CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")

View File

@ -29,7 +29,6 @@
#include "app_manager_export.h" /* for Module_WASM_App */ #include "app_manager_export.h" /* for Module_WASM_App */
#include "host_link.h" /* for REQUEST_PACKET */ #include "host_link.h" /* for REQUEST_PACKET */
#include "transport.h" #include "transport.h"
#include "iagent_bsp.h" /* for bh_get_elpased_ms */
#define BUF_SIZE 1024 #define BUF_SIZE 1024
#define TIMEOUT_EXIT_CODE 2 #define TIMEOUT_EXIT_CODE 2