Git Product home page Git Product logo

doiting_bl's Introduction

入门指南

概述

BL602/BL604 是博流智能推出的一款 Wi-Fi + BLE 组合的芯片组,用于低功耗和高性能应用开发。 无线子系统包含 2.4G 无线电,Wi-Fi 802.11b/g/n 和 BLE 5.0 基带/MAC 设计。微控制器子系统包含一个低功耗的 32位 RISC CPU,高速缓存和存储器。电源管理单元控制低功耗模式。此外,还支持各种安全性能。 外围接口包括 SDIO,SPI,UART,I2C,IR remote,PWM,ADC,DAC,PIR 和 GPIO。

准备

  • 一块BL602开发板
  • USB 数据线 (A 转 Micro-B)
  • 一台PC主机

开发流程

以下演示Linux环境下的开发流程,其他开发环境请参考docs

搭建开发环境

  1. 准备一台Linux主机,win10用户可使用Liunx子系统
  2. 打开终端,安装make,命令sudo apt-get install make
    • 国内用户可更改镜像源,加快安装速度
  3. 安装git,命令sudo apt-get install git
  4. 克隆仓库git clone https://github.com/SmartArduino/Doiting_BL.git
  5. 修改权限,运行以下两条命令
    chmod -R 777 ./Doiting_BL/bl_iot_sdk/toolchain/
    find ./Doiting_BL/bl_iot_sdk/customer_app -name "genromap"|xargs chmod 777
    

编译

以下使用hello-world为例

  • 由于工具链以放在SDK中,故无需再下载工具链,可直接编译
  1. 进入例程目录,命令cd Doiting_BL/bl_iot_sdk/customer_app/sdk_app_helloworld/
  2. 使用项目提供的sh脚本进行编译,命令./genromap
  3. 编译完成提示:
    Generating BIN File to /home/hogc/Doiting_BL/bl/bl_iot_sdk/ customer_app/sdk_app_helloworld/build_out/sdk_app_helloworld.bin
    Building Finish. To flash build output.
    

固件烧录

  1. 将开发板连接到电脑,请确保已安装串口驱动,win10自动安装
  2. 打开烧录工具,存放路径:Doiting_BL\bl_iot_sdk\tools\flash_tool
  3. 芯片类型选择:BL602/604
  4. 将Interface选择为Uart,并选择开发板相应的串口
  5. 选择固件
    1. 将Partition Table、Boot2 Bin、Firmware Bin选项卡打勾
    2. 为Partition Table添加文件,点击Partition Table后的Browse,选择partition_cfg_2M.toml
    3. 点击Boot2 Bin后的Browse,选择blsp_boot2.bin
    4. 点击Firmware Bin后的Browse,找到sdk_app_helloworld目录下的build_out,选择sdk_app_helloworld.bin
  6. 使开发板进入烧录模式,按住D8(GPIO8)按键,再按一次EN键,再松开D8键
  7. 点击Create&Download,进度条变绿,显示Success即为显示成功

验证固件

  1. 使用串口工具,连接开发板
    • 波特率:2000000 数据位:8 校验位:None 停止位:1
  2. 打开串口,复位开发板(点击EN键)
  3. 显示以下,即为运行成功
    [helloworld]   start
    [helloworld]   helloworld
    [helloworld]   end
    

SDK和项目分离

  1. 打开Linux终端,配置profile文件,命令vim ~/.profile
  2. 添加环境变量,填写真实的路径
    export BL60X_SDK_PATH="$HOME/Doiting_BL/bl_iot_sdk"
    

注意

  • 烧录可能会自动升级,Partition文件可能会不一样,若程序运行不正常可更换此Partition文件partition_cfg_2M.toml
  • 烧录后进度条出现红色,请再次尝试,或先使用串口工具连接,正确进入下载模式,串口会一直打印东西

资源

doiting_bl's People

Contributors

hogc avatar smartarduino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

doiting_bl's Issues

This project is over quota on GitHub

I've successful checked out (and landed patches in) the PineNut master Bouffalo projects. Unfortunately, checking out this project is broken.

