BL_MCU_SDK Development Guide
release_v1.4.5

Quick Development Guide

  • 1. Preparation
  • 2. Hardware connection
  • 3. Development environment setup guide
    • 3.1. Windows_CDK
      • 3.1.1. Software and hardware environment
      • 3.1.2. Download CDK
      • 3.1.3. Download bl_mcu_sdk
      • 3.1.4. Hardware connection
      • 3.1.5. Test the Hello World project
        • Use Sipeed RV-Debugger
        • Use CK-Link
    • 3.2. Windows_eclipse
    • 3.3. Linux
  • 4. New Project Guide based on cmake framework
  • 5. New Project Guide based on CDK
  • 6. BLDevCube start guide
  • 7. Board Configuration System User Guide

API Manuals

  • 1. API Overview
  • 2. Peripheral
  • 3. BLE

Basic Peripheral Samples

  • 1. GPIO
  • 2. UART
  • 3. PWM
  • 4. MTIMER
  • 5. DMA
  • 6. SPI
  • 7. I2C
  • 8. ADC
  • 9. TIMER

Advance Samples

  • 1. SHELL Command Debugging
  • 2. FATFS Read And Write
  • 3. LowPower Evaluation
  • 4. BOOT2 IAP
  • 5. BLE Client And Server Interconnection
BL_MCU_SDK Development Guide
  • »
  • 3. Development environment setup guide »
  • 3.1. Guide to using CDK (like MDK Keil) under Windows »
  • Use CDK + CK-Link to compile and debug
  • 在 GitHub 上修改

Use CDK + CK-Link to compile and debug

Open Hello World

  • After obtaining the SDK, enter the examples/hellowd/helloworld/cdk directory in the SDK, double-click helloworld.cdkproj, and you can open the Helloworld project

Compile Hello World

helloworld.cdkproj

  • In the drop-down menu, you can select the CK_Link_Debug or OpenOCD_Debug project, this tutorial is based on the CK_Link_Debug project

  • In the CDK toolbar, click the compile icon to compile the project

    • Click the icon Build Project at 1 to compile the currently selected project

    • Click the icon Clean Project at 2 to clear the result of the last compilation

    • Click the 3 icon Flash Download to download the compiled code to the chip

    • Click the icon Start/Stop Debug at 4 to perform debugging related operations (when using CK-Link, you can load the code to flash first)

    • Click the 5 icon Start/Stop Debug whitout Download to debug directly without loading the current bin file

    • You can also right-click the project name in Project, and compile the project through the options in the right-click menu

Program Hello World

  • Since our flash algorithm is not currently included in the CDK software, we need to put the flash algorithm in the CDK installation directory. The specific operations are as follows:

    • Enter the tools\cdk_flashloader directory under the SDK directory

    • Copy the bl70x_flasher.elf file in the directory to the C-Sky\CDK\CSKY\Flash directory of the CDK tool

    CDK Flash Loader

CDK Project Setting

  • Click the project setting button in the Project View to open the Project Setting window, or open it through the Project menu bar

  • In the opened Project Setting window, select the Flash tab to configure the required Flash algorithm

CDK Project Flash setting

  • In the Flash tab, click the Add button, select the bl70x_flash algorithm in the opened list, and click Add to add it to the project. Others in Flash configuration, as shown in the figure:

  • After clicking OK, if the configuration is correct, click Flash Download to download the compiled code to the chip

CDK Flashdownload Success

  • If the download fails, please check:

      1. Whether the code is compiled correctly and generate files such as .elf, .bin, etc.

      1. Is the Flash algorithm correctly set?

      1. Whether the CK-Link and the board are properly connected

      1. Whether the development board is powered normally and whether the power indicator is on

Run Hello World

  • From the menu bar of the CDK View->Serial Pane, open the serial port panel, right-click in the opened Serial Pane, set the serial port, select your corresponding serial port number and baud rate

../_images/cdk4.png

CDK Serial Pane setting

  • Press the RST key on the board, you can see the result of the code in the serial port

HelloWorld!

Debug Hello World

  • Click the Start/Stop Debugger button at the top of the toolbar to enter the debug interface, as shown in the figure below

Debug HelloWorld!

  • In the debug interface, the Register window can view the CPU internal register data; the Peripherals peripheral panel, you can view the corresponding peripheral register data, the top menu bar Peripherals-> System Viewer can select peripherals; click the relevant debugging button in the upper toolbar to perform operations such as breakpoint setting, single-step debugging, single-step instruction, and full-speed operation. Of course, these operations have corresponding shortcut keys and shortcut setting methods. For details, please refer to CDK Help.

  • We click the single step button to run the code, and we can see that the cursor moves to the next sentence of code, and we can see our output Hello World! displayed in the serial port panel.

Debug HelloWorld!

上一页 下一页

© 版权所有 2021, BouffaloLab Co., Ltd. 修订 4b4e4c95.

利用 Sphinx 构建,使用了 主题 由 Read the Docs开发.