GPRS C SDK Build environment installation
1. Pay Attention
important, please read first
SDK does not have a specific IDE, and the user chooses the code editor to edit the code.
When modifying the code, you must not use the notepad and writing board that windows brings. Please use a more professional editor (recommended as vscode, sublime, atom, eclipse, source insight, or other editors you are familiar with. )
Please modify the editor settings. The end of the file symbol is set to UNIX style (
\n) end), and file encoding is
if you are cloned using git, set the git at pull not to convert
<CR><LF>, set the method reference here
2. Download tool chain, debug tool and SDK
Download CSDTK4.2: baidu cloud,MEGA cloud，direct link
- download SDK
- or clone by git:
git clone https://github.com/Ai-Thinker-Open/GPRS_C_SDK.git --recursive(pay attention
--recursiveis needed, or compile will fail for lake of files)
- Check C_SDK
platform/csdkfolder, there should be some folders and file, if not, you may get source code with wrong way, check and download again
- Decompression to a folder, such as
C:\CSDTK, path please DO NOT bring Chinese!
config_env_admin.batfile in CSDTK to set environment value
What the script does is to create an environment variable named
GPRS_CSDTK42_PATH, which has a variable directory value of CSDTK. If the script fails, you can build it by yourself
Decompress the CSDK downloaded to
GPRS_C_SDKfolder into a directory, such as
C:\GPRS_C_SDK, use the underscore(_) instead of minus(-).
Step into CSDK folder(
C:\GPRS_C_SDK），right click mouse in th blank space in the folder with shift key pressed, then open with powersheel of cmd.
./build.bat app or
build.bat app to build app project, ensure our environment is ok.
If comes with
NO CSDTK error, you may need to restart you system(mostly appears on Win7).
Then you can use
./build.bat script to build project:
./build.bat $PROJ:compile app module，e.g.:
./build.batsh appto compile the source code of app folder
./build.bat demo $PROJ:compile demo project, e.g.:
./build.bat demo gpioto compile gpio demo
./build.bat clean $PROJ:clear the build files of
./build.bat clean all:clear all the build files
./build.bat demo $PROJ release:build a release version, e.g.:
./build.bat demo gpio release，if the last parameter is not
release, it will be default to
debugversion. The GDB can be used to debug errors after system crashed in
releaseversion can not, watch dog activate in release version,it will auto restart system when system crashed!
./build.sh demo gpio
build folder will be generated after compile, there's two
*.lod files in th
hex folder, it's the target file that burn(download) to dev board
- about target hex file(*.lod)
There's two hex file,(
*_flash.lod), you must burn the bigger one to dev board at the first time, then you can just burn the little one to reduce the doanload time. And you must download the bigger if you update the SDK version
5. Other Problems
If error occured, please compare the documents carefully to see if the operation is wrong，and find in issue
Way A: github add issue
Way B: Ai-Thinker forum