% git clone https://github.com/SmartArduino/Doiting_BL.git
Cloning into 'Doiting_BL'...
remote: Enumerating objects: 55, done.
remote: Counting objects: 100% (55/55), done.
remote: Compressing objects: 100% (32/32), done.
remote: Total 22429 (delta 22), reused 54 (delta 22), pack-reused 22374
Receiving objects: 100% (22429/22429), 376.86 MiB | 43.20 MiB/s, done.
Resolving deltas: 100% (14749/14749), done.
Updating files: 100% (26746/26746), done.
Downloading bl_iot_sdk/tools/flash_tool/BLDevCube (108 MB)
Error downloading object: bl_iot_sdk/tools/flash_tool/BLDevCube (913d571): Smudge error: Error downloading bl_iot_sdk/tools/flash_tool/BLDevCube (913d5719bf1e68c7b928f4fdd2c65042a4dbe9281f7190641ea31cd28fbba692): batch response: This repository is over its data quota. Account responsible for LFS bandwidth should purchase more data packs to restore access.

Errors logged to /Users/ME/tmp/Doiting_BL/.git/lfs/logs/20210117T024721.232575.log
Use git lfs logs last to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: bl_iot_sdk/tools/flash_tool/BLDevCube: smudge filter lfs failed
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

I did dome experimentation with the cmds above (git restore ...) and got a somewhat manageable subset to my system, but it was always doomed as the resulting tree seemed damaged and was missing thousands of files. A fresh checkout that failed like this results in ~26K of missing files. As such, I'm asking for at least English docs that explain this situation and a solution or workaround, please.

UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 4927: character maps to <undefined>

Trying to flash anything and I get this error

========= eflash loader config =========
=========c:\source\doiting_bl\bl_iot_sdk\tools\flash_tool\bl602\device_tree/bl_factory_params_iotkita_40m.dtsbl602/device_tree/ro_params.dtb=========
Traceback (most recent call last):
File "core\bflb_simple_flasher.py", line 814, in flasher_download_thread
File "core\bflb_simple_flasher.py", line 736, in flasher_download_cfg_ini_gen
File "core\bflb_simple_flasher.py", line 543, in bl60x_mfg_flasher_eflash_loader_cfg
File "lib\bflb_ro_params_device_tree.py", line 29, in bl_ro_params_device_tree
File "lib\bflb_ro_params_device_tree.py", line 17, in bl_dts2dtb
File "C:\Python37-32\lib\encodings\cp1252.py", line 23, in decode
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 4927: character maps to

image

flash via linux

hi, seem like flashtool just support windows. so, how i can flash firmware via linux?

hello-world例程编译报错

:~/share/self_dir/wifi/bl_iot_sdk/customer_app/sdk_app_helloworld$ ./genromap
****** Please SET BL60X_SDK_PATH ******
****** Trying SDK PATH [/home/jinghaoxin/share/self_dir/wifi/bl_iot_sdk/customer_app/sdk_app_helloworld/../..]
use exsting version.txt file
make[1]: *** No rule to make target /home/hogc/build-tools/sdk/bl/bl_iot_sdk/components/stage/blog/blog.c', needed by blog.o'. Stop.
make[1]: *** No rule to make target /home/hogc/build-tools/sdk/bl/bl_iot_sdk/components/stage/blog_testc/blog_testc.c', needed by blog_testc.o'. Stop.
make[1]: *** No rule to make target /home/hogc/build-tools/sdk/bl/bl_iot_sdk/components/sys/blmtd/bl_mtd.c', needed by bl_mtd.o'. Stop.
CC build_out/bloop/src/bloop_base.o
make: *** [component-blmtd-build] Error 2make[1]: ***
make: No rule to make target /home/hogc/build-tools/sdk/bl/bl_iot_sdk/components/sys/bltime/bl_sys_time.c', needed by bl_sys_time.o'*** Waiting for unfinished jobs....
. Stop.
make: *** [component-blog-build] Error 2
make: *** [component-blog_testc-build] Error 2
make: *** [component-bltime-build] Error 2

请帮忙看下,谢谢

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.