diff --git a/build_all/tizenRT/Make.defs b/build_all/tizenRT/Make.defs new file mode 100644 index 0000000000..c669d3a46a --- /dev/null +++ b/build_all/tizenRT/Make.defs @@ -0,0 +1,47 @@ +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs + +AZURE_CLIENT_DIR = $(AZURE_DIR)/iothub_client +AZURE_SERIAL_DIR = $(AZURE_DIR)/serializer +AZURE_UTIL_DIR = $(AZURE_DIR)/c-utility + +CSRCS += $(AZURE_DIR)/certs/certs.c +CSRCS += $(AZURE_DIR)/parson/parson.c + +CSRCS += $(AZURE_CLIENT_DIR)/src/blob.c $(AZURE_CLIENT_DIR)/src/iothub_client.c \ +$(AZURE_CLIENT_DIR)/src/iothub_message.c $(AZURE_CLIENT_DIR)/src/iothubtransport.c \ +$(AZURE_CLIENT_DIR)/src/iothub_client_ll.c $(AZURE_CLIENT_DIR)/src/iothubtransporthttp.c \ +$(AZURE_CLIENT_DIR)/src/version.c $(AZURE_CLIENT_DIR)/src/iothub_client_ll_uploadtoblob.c + +CSRCS += $(AZURE_UTIL_DIR)/src/base64.c $(AZURE_UTIL_DIR)/src/buffer.c \ +$(AZURE_UTIL_DIR)/src/connection_string_parser.c $(AZURE_UTIL_DIR)/src/consolelogger.c \ +$(AZURE_UTIL_DIR)/src/constbuffer.c $(AZURE_UTIL_DIR)/src/constmap.c \ +$(AZURE_UTIL_DIR)/src/crt_abstractions.c $(AZURE_UTIL_DIR)/src/doublylinkedlist.c \ +$(AZURE_UTIL_DIR)/src/gballoc.c $(AZURE_UTIL_DIR)/src/gb_stdio.c \ +$(AZURE_UTIL_DIR)/src/gb_time.c $(AZURE_UTIL_DIR)/src/hmac.c \ +$(AZURE_UTIL_DIR)/src/hmacsha256.c $(AZURE_UTIL_DIR)/src/httpapiex.c \ +$(AZURE_UTIL_DIR)/src/httpapiexsas.c $(AZURE_UTIL_DIR)/src/httpheaders.c \ +$(AZURE_UTIL_DIR)/src/map.c $(AZURE_UTIL_DIR)/src/optionhandler.c \ +$(AZURE_UTIL_DIR)/src/sastoken.c $(AZURE_UTIL_DIR)/src/sha1.c \ +$(AZURE_UTIL_DIR)/src/sha224.c $(AZURE_UTIL_DIR)/src/sha384-512.c \ +$(AZURE_UTIL_DIR)/src/singlylinkedlist.c $(AZURE_UTIL_DIR)/src/strings.c \ +$(AZURE_UTIL_DIR)/src/string_tokenizer.c $(AZURE_UTIL_DIR)/src/urlencode.c \ +$(AZURE_UTIL_DIR)/src/usha.c $(AZURE_UTIL_DIR)/src/vector.c $(AZURE_UTIL_DIR)/src/xlogging.c \ +$(AZURE_UTIL_DIR)/src/xio.c + +CSRCS += $(AZURE_UTIL_DIR)/adapters/agenttime.c $(AZURE_UTIL_DIR)/adapters/condition_pthreads.c \ +$(AZURE_UTIL_DIR)/adapters/threadapi_pthreads.c $(AZURE_UTIL_DIR)/adapters/lock_pthreads.c \ +$(AZURE_UTIL_DIR)/adapters/platform_tizenrt.c $(AZURE_UTIL_DIR)/adapters/uniqueid_linux.c \ +$(AZURE_UTIL_DIR)/adapters/socketio_berkeley.c $(AZURE_UTIL_DIR)/adapters/tlsio_mbedtls.c \ +$(AZURE_UTIL_DIR)/adapters/tickcounter_linux.c $(AZURE_UTIL_DIR)/adapters/httpapi_compact.c + +CSRCS += $(wildcard $(AZURE_SERIAL_DIR)/src/*.c) + +ifeq ($(CONFIG_CLOUD_AZURE_SAMPLES),y) +CSRCS += $(AZURE_CLIENT_DIR)/samples/iothub_client_sample_http/iothub_client_sample_http.c +CSRCS += $(AZURE_SERIAL_DIR)/samples/simplesample_http/simplesample_http.c +endif + +CFLAGS += -I$(AZURE_DIR)/c-utility/inc -I$(AZURE_DIR)/serializer/inc \ + -I$(AZURE_DIR)/iothub_client/inc -I$(AZURE_DIR)/parson -I$(AZURE_DIR)/certs +CFLAGS += -DWITH_POSIX -DTIZENRT -DMBED_BUILD_TIMESTAMP -DUSE_MBED_TLS -std=c99 -w diff --git a/build_all/tizenRT/Makefile b/build_all/tizenRT/Makefile new file mode 100644 index 0000000000..9cd3a8a71b --- /dev/null +++ b/build_all/tizenRT/Makefile @@ -0,0 +1,39 @@ +-include $(TOPDIR)/Make.defs + +DEPPATH = --dep-path . +VPATH = . +CSRCS = + +AZURE_DIR = ${shell pwd}/../.. + +include Make.defs + +COBJS = $(CSRCS:.c=$(OBJEXT)) + +OBJS = $(COBJS) + +BIN = libazure$(LIBEXT) + +all: $(BIN) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(BIN): $(OBJS) + $(call ARCHIVE, $@, $(OBJS)) + +.depend: Makefile $(SRCS) + $(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ + +depend: .depend + +clean: + $(call DELFILE, $(BIN)) + $(call CLEAN, $(AZURE_DIR)) + +distclean: clean + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) + +-include Make.dep diff --git a/doc/media/tizenRT1.png b/doc/media/tizenRT1.png new file mode 100644 index 0000000000..8b5497c700 Binary files /dev/null and b/doc/media/tizenRT1.png differ diff --git a/doc/media/tizenRT2.png b/doc/media/tizenRT2.png new file mode 100644 index 0000000000..fa6619fb14 Binary files /dev/null and b/doc/media/tizenRT2.png differ diff --git a/doc/media/tizenRT3.png b/doc/media/tizenRT3.png new file mode 100644 index 0000000000..1aadec556d Binary files /dev/null and b/doc/media/tizenRT3.png differ diff --git a/doc/media/tizenRT4.png b/doc/media/tizenRT4.png new file mode 100644 index 0000000000..5705615d83 Binary files /dev/null and b/doc/media/tizenRT4.png differ diff --git a/doc/media/tizenRT5.png b/doc/media/tizenRT5.png new file mode 100644 index 0000000000..e4743c62fd Binary files /dev/null and b/doc/media/tizenRT5.png differ diff --git a/doc/media/tizenRT6.png b/doc/media/tizenRT6.png new file mode 100644 index 0000000000..43d4ca494d Binary files /dev/null and b/doc/media/tizenRT6.png differ diff --git a/doc/media/tizenRT7.png b/doc/media/tizenRT7.png new file mode 100644 index 0000000000..35906e102d Binary files /dev/null and b/doc/media/tizenRT7.png differ diff --git a/doc/media/tizenRT8.png b/doc/media/tizenRT8.png new file mode 100644 index 0000000000..b14bafe71a Binary files /dev/null and b/doc/media/tizenRT8.png differ diff --git a/doc/tizenRT_s5jt200_get_started.md b/doc/tizenRT_s5jt200_get_started.md new file mode 100644 index 0000000000..ec28db1377 --- /dev/null +++ b/doc/tizenRT_s5jt200_get_started.md @@ -0,0 +1,120 @@ +Run a simple C sample on s5tj200 device running Tizen RT +--- + +# Table of Contents + +- [Introduction](#Introduction) +- [Step 1: Prerequisites](#Step-1-Prerequisites) +- [Step 2: Prepare your Device](#Step-2-PrepareDevice) +- [Step 3: Build and Run the Sample](#Step-3-Build) + + +# Introduction + +**About this document** + +This document describes the steps for connecting an [Tizen RT-enabled s5jt200](http://www.samsung.com/semiconductor/minisite/Exynos/w/) device to Azure IoT Hub. This multi-step process includes: +- Configuring Azure IoT Hub +- Registering your IoT device +- Build and deploy Azure IoT SDK on device + + +# Step 1: Prerequisites + +You should have the following items ready before beginning the process: + +- Prepare [azure-iot-sdk-c](https://github.com/Azure/azure-iot-sdk-c) to MS Azure IoT services +- [Setup your IoT hub](https://github.com/Azure/azure-iot-sdks/blob/master/doc/setup_iothub.md) +- [Provision your device and get its credentials](https://github.com/Azure/azure-iot-sdks/blob/master/doc/manage_iot_hub.md) + + +# Step 2: Prepare your Device + +s5jt200 is a IoT device with Wi-Fi connectivity. s5jt200 can communicate Azure IoThub with Wi-Fi connection. + +- Prepare [SIDK_S5JT200](http://meritech.co.kr/eng/products/ap_dp.php) HW platform with s5jt200 +- Prepare [Software and development environment](https://git.tizen.org/cgit/rtos/tinyara/) + +After unboxing your HW platform, Please do the followings: + +- Install the [ARM compile toolchain](https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update) and add your environment about cross compiler path likes +```ruby +export CROSSDEV=/toolchain/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi- +``` + +- Get source cdoe in your machine. +```ruby +git clone git://git.tizen.org/rtos/tinyara +``` + +- Config and compile for SIDK_S5JT200. +```ruby +cd tinyara/os/tools +./configure.sh sidk_s5jt200/sidk_tash +cd .. +make +``` + +- Install OpenOCD and FTDI chip drivers. +When you first connect sidk board using USB , there isn’t correct driver.You need to install FT2232 IC driver following below instruction. + - Copy openocd directory (build\configs\sidk_s5jt200\openocd) to your windows PC. + - Install FTDI chip drivers for your environment. + - If you properly install the driver, then you can see USB Serial Port on windows device manager. + + ![usbport](media/tizenRT4.png). + + +# Step3: Build and Fusing the samples + +## Build Tizen RT with azure-iot-sdk-c + +- Download the azure-iot-sdk-c. +```ruby +git clone --recursive https://github.com/Azure/azure-iot-sdk-c.git +cd azure-iot-sdk-c +git submodule init +git submodule update +``` +- Open iothub_client/samples/iothub_client_sample_http/iothub_client_sample_http.c on azure-iot-sdk-c and replace "[device connection string]" with the device connection string that you obtained in Step 1. + +- Configure Tizen RT to support Azure cloud with 'make menuconfig'. +```ruby +cd tinyara/os +make menuconfig +``` + + - Set your azure-iot-sdk-c path. + - Go to 'Build Configuration' and set your azure-iot-sdk-c path on 'cloud directory'. + + ![setpath](media/tizenRT1.png) + + - Enable azure-iot-sdk-c. + - Go to 'Application Configuration' and select 'cloud'. + - If you want to run Azure samples like iothub_client_sample_http and simplesample_http, select 'Azure cloud samples'. + + ![enablecloud](media/tizenRT2.png) + + - Enable built-in cloud application. + - Go to 'Application Configuration' and 'Examples' and select 'cloud test'. + - If you want to run Azure samples with sensor devices on HW platform, select 'cloud test with sensor'. And then write the device connection string that you obtained in Step 1 on 'azure device connection string' + + ![enablecloud](media/tizenRT3.png) + +- Execute 'make' after configuration. Then you can see libazure.a on os/libraries directory. + +## Fusing OS image + +- Plug the USB cable on board. +You can check two USB serial ports. First port is for USB download and second port is for serial. +- Execute flash.bat on openocd directory. It erases flash memory and writes new image. + + ![pusing](media/tizenRT7.png) + +## Run samples +- Execute console application likes putty. Configure it with 115200 baud rate and then run it with serial session. + + ![putty](media/tizenRT5.png) + +- Reset board and write 'cloud azure-iothub-client' on console application to run azure sample. + + ![exec](media/tizenRT8.png)