From d32ae7a5945e97ef04bd4c431991b55b4acfe06e Mon Sep 17 00:00:00 2001 From: wyhong Date: Thu, 21 Sep 2023 23:29:14 +0800 Subject: [PATCH] fix restyle --- examples/lighting-app/bouffalolab/README.md | 74 +++++++++++-------- .../common/iot_sdk/platform_port.c | 6 +- .../platform/bouffalolab/common/plat/main.cpp | 3 +- scripts/build/builders/bouffalolab.py | 3 +- .../flashing/bouffalolab_firmware_utils.py | 9 ++- 5 files changed, 57 insertions(+), 38 deletions(-) diff --git a/examples/lighting-app/bouffalolab/README.md b/examples/lighting-app/bouffalolab/README.md index 24af8643c22f78..c3938d819c5ec8 100644 --- a/examples/lighting-app/bouffalolab/README.md +++ b/examples/lighting-app/bouffalolab/README.md @@ -14,8 +14,8 @@ The steps were verified on `Bouffalo Lab` BL602 and BL706 development board. - `BL706DK` - `BL704LDK` -> Warning: Changing the VID/PID may cause compilation problems, we recommend leaving -> it as the default while using this example. +> Warning: Changing the VID/PID may cause compilation problems, we recommend +> leaving it as the default while using this example. ## BL602 @@ -27,11 +27,15 @@ BL602/BL604 is combo chip-set for Wi-Fi 802.11b/g/n and BLE 5.0 base-band/MAC. ## BL70x -BL70x is combo chip-set for BLE and IEEE 802.15.4/ZigBee/Thread. -- BL702/BL706 has 14dbm tx power and is recommended for routing devices. SDK uses BL702 as a general name. -- BL702L/BL704L is designed for low power application. SDK uses BL702L as a general name. +BL70x is combo chip-set for BLE and IEEE 802.15.4/ZigBee/Thread. -BL70x has fully certified with all Thread 1.3 features, included Thread `SSED` and Thread Border Router with `DUA manager`. +- BL702/BL706 has 14dbm tx power and is recommended for routing devices. SDK + uses BL702 as a general name. +- BL702L/BL704L is designed for low power application. SDK uses BL702L as a + general name. + +BL70x has fully certified with all Thread 1.3 features, included Thread `SSED` +and Thread Border Router with `DUA manager`. ### `XT-ZB6-DevKit` @@ -54,9 +58,9 @@ Mac OS. source ./scripts/activate.sh -p bouffalolab ``` - > After environment setup `Bouffalo Lab` flash tool, `bflb-iot-tool`, imports - > under this environment. If not, please try `scripts/bootstrap.sh -p bouffalolab` for - > matter environment update. + > After environment setup `Bouffalo Lab` flash tool, `bflb-iot-tool`, + > imports under this environment. If not, please try + > `scripts/bootstrap.sh -p bouffalolab` for matter environment update. - Setup build environment for `Bouffalo Lab` SoC @@ -76,8 +80,8 @@ Mac OS. ## Build CHIP Lighting App example -The following steps take examples for `BL602-IoT-Matter-V1` bl602 board, -BL706 develop `XT-ZB6-DevKit` and `BL706DK` bl706 board, and `BL704LDK` BL704L board . +The following steps take examples for `BL602-IoT-Matter-V1` bl602 board, BL706 +develop `XT-ZB6-DevKit` and `BL706DK` bl706 board, and `BL704LDK` BL704L board . - Build lighting app with UART baudrate 2000000 @@ -102,30 +106,40 @@ BL706 develop `XT-ZB6-DevKit` and `BL706DK` bl706 board, and `BL704LDK` BL704L b ./scripts/build/build_examples.py --target bouffalolab-bl602-iot-matter-v1-light-rpc build ./scripts/build/build_examples.py --target bouffalolab-xt-zb6-devkit-light-rpc build ``` + ### Build options with build_examples.py -- `-shell`, enable UART command line -- `-115200`, set UART baudrate to 115200 for log and command line -- `-rpc`, enable Pigweed RPC feature -- `-cdc`, enable USB CDC feature, only support for BL706, and can't work with Ethernet Board -- `-resetCnt`, enable feature to do factory reset when continues power cycle is greater than 3 -- `-mfd`, enable Matter factory data feature, which load factory data from `DTS` region and `MFD` partition - - Please contact to `Bouffalo Lab` for Matter factory data support. -- `-mfdtest`, enable Matter factory data module, but only load factory data from `FactoryDataProvider.cpp` file. -- `-wifi`, to specify that connectivity Wi-Fi is enabled for Matter application. -- `-ethernet`, to specify that connectivity Ethernet is enabled for Matter application. -- `-thread`, to specify that connectivity Thread is enabled for Matter application. -- `-fp`, to specify to enable frame pointer feature to print call stack when hit an exception for debug purpose. +- `-shell`, enable UART command line +- `-115200`, set UART baudrate to 115200 for log and command line +- `-rpc`, enable Pigweed RPC feature +- `-cdc`, enable USB CDC feature, only support for BL706, and can't work with + Ethernet Board +- `-resetCnt`, enable feature to do factory reset when continues power cycle + is greater than 3 +- `-mfd`, enable Matter factory data feature, which load factory data from + `DTS` region and `MFD` partition + - Please contact to `Bouffalo Lab` for Matter factory data support. +- `-mfdtest`, enable Matter factory data module, but only load factory data + from `FactoryDataProvider.cpp` file. +- `-wifi`, to specify that connectivity Wi-Fi is enabled for Matter + application. +- `-ethernet`, to specify that connectivity Ethernet is enabled for Matter + application. +- `-thread`, to specify that connectivity Thread is enabled for Matter + application. +- `-fp`, to specify to enable frame pointer feature to print call stack when + hit an exception for debug purpose. ## Download image - Using script `*.flash.py`. - After building gets done, python script `*.flash.py` will generate under build output - folder, such as - - `chip-bl602-lighting-example.flash.py` for BL602 - - `chip-bl702-lighting-example.flash.py` for BL702 - - `chip-bl702l-lighting-example.flash.py` for BL702L + After building gets done, python script `*.flash.py` will generate under + build output folder, such as + + - `chip-bl602-lighting-example.flash.py` for BL602 + - `chip-bl702-lighting-example.flash.py` for BL702 + - `chip-bl702l-lighting-example.flash.py` for BL702L > Note 1, `*.flash.py` should be ran under Matter build environment; if > python module `bflb_iot_tool` is not found, please try to do @@ -147,8 +161,8 @@ BL706 develop `XT-ZB6-DevKit` and `BL706DK` bl706 board, and `BL704LDK` BL704L b - Type following command for image download. Please set serial port accordingly, here we use /dev/ttyACM0 as a serial port example. - - `bl602-iot-matter-v1`, `xt-zb6-devkit` and `bl704ldk` without additional build - options + - `bl602-iot-matter-v1`, `xt-zb6-devkit` and `bl704ldk` without + additional build options ```shell ./out/bouffalolab-bl602-iot-matter-v1-light/chip-bl602-lighting-example.flash.py --port /dev/ttyACM0 diff --git a/examples/platform/bouffalolab/common/iot_sdk/platform_port.c b/examples/platform/bouffalolab/common/iot_sdk/platform_port.c index b670b134d76a9b..9ffd48ec10811b 100644 --- a/examples/platform/bouffalolab/common/iot_sdk/platform_port.c +++ b/examples/platform/bouffalolab/common/iot_sdk/platform_port.c @@ -179,7 +179,8 @@ void vAssertCalled(void) portABORT(); #endif - while (true); + while (true) + ; } #endif @@ -199,7 +200,8 @@ void __attribute__((weak)) user_vAssertCalled(void) printf("vAssertCalled, ra = %p in task %s\r\n", (void *) ra, pcTaskGetName(NULL)); } - while (true); + while (true) + ; } void __attribute__((weak)) user_vApplicationStackOverflowHook(TaskHandle_t xTask, char * pcTaskName) diff --git a/examples/platform/bouffalolab/common/plat/main.cpp b/examples/platform/bouffalolab/common/plat/main.cpp index 155c952c3e0b42..65e8efce1cc377 100644 --- a/examples/platform/bouffalolab/common/plat/main.cpp +++ b/examples/platform/bouffalolab/common/plat/main.cpp @@ -33,7 +33,8 @@ void appError(int err) { ChipLogProgress(NotSpecified, "!!!!!!!!!!!! App Critical Error: %d !!!!!!!!!!!", err); portDISABLE_INTERRUPTS(); - while (true) ; + while (true) + ; } void appError(CHIP_ERROR error) diff --git a/scripts/build/builders/bouffalolab.py b/scripts/build/builders/bouffalolab.py index 0c96e255be9820..245161c99f038a 100644 --- a/scripts/build/builders/bouffalolab.py +++ b/scripts/build/builders/bouffalolab.py @@ -261,4 +261,5 @@ def PostBuildCommand(self): os.system("cp " + ota_images_image + " " + ota_images_dev_image) logging.info("PostBuild:") - logging.info("Bouffalo Lab OTA format image without signature: " + self.app.AppNamePrefix(self.chip_name) + ".bin.xz.hash is generated.") + logging.info("Bouffalo Lab OTA format image without signature: " + + self.app.AppNamePrefix(self.chip_name) + ".bin.xz.hash is generated.") diff --git a/scripts/flashing/bouffalolab_firmware_utils.py b/scripts/flashing/bouffalolab_firmware_utils.py index cebd5fda0fdddc..402f0453936741 100644 --- a/scripts/flashing/bouffalolab_firmware_utils.py +++ b/scripts/flashing/bouffalolab_firmware_utils.py @@ -13,14 +13,15 @@ # See the License for the specific language governing permissions and # limitations under the License. +import importlib.metadata +import logging import os import pathlib import re +import shutil import sys -import logging + import coloredlogs -import shutil -import importlib.metadata import firmware_utils coloredlogs.install(level='DEBUG') @@ -182,7 +183,7 @@ def actions(self): except Exception as e: - logging.error('Please try the following command to setup or upgrade Bouffalo Lab enviroment:') + logging.error('Please try the following command to setup or upgrade Bouffalo Lab environment:') logging.error('source scripts/activate.sh -p bouffalolab') logging.error('Or') logging.error('source scripts/bootstrap.sh -p bouffalolab')