Skip to content

Commit 5400f39

Browse files
junyoun-kimGitHub Enterprise
authored and
GitHub Enterprise
committed
Merge pull request #50 from iot-device/develop
Release v2.1.1
2 parents 8f2e491 + 466d9d8 commit 5400f39

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+11507
-8
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
[submodule "bsp/esp32"]
55
path = bsp/esp32
66
url = https://github.com/espressif/esp-idf.git
7+
[submodule "bsp/bl602"]
8+
path = bsp/bl602
9+
url = https://github.com/bouffalolab/bl_iot_sdk.git

README.md

+35-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ The Direct Connected Devices SDK builds on the environments of each chipset vend
2828
Install the toolchain defined in the chipset SDK you use according to the directions below. If no development environment is described for your chipset, it is assumed to only be applicable for 64-bit Ubuntu-based environments.
2929

3030
#### For ESP32:
31-
1. Install [Prerequisites](https://docs.espressif.com/projects/esp-idf/en/release-v4.3/esp32/get-started/index.html#step-1-install-prerequisites) for your build system OS.
31+
1. Install [Prerequisites](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/linux-macos-setup.html#step-1-install-prerequisites) for your build system OS.
32+
33+
> **_NOTE:_**
34+
> ESP32 examples are tested under ESP-IDF SDK v5.0.
35+
3236
2. Set up the ESP32 toolchain with `setup.py`
3337

3438
### Build
@@ -46,9 +50,11 @@ Install the toolchain defined in the chipset SDK you use according to the direct
4650
--------------------------------------------------
4751
ex) python setup.py esp32
4852
ex) python setup.py esp32c3
53+
ex) python setup.py esp32s3
54+
ex) python setup.py bl602
4955
```
5056

51-
2. Check the build configuration of a sample device application (`apps` folder). If you want to use specific build options, you can directly modify the each chipset build configuration file (e.g. `sdkconfig.esp32`, `sdkconfig.esp32c3`) at the root directory of a sample device application. On the Espressif chipset, you can additionally use the `menuconfig` option for configuration.
57+
2. Check the build configuration of a sample device application (`apps` folder). If you want to use specific build options, you can directly modify the each chipset build configuration file (e.g. `sdkconfig.esp32`, `sdkconfig.esp32c3`,`sdkconfig.esp32s3`) at the root directory of a sample device application. On the Espressif chipset, you can additionally use the `menuconfig` option for configuration.
5258

5359
> If you want to use the default build configuration, you can skip this step.
5460
@@ -64,17 +70,23 @@ Install the toolchain defined in the chipset SDK you use according to the direct
6470

6571
# For other esp32 chipset series.
6672
$ python build.py esp32c3 switch_example menuconfig
73+
$ python build.py esp32s3 switch_example menuconfig
6774
```
6875

6976
3. Run `build.py` in the SDK's root directory. This builds the sample executables and places them in `output/{chip_name}/`.
7077
7178
```sh
7279
$ python build.py apps/esp32/switch_example # python build.py {app_path}
80+
7381
or
7482
$ python build.py esp32 switch_example # python build.py {bsp_name} {app_name}
7583
7684
# For other esp32 chipset series.
7785
$ python build.py esp32c3 switch_example
86+
$ python build.py esp32s3 switch_example
87+
88+
# For other bl602 chipset series.
89+
$ python build.py apps/bl602/switch_example
7890
```
7991
8092
### Flash and Monitor
@@ -85,6 +97,7 @@ The serial port of your device must to be matched to the computer environment fo
8597
|Chipset|Buad Rate for Flashing|Baud Rate for Monitoring|Data Bit|Parity|Stop Bits|
8698
|-------|----------------------|------------------------|--------|------|---|
8799
|ESP32|115200|74880|8|None|1|
100+
|BL602|2000000|2000000|8|None|1|
88101
89102
#### Flashing
90103
@@ -108,20 +121,40 @@ Available Options:
108121
109122
# For other esp32 chipset series.
110123
$ python build.py esp32c3 switch_example clean
124+
$ python build.py esp32s3 switch_example clean
125+
126+
# For bl602 chipset series.
127+
$ python build.py apps/bl602/switch_example clean
111128
```
112129
- **flash**: download executable binaries to the device
130+
131+
# python build.py {app_path} {flash} {port}
132+
133+
# For bl602 chipset series.
134+
$ python build.py apps/bl602/switch_example flash /dev/ttyACM0
113135
- **monitor**: monitor the serial output of device. this option can be used with flash option.
114136
```sh
115137
# python build.py {app_path} {options}
116138
$ python build.py apps/esp32/switch_example flash monitor
117139
or
140+
141+
# For bl602 chipset series.
142+
$ python build.py apps/bl602/switch_example monitor /dev/ttyACM0
143+
118144
# python build.py {bsp_name} {app_name} {options}
119145
$ python build.py esp32 switch_example flash monitor
120146
121147
# For other esp32 chipset series.
122148
$ python build.py esp32c3 switch_example flash monitor
149+
$ python build.py esp32s3 switch_example flash monitor
123150
```
124151
152+
## Commercialization
153+
154+
For commercialization, refer to the following [link](https://github.com/SmartThingsCommunity/st-device-sdk-c/blob/main/doc/Commercialization_Guide).
155+
156+
If you have any issue, or want to commercialize your IoT devices using this SDK, please contact stdk@samsung.com or open new issue.
157+
125158
## License
126159
127160
This library is licensed under the [Apache License Ver2.0](LICENSE).

apps/bl602/light_example/Makefile

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#
2+
# This is a project Makefile. It is assumed the directory this Makefile resides in is a
3+
# project subdirectory.
4+
#
5+
6+
PROJECT_NAME := light_example
7+
PROJECT_PATH := $(abspath .)
8+
IOT_CORE_PATH := $(abspath ${PROJECT_PATH}/../../../iot-core)
9+
PROJECT_BOARD := evb
10+
export PROJECT_PATH PROJECT_BOARD IOT_CORE_PATH
11+
#CONFIG_TOOLPREFIX :=
12+
13+
BLECONTROLLER_LIBS := m1s1 m0s1 m0s1s
14+
BLECONTROLLER_LIB_DEFAULT := m1s1
15+
BLECONTROLLER_LIB_PREFIX := blecontroller_602_
16+
17+
CPPFLAGS += -I$(PROJECT_PATH)
18+
19+
-include ./proj_config.mk
20+
IOT_CORE_COMPONENTS := src
21+
IOT_CORE_COMPONENTS_REAL_PATH = $(abspath ${IOT_CORE_PATH}/src/)
22+
23+
ifeq ($(origin BL60X_SDK_PATH), undefined)
24+
BL60X_SDK_PATH_GUESS ?= $(shell pwd)
25+
BL60X_SDK_PATH ?= $(BL60X_SDK_PATH_GUESS)/../../../bsp/bl602
26+
$(info ****** Please SET BL60X_SDK_PATH ******)
27+
$(info ****** Trying SDK PATH [$(BL60X_SDK_PATH)])
28+
endif
29+
30+
COMPONENTS_NETWORK := sntp dns_server
31+
COMPONENTS_BLSYS := bltime blfdt blmtd blota bloop loopadc looprt loopset
32+
COMPONENTS_VFS := romfs
33+
34+
ifeq ($(CONFIG_BLECONTROLLER_LIB),all)
35+
COMPONENTS_BLECONTROLLER := $(addprefix $(BLECONTROLLER_LIB_PREFIX), $(BLECONTROLLER_LIBS))
36+
else
37+
ifeq ($(findstring $(CONFIG_BLECONTROLLER_LIB), $(BLECONTROLLER_LIBS)),)
38+
COMPONENTS_BLECONTROLLER := $(addprefix $(BLECONTROLLER_LIB_PREFIX), $(BLECONTROLLER_LIB_DEFAULT))
39+
else
40+
COMPONENTS_BLECONTROLLER := $(addprefix $(BLECONTROLLER_LIB_PREFIX), $(CONFIG_BLECONTROLLER_LIB))
41+
endif
42+
endif
43+
44+
ifeq ($(CONFIG_BT_TL),1)
45+
COMPONENTS_BLE := $(COMPONENTS_BLECONTROLLER)
46+
else
47+
COMPONENTS_BLE := $(COMPONENTS_BLECONTROLLER) blestack
48+
endif
49+
50+
INCLUDE_COMPONENTS += freertos_riscv_ram newlibc bl602 bl602_std newlibc wifi blcrypto_suite wifi_manager wpa_supplicant bl_os_adapter wifi_hosal hosal lwip lwip_dhcpd mbedtls_lts vfs yloop utils cli httpc netutils blog wifi_bt_coex
51+
INCLUDE_COMPONENTS += easyflash4 lwip_altcp_tls_mbedtls coredump rfparam_adapter_tmp
52+
INCLUDE_COMPONENTS += $(COMPONENTS_NETWORK)
53+
INCLUDE_COMPONENTS += $(COMPONENTS_BLSYS)
54+
INCLUDE_COMPONENTS += $(COMPONENTS_VFS)
55+
INCLUDE_COMPONENTS += $(PROJECT_NAME)
56+
57+
EXTRA_COMPONENT_DIRS ?= $(IOT_CORE_PATH)
58+
INCLUDE_COMPONENTS += src
59+
60+
ifeq ($(CONFIG_COMPONENT_BUGKILLER_ENABLE),1)
61+
INCLUDE_COMPONENTS += bugkiller_freertos
62+
endif
63+
64+
ifeq ($(CONFIG_BT),1)
65+
INCLUDE_COMPONENTS += $(COMPONENTS_BLE)
66+
ifeq ($(CONFIG_BT_MESH),1)
67+
INCLUDE_COMPONENTS += blemesh
68+
ifeq ($(CONFIG_BT_MESH_MODEL),1)
69+
INCLUDE_COMPONENTS += blemesh_model
70+
endif
71+
endif
72+
73+
ifeq ($(CONFIG_BT_MESH_SYNC),1)
74+
INCLUDE_COMPONENTS += blsync_ble
75+
endif
76+
ifeq ($(CONFIG_AUTO_PTS),1)
77+
INCLUDE_COMPONENTS += bleptstest
78+
endif
79+
endif
80+
CPPFLAGS += -include $(IOT_CORE_PATH)/src/include/iot_common.h
81+
include $(BL60X_SDK_PATH)/make_scripts_riscv/project.mk
82+
$(info !************ $(CFLAGS))
83+
84+
ifeq ($(CONFIG_BLECONTROLLER_LIB),all)
85+
LDFLAGS := $(filter-out $(addprefix -l$(BLECONTROLLER_LIB_PREFIX), $(filter-out $(BLECONTROLLER_LIB_DEFAULT), $(BLECONTROLLER_LIBS))), $(LDFLAGS))
86+
endif

apps/bl602/light_example/README.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# SmartThings SDK for Direct Connected Devices for C - Switch Example
2+
3+
## Introduction
4+
5+
SmartThings direct-connected device is Wi-Fi enabled device that uses the SmartThings cloud as its primary cloud infrastructure. And this device will use the MQTT protocol for communication.
6+
7+
## Getting started
8+
9+
For information on detailed workflow, please refer to the [Getting Started](../../../doc/getting_started.md)
10+
11+
## Components and Capabilities
12+
13+
SmartThings Device is defined using components and capabilities. Capabilities define the features of the device, and capabilities are grouped into components.
14+
Components and Capabilities are contained in device profile. You can create a device profile in Developer Workspace and associate it with an integration.
15+
16+
This example assumes the following component and capabilities are used. :
17+
18+
`main` component
19+
- `healthCheck` capability
20+
- `switch` capability
21+
- `switchLevel` capability
22+
- `colorTemperature` capability
23+
- `activityLightingMode` capability
24+
25+
`monitor` component
26+
- `dustSensor` capability
27+
28+
(`healthCheck` capability is automatically added by Developer Workspace. It doesn't need handler at device side)
29+
30+
## SmartThings SDK for Direct Connected Devices - Config
31+
If you want to use specific SmartThings Device SDK build options, you can directly modify the build configuration file. For this example, SmartThings Device SDK config is saved in 'proj_config.mk' file. If you want to change this, please execute the following :
32+
```sh
33+
$ cd ~/st-device-sdk-c-ref/
34+
$ vim apps/bl602/light_example/proj_config.mk
35+
```
36+
37+
## Test device schematics
38+
This example uses BL602 GPIO like below.
39+
Please refer below picture for __BL602-IoT-DVK-3S__.
40+
> Note: If your device's schematics doesn't match with belows.
41+
> Please modify GPIO defines for your device at [device_control.h](main/device_control.h)
42+
> ```c
43+
> #define GPIO_INPUT_BUTTON 1
44+
> #define GPIO_OUTPUT_COLORLED_R 4
45+
> #define GPIO_OUTPUT_COLORLED_G 5
46+
> #define GPIO_OUTPUT_COLORLED_B 3
47+
> ```
48+
49+
### BL602-IoT-DVK-3S
50+
| BL602-IoT-DVK-3S |
51+
|-------------------------------------------------------------------|
52+
|![BL602-IoT-DVK-3S](../../../doc/res/BL602-IoT-DVK-3S.jpg) |
53+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#
2+
# "main" pseudo-component makefile.
3+
#
4+
# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.)
5+
6+
include $(BL60X_SDK_PATH)/components/network/ble/ble_common.mk
7+
8+
ifeq ($(CONFIG_ENABLE_PSM_RAM),1)
9+
CPPFLAGS += -DCONF_USER_ENABLE_PSRAM
10+
endif
11+
12+
ifeq ($(CONFIG_ENABLE_CAMERA),1)
13+
CPPFLAGS += -DCONF_USER_ENABLE_CAMERA
14+
endif
15+
16+
ifeq ($(CONFIG_ENABLE_BLSYNC),1)
17+
CPPFLAGS += -DCONF_USER_ENABLE_BLSYNC
18+
endif
19+
20+
ifeq ($(CONFIG_ENABLE_VFS_SPI),1)
21+
CPPFLAGS += -DCONF_USER_ENABLE_VFS_SPI
22+
endif
23+
24+
ifeq ($(CONFIG_ENABLE_VFS_ROMFS),1)
25+
CPPFLAGS += -DCONF_USER_ENABLE_VFS_ROMFS
26+
endif
27+
28+
ifeq ($(CONFIG_TD_DIAGNOSIS_STA),1)
29+
CPPFLAGS += -DTD_DIAGNOSIS_STA
30+
endif
31+
32+
33+
# define json files list
34+
COMPONENT_EMBED_TXTFILES := onboarding_config.json device_info.json

0 commit comments

Comments
 (0)