Follow+Star Public Account Number, don’t miss out on exciting content
Many friends have asked in the background whether it is possible to develop applications based on JieliSDK without installing the Jieli visualization tool.
The Jieli VisualizationSDK supports compilation using makefile in both Windows and Linux environments. By default, the SDK supports compilation and downloading in the Windows environment, while in the Linux environment, it only supports compilation. When the SDK is released, it defaults to publishing not only the Code::Blocks project with the cbp extension but also the Makefile and VSCode configurations. Therefore, it is possible to develop Jieli SDK applications without using the Jieli visualization tool.
Compiling SDK with Makefile
The makefile file is used to define the build and compilation rules for software projects. It is a configuration file for the GNU Make tool, specifying a series of rules that indicate which files need to be compiled first, which files need to be compiled later, and which files need to be recompiled.
The makefile mainly consists of the following three parts:
Target: The file to be generated, such as an executable file or object file.
Dependencies: The files or other targets that the target depends on.
Commands: The commands that need to be executed to build the target.
In the root directory of the SDK, there is a Makefile file. Additionally, to support the SDK compilation using make, the SDK also comes with a tools directory containing the necessary compilation tools.
Open the makefile file in the project directory to see what targets are available.
In the terminal, enter make all -j16 or enter make -j to compile. The parameter -j represents the number of threads to use for compilation.
make -j: By default, the first target in the makefile is used, and if no thread count is specified, it defaults to the maximum threads of the cpu.
Method 1: Open the command line directly in the SDK root directory and navigate to the tools/utils directory to compile using make, enter make -j to compile.
Method 2 (Official Recommended Method):
1. Open the make_prompt.bat script in the tools directory under the SDK directory, as shown in the image below.
2. The make_prompt.bat file is a batch script for setting environment variables. After the command line window pops up, the script will automatically set the PATH used for compilation. Enter make -j and press Enter to automatically start the compilation program.
3. After the compilation is complete, the makefile post-processing script will automatically call the cpu\brxx\tools\download.bat script located at this path for downloading and flashing. The download.bat script will also automatically package and generate the fw or ufw flashing files.
Steps to Troubleshoot Makefile Compilation Errors
1. Check if there are spaces or Chinese characters in the path where the SDK is located (it cannot contain spaces or Chinese characters).
2. Check if the path where the SDK is located is too deep.
3. Check if the tools folder in the root directory of the SDK matches the tools folder in the conversion tool. Check for any missing files.
4. Check if the corresponding Code::Blocks project can compile, and confirm if there are any issues with the toolchain environment. If it compiles, then the Jieli toolchain is fine.
Generating Firmware with KEY for Flashing
Since Jieli chips are generally purchased from agents, the firmware that needs to be flashed must include a KEY. Therefore, when generating the flashing firmware, we generally need to fill in the KEY file.
We open the download.bat script located in SDK directory under cpu\brxx\tools\ and see that after finding the required bin file, it actually calls the download\earphone script located at this path.
Open the download/earphone/download.bat script to see that it calls the isd_download.exe along with the bin and parameters for downloading and flashing. The default parameters do not include the KEY for combining to generate the flashing firmware.
If you need to add the key parameter, you can directly modify this script, adding the modification at the end.
Finally, I wish all friends smooth development with no bugs.
———— END ———–
Follow me, sharing more Bluetooth headset software development content