如何在泰凌微官方SDK基础上构建自己工程

1.选择工作空间

打开Telink IDE1.3时选择B85M_SINGLE_BLE_SDK

2.导入工程

File->Import..->General->Exist Projects into Worksapces
Select root directory->Browse…->B85M_SINGLE_BLE_SDK\b85_ble_sdk

3.新建8258_ble_demo工程

步骤1

Project->Properties->C/C++ Build->Setting ->Manage Configurations…->New…
Name:825x_ble_demo
Existing configuration:825x_ble_sample(选择想要参考的已有工程)
OK
选择825x_ble_demo->Set Active
OK

步骤2

TC32 Compliler->Symbols
双击__PROJECT_8258_BLE_XXX__=1 将其编辑为 PROJECT_8258_BLE_DEMO=1
OK

步骤3

TC32 Create Extended Listing->General
Output Filename:825x_ble_demo.lst
Apply

步骤4

TC32 Create Flash image->General
Output Filename:825x_ble_demo.bin
Apply->OK

步骤5

复制文件夹b85m_ble_sample到vendor/,重命名为b85m_ble_demo,右键refresh

步骤6

在vendor/common/user_config.h中添加:

1
2
#elif (__PROJECT_8258_BLE_DEMO__)
#include "vendor/b85m_ble_demo/app_config.h"

步骤7

在8258_ble_demo/app_config.h中:

1
#if (__PROJECT_8258_BLE_SAMPLE__)

改为:

1
#if (__PROJECT_8258_BLE_DEMO__)

步骤8

选中b85m_ble_demo,右键->Resource Configurations->Exclude from Build,除b85m_ble_demo外都划勾->OK
选中b85m_ble_sample,右键->Resource Configurations->Exclude from Build,其它不动,给b85m_ble_demo划勾->OK

常见问题

  1. 不要使用中文路径,可能引起编译报错

  2. 如何更改字体大小?

    Window->Preferences->General->Appearance->Colors and Fonts->C/C++->Editor

  3. 可以使用中文进行注释,但是必须是utf-8格式, IDE默认使用GBK编码,需要修改为utf-8

    Project->Properties->Resource->Text file encoding->Other:UTF-8

  4. IDE跳转错误如何解决?

    Project->Properties->C/C++ General->Indexer 勾选 Enable project specific settings、Store settings with project 和 Use a fixed build configuration Apply->OK
    选中b85m_ble_sample,右键->Clean Project
    选中b85_ble_sdk,右键->Index->Rebuild
    重新编译

  5. 如何自动保存更改的代码?

    Window->Preferences搜save
    General->Workspace勾选Save automatically before build
    Apply->OK

  6. 如何添加头文件目录?

    Project->Properties->C/C++ General->Paths and Symbols->Includes->GNU C->Add
    仿照其他路径输入并勾选is a workspace path

  7. 如何添加库文件目录?

    Project->Properties->C/C++ General->Paths and Symbols->Libraries->Add

  • 版权声明: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处!

扫一扫,分享到微信

微信分享二维码
  • Copyrights © 2024-2025 xgclevo
  • 访问人数: | 浏览次数:

请我喝杯咖啡吧~

支付宝
微信