This document introduces the use of eclipse under Windows to build a software development environment for BL702 series MCU.
- Eclipse free installation package
- Serial port assistant software
- A USB Type-A data cable
- A j-link emulator
- A USB-TTL serial port module
- Several Dupont lines
- Download the installation package with the RISC-V toolchain from the Bouffalo Lab developer community Eclipse https://dev.bouffalolab.com/download .
- Download from the open source community bl_mcu_sdk.
- You can use
git clone
or directlydownload
to download the SDK - Before using
git clone
, please make sure thatgit
has been installed correctly. Open a terminal that supportsgit
and enter the following command to get the latest SDK.
$ git clone https://gitee.com/bouffalolab/bl_mcu_sdk.git --recursive
Copy the eclipse compressed package to the working directory, unzip the eclipse compressed package
Enter the eclipse directory, double-click
eclipse.exe
to start eclipseSelect your
Workspace
directory, clickLaunch
to enter the workspaceClick
Window->preferences
in the menu bar to open the environment configuration related page, ready to import the related configuration environment- Click the icon at "1" in the figure below to open the import configuration interface, follow the steps shown in the figure, and select the
bflb_mcu_preferences.epf
configuration file in theeclipse.exe
directory.
- Click the icon at "1" in the figure below to open the import configuration interface, follow the steps shown in the figure, and select the
After selecting the corresponding file, click
Finish
, select and clickcancel
in the dialog box without restarting.
Click on the menu bar
File->Import
to open the configuration interface of the imported projectIn the opened
Import
window, selectGeneral->Existing Projects into Workspace
, and then clickNext
After loading the project path of bl_mcu_sdk, click
Finsh
to complete the importAfter the import is complete, close the
Welcome
window to see the imported projectExpand
Build Target
, you can see the three function buttonsbl_clean
,bl_make
, anddownload
.- Double-click the
bl_clean
button, it will clear the compilation cache in thebuild
andout
directories - Double-click the
bl_make
button, the set case will be compiled normally, if the default configuration is not modified, thehelloworld
project will be compiled - Double-click the
download
button, the code will be downloaded to the chip, if it is not compiled successfully, the default or last.bin
file will be downloaded
- Double-click the
- For specific board connection, please refer to :ref:`connect_hardware`; (The eclipse environment recommends using
j-link
for programming and debugging) - Please make sure that the development board is set up correctly before proceeding to the following steps
- Open
examples/hellowd/helloworld/main.c
, you can edit and modify the code of thehelloworld
test demo. If you modify it, please save it and execute the compilation
- Double click
bl_make
to compile the helloworld project - After successful compilation, you can see the log information as shown in the figure below in the
Console
window
- Double-click
download
to program the helloworld projectbin
file to the chip - After the download is successful, you can see the log information as shown in the figure below in the
Console
window
- Connect the
TXD0
,RXD0
andGND
pins of the board to the USB-TTL serial port module with a DuPont cable, insert the serial port module into the PC, and use any serial port assistant software to open the serial port - After the programming is successful, press the
rst
button on the board. If the download is correct, you can see the log information as shown in the figure below in the serial port assistant software.
- Click the
Debug
button in the eclipse toolbar to enter the debug configuration window - Select
GDB SEGGER J-Link Debugging->Jlink_bl_mcu_sdk
, select the.elf
file that needs to be debugged inC/C++ Application:
- Click
Apply
first, then clickDebug
to startDebug
- After entering the Debug interface, you can see that the program stops at
main
, click theStep Over
button in the upper toolbar to perform single-step debugging of the code project.
- When you right-click the
bl_make
button and clickEdit
, the configuration interface for replacing the target project will pop up, as shown in the figure below
- Where
APP=xxx
can be changed to the name of the target project that needs to be compiled and programmed. For example, if you want to compile and program thegpio/gpio_blink
project, modify it toAPP=gpio_blink
. make BOARD=bl706_iot
inBuild command
will specify different Board types to adapt to different types of boards.- The
Board
type determines the correspondingborad
header file when compiling. The default selection ismake build BOARD=bl706_iot