Skip to content

Commit 2255922

Browse files
committed
feat : Release SDK(iot-core) v2.2.4
Signed-off-by: Junyoun <[email protected]>
1 parent bdc7e1a commit 2255922

Some content is hidden

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

60 files changed

+23223
-16
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
[submodule "bsp/bl602"]
88
path = bsp/bl602
99
url = https://github.com/bouffalolab/bl_iot_sdk.git
10+
[submodule "bsp/bk7236"]
11+
path = bsp/bk7236
12+
url = https://oauth2:[email protected]/armino/bk_idk.git

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Install the toolchain defined in the chipset SDK you use according to the direct
5252
ex) python setup.py esp32c3
5353
ex) python setup.py esp32s3
5454
ex) python setup.py bl602
55+
ex) python setup.py bk7236
5556
```
5657

5758
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.
@@ -85,7 +86,10 @@ Install the toolchain defined in the chipset SDK you use according to the direct
8586
$ python build.py esp32s3 switch_example
8687
8788
# For other bl602 chipset series.
88-
$ python build.py apps/bl602/switch_example
89+
$ python build.py apps/bl602/switch_example
90+
91+
# For bk7236 chipset.
92+
$ python build.py apps/bl602/switch_example
8993
```
9094
9195
### Flash and Monitor
@@ -97,6 +101,7 @@ The serial port of your device must to be matched to the computer environment fo
97101
|-------|----------------------|------------------------|--------|------|---|
98102
|ESP32|115200|74880|8|None|1|
99103
|BL602|2000000|2000000|8|None|1|
104+
|BK7236|115200|115200|8|None|1|
100105
101106
#### Flashing
102107
@@ -135,6 +140,7 @@ Available Options:
135140
$ python build.py esp32c3 switch_example flash monitor
136141
$ python build.py esp32s3 switch_example flash monitor
137142
```
143+
138144
##### bl602 Example :
139145
140146
- **clean**: clean previous build outputs
@@ -150,6 +156,31 @@ Available Options:
150156
$ python build.py apps/bl602/switch_example monitor /dev/ttyACM0
151157
```
152158
159+
##### BK7236 Example:
160+
161+
Available Options:
162+
163+
- **clean**: clean previous build outputs
164+
```sh
165+
# python build.py {app_path} {options}
166+
$ python build.py apps/bk7236/switch_example clean
167+
```
168+
- **flash**: download executable binaries to the device
169+
```sh
170+
# python build.py {app_path} {flash} {port}
171+
$ python build.py apps/bk7236/switch_example flash /dev/ttyACM0
172+
```
173+
- **erase flash**: download executable binaries to the device
174+
```sh
175+
# python build.py {app_path} {flash} {port}
176+
$ python build.py apps/bk7236/switch_example erase_flash /dev/ttyACM0
177+
```
178+
- **monitor**: monitor the serial output of device. this option can be used with flash option.
179+
```sh
180+
# python build.py {app_path} {monitor} {port}
181+
$ python build.py apps/bk7236/switch_example monitor /dev/ttyACM0
182+
```
183+
153184
## Commercialization
154185
155186
For commercialization, refer to the following [link](https://github.com/SmartThingsCommunity/st-device-sdk-c/blob/main/doc/Commercialization_Guide).
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# The following lines of boilerplate have to be in your project's
2+
# CMakeLists in this exact order for cmake to work correctly
3+
cmake_minimum_required(VERSION 3.5)
4+
5+
include($ENV{ARMINO_PATH}/tools/build_tools/cmake/project.cmake)
6+
7+
project(light_example)
8+
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# SmartThings SDK for Direct Connected Devices for C - Light 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 components 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 'sdkconfig' file. If you want to change this, please execute the following :
32+
```sh
33+
$ cd ~/st-device-sdk-c-ref/
34+
$ vim app/bk7236/switch_example/config/bk7236/config
35+
```
36+
37+
## Test device schematics
38+
This example uses BK7236 GPIO like below.
39+
Please refer below picture for __BK7236-DevKitC__.
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+
>
44+
> #define GPIO_INPUT_BUTTON 28
45+
> #define GPIO_OUTPUT_MAINLED_G ( GPIO_32 )
46+
> #define GPIO_OUTPUT_MAINLED_R ( GPIO_34 )
47+
> #define GPIO_OUTPUT_MAINLED_B ( GPIO_36 )
48+
>
49+
> ```
50+
51+
### BK7236-DevKitC
52+
| BK7236 DevKitC |
53+
|-------------------------------------------------------------------|
54+
|![BK7236_DEVKITC](../../../doc/res/Light_Example_BK7236_DEVKITC.PNG) |
55+
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#
2+
# Log output
3+
#
4+
CONFIG_LOG_DEFAULT_LEVEL_NONE=
5+
CONFIG_LOG_DEFAULT_LEVEL_ERROR=
6+
CONFIG_LOG_DEFAULT_LEVEL_WARN=
7+
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
8+
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=
9+
CONFIG_LOG_DEFAULT_LEVEL_VERBOSE=
10+
CONFIG_LOG_DEFAULT_LEVEL=3
11+
CONFIG_LOG_COLORS=y
12+
CONFIG_LOG_SET_LEVEL=
13+
14+
CONFIG_CJSON_USE=y
15+
16+
CONFIG_TASK_WDT=n
17+
18+
CONFIG_STDK_DEBUG_MEMORY_CHECK=y
19+
20+
CONFIG_STDK_IOT_CORE=y
21+
CONFIG_STDK_IOT_CORE_LOG_LEVEL_ERROR=y
22+
CONFIG_STDK_IOT_CORE_LOG_LEVEL_WARN=y
23+
CONFIG_STDK_IOT_CORE_LOG_LEVEL_INFO=y
24+
CONFIG_STDK_IOT_CORE_LOG_LEVEL_DEBUG=
25+
26+
27+
CONFIG_STDK_IOT_CORE_BSP_SUPPORT_BK7236=y
28+
29+
CONFIG_STDK_IOT_CORE_EASYSETUP_BLE=y
30+
# CONFIG_STDK_IOT_CORE_EASYSETUP_HTTP=y
31+
# CONFIG_STDK_IOT_CORE_EASYSETUP_DISCOVERY_SSID=y
32+
CONFIG_LWIP_USE_HTTPD_FOR_EASYSETUP=y
33+
CONFIG_STDK_IOT_CORE_EASYSETUP_DISCOVERY_ADVERTISER=y
34+
# CONFIG_STDK_IOT_CORE_EASYSETUP_WIFI_UPDATE=y
35+
36+
#mbedtls
37+
#CONFIG_FULL_MBEDTLS=y
38+
#CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y
39+
CONFIG_STDK_IOT_CORE_CRYPTO_SUPPORT_ED25519=y
40+
41+
CONFIG_STDK_IOT_CORE_OS_SUPPORT_FREERTOS:=y
42+
CONFIG_STDK_IOT_CORE_USE_MBEDTLS:=y
43+
CONFIG_STDK_IOT_CORE_NET_MBEDTLS:=y
44+
# CONFIG_MBEDTLS_ECDH_LEGACY_CONTEXT:=y
45+
CONFIG_STDK_IOT_CORE_SECURITY_BACKEND_SOFTWARE:=y
46+
47+
#cli
48+
CONFIG_WIFI_CLI_ENABLE=n
49+
CONFIG_CLI=n
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
armino_component_register(SRCS "main.c"
2+
"device_control.c"
3+
"caps_activityLightingMode.c"
4+
"caps_colorTemperature.c"
5+
"caps_dustSensor.c"
6+
"caps_switch.c"
7+
"caps_switchLevel.c"
8+
EMBED_FILES "device_info.json"
9+
"onboarding_config.json"
10+
)
11+
12+
set(PROJECT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../")
13+
set(STDK_IOT_CORE_USE_DEFINED_CONFIG "y")
14+
set(STDK_CORE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../../iot-core")
15+
add_subdirectory(${STDK_CORE_PATH} iotcore)
16+
#add_subdirectory($ENV{STDK_CORE_PATH} iotcore)
17+
target_link_libraries(${COMPONENT_LIB} PUBLIC iotcore)
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
menu "Example Configuration"
2+
3+
config WIFI_SSID
4+
string "WiFi SSID"
5+
default "myssid"
6+
help
7+
SSID (network name) for the example to connect to.
8+
9+
config WIFI_PASSWORD
10+
string "WiFi Password"
11+
default "mypassword"
12+
help
13+
WiFi password (WPA or WPA2) for the example to use.
14+
Can be left blank if the network has no security set.
15+
16+
config MQTT_BROKER
17+
string "MQTT broker"
18+
default "mosquitto.org"
19+
help
20+
MQTT broker which you want to login, either IP address or domain name is OK.
21+
22+
config MQTT_PORT
23+
int "Default MQTT port"
24+
default 1883
25+
help
26+
MQTT port.
27+
28+
config MQTT_SUB_TOPIC
29+
string "MQTT subscribe topic"
30+
default "/espressif/sub"
31+
help
32+
MQTT subscribe topic to MQTT broker.
33+
34+
choice MQTT_SUB_QOS
35+
prompt "MQTT Subscribe QoS"
36+
default SUB_QOS1
37+
help
38+
MQTT subcribe QoS level.
39+
40+
config SUB_QOS0
41+
bool "QOS0"
42+
config SUB_QOS1
43+
bool "QOS1"
44+
config SUB_QOS2
45+
bool "QOS2"
46+
endchoice
47+
48+
config DEFAULT_MQTT_SUB_QOS
49+
int
50+
default 0 if SUB_QOS0
51+
default 1 if SUB_QOS1
52+
default 2 if SUB_QOS2
53+
54+
config MQTT_PUB_TOPIC
55+
string "MQTT publish topic"
56+
default "/espressif/pub"
57+
help
58+
MQTT publish topic to MQTT broker.
59+
60+
choice MQTT_PUB_QOS
61+
prompt "MQTT publish QoS"
62+
default PUB_QOS1
63+
help
64+
MQTT publish QoS level.
65+
66+
config PUB_QOS0
67+
bool "QOS0"
68+
config PUB_QOS1
69+
bool "QOS1"
70+
config PUB_QOS2
71+
bool "QOS2"
72+
endchoice
73+
74+
config DEFAULT_MQTT_PUB_QOS
75+
int
76+
default 0 if PUB_QOS0
77+
default 1 if PUB_QOS1
78+
default 2 if PUB_QOS2
79+
80+
config MQTT_PUBLISH_INTERVAL
81+
int "MQTT publish interval(ms)"
82+
default 0
83+
help
84+
Default MQTT publish message interval.
85+
86+
config MQTT_PAYLOAD_BUFFER
87+
int "MQTT payload size(Bytes)"
88+
default 1460
89+
help
90+
1460~2048 is recommended.
91+
MQTT payload size.
92+
93+
config LOG_DEFAULT_LEVEL_NONE
94+
bool "log level none"
95+
default n
96+
help
97+
Default log level none.
98+
99+
config LOG_DEFAULT_LEVEL_ERROR
100+
bool "log level error"
101+
default n
102+
help
103+
Default log level error.
104+
105+
config LOG_DEFAULT_LEVEL_WARN
106+
bool "log level info"
107+
default n
108+
help
109+
Default log level warning.
110+
111+
config LOG_DEFAULT_LEVEL_INFO
112+
bool "log level info"
113+
default n
114+
help
115+
Default log level info.
116+
117+
config LOG_DEFAULT_LEVEL_DEBUG
118+
bool "log level debug"
119+
default n
120+
help
121+
Default log level debug.
122+
123+
config LOG_DEFAULT_LEVEL_VERBOSE
124+
bool "log level verbose"
125+
default n
126+
help
127+
Default log level verbose.
128+
129+
config LOG_DEFAULT_LEVEL
130+
int "log level"
131+
default 0
132+
help
133+
Default log level.
134+
135+
config LOG_COLORS
136+
bool "log colors"
137+
default n
138+
help
139+
Default log colors.
140+
141+
config LOG_SET_LEVEL
142+
int "log set level"
143+
default 0
144+
help
145+
Default log set level.
146+
147+
config STDK_DEBUG_MEMORY_CHECK
148+
bool "stdk debug memory check"
149+
default n
150+
help
151+
Default stdk debug memory check.
152+
153+
config STDK_IOT_CORE
154+
bool "stdk iot core flag"
155+
default n
156+
help
157+
Default stdk iot core flag.
158+
159+
config STDK_IOT_CORE_LOG_LEVEL_ERROR
160+
bool "stdk iot core log level error"
161+
default n
162+
help
163+
Default stdk iot core log level error.
164+
165+
config STDK_IOT_CORE_LOG_LEVEL_WARN
166+
bool "stdk iot core log level warning"
167+
default n
168+
help
169+
Default stdk iot core log level warning.
170+
171+
config STDK_IOT_CORE_LOG_LEVEL_INFO
172+
bool "stdk iot core log level info"
173+
default n
174+
help
175+
Default stdk iot core log level info.
176+
177+
config STDK_IOT_CORE_LOG_LEVEL_DEBUG
178+
bool "stdk iot core log level debug"
179+
default n
180+
help
181+
Default stdk iot core log level debug.
182+
183+
rsource "${STDK_CORE_PATH}/src/Kconfig"
184+
185+
endmenu

0 commit comments

Comments
 (0)