Welcome to a comprehensive tutorial designed to help you get started with the A9G board. By following these steps, we will set up the ideal environment for your future projects using this board. Our tool of choice will be the C SDK generously provided by Ai Tinker, ensuring a smooth and productive start to your A9G journey.
There are three distinct approaches to working with this module, each catering to different levels of expertise and control:
1. The Noob Way: In this method, a separate microcontroller is employed to communicate with the A9G board via the Software Serial method. It entails sending predefined AT commands to instruct the A9G to perform specific tasks. While accessible for beginners, it can be time-consuming and somewhat challenging due to its limited control. Fortunately, the AT command firmware comes preloaded when you purchase the board.
2. The Geek Way: This method involves flashing the A9G board with MicroPython firmware, allowing you to operate it using any suitable Integrated Development Environment (IDE) that supports MicroPython. While this approach simplifies coding for newcomers, it may abstract some low-level control for power users who prefer to delve deeper into the hardware.
3. The Absolute Pro Way: For those seeking maximum control and versatility, the Absolute Pro Way is the route to take. It entails flashing the C_SDK firmware provided by Ai Tinker onto the A9G board. Ai Tinker also maintains a dedicated C_SDK GitHub repository, replete with demo example codes for various functionalities like MQTT, calls, SMS, and GPS. The C_SDK program structure resembles an RTOS (Real-Time Operating System) template, making it adaptable for multi-tasking projects. This method eliminates the need for an extra microcontroller, affording you complete command over the A9G board.
About A9G boardThe board has the following features:
- 29 GPIOs (with 2 download debug pins (
HST_TX
,HST_RX
) - One SIM card slot (Nano Card <Micro Card <Standard Card)
- 1 TF card slot (micro SD card)
- 1 GPRS interface with IPEX 1 generation package (Antenna)
- 1 GPS interface with IPEX 1 generation package (Antenna)
- 1 micro USB interface (for power)
- Inbuild BMS
- 2 LED
- 1 microphone
- Speaker port
Below is the pinout of the A9G module:
The Environment setup requires Windows 10. You will need to download the following packages to get started:
- Download CSDTK4.2 -> Here
- Download C SDK -> https://github.com/Ai-Thinker-Open/GPRS_C_SDK
- Download VS Code -> https://code.visualstudio.com/download
Once you have downloaded all the required packages you can follow the following steps:
Step 1 (Extracting Packages):Unzip the CSDTK4.2 and C SDK to the C directory. Your C directory must look like this
As you can see I have one CSDTK4.2 and GPRS_C_SDK_V2112 (C SDK from GitHub).
Step 2 (Verify packages) :Go to the GPRS_C_SDK_V2112 folder and it should look like this:
Click the folder and it should look like this:
Go to the CSDK42 folder and it should look like this:
Click the CSTDK folder and then you will see the following files listed:
Once you verify that the contents in the folder match then you can proceed further.
Step 3 (Setup environment variables):Go to this location C:\CSDTK42\CSDTK42
on your computer and right click the config_env_admin.
Select run as Admin.
Your screen might flash and a terminal will open. once the installation is complete your current screen window will close.
To check if the installation was success go to the windows environment path variables and check if it looks like this:
If this was added then you have installed the C_SDK tool chain.
Step 4 (Compiling your first program):Go to this location C:\GPRS_C_SDK_V2112\GPRS_C_SDK
on your computer and open a power shell window here.
Type ./build.bat app
this command is used to compile the code in the app directory. The terminal should look like this.
After successful compilation go to C:\GPRS_C_SDK_V2112\GPRS_C_SDK\hex
you will find the app folder it contains all the hex files that are needed to be flashed on the A9G board.
Once you have compiled and generated the HEX files you can now flash the A9G with the program.
First connect the A9G board with the ftdio breakout board pins in the following order:
HST_TX
->RX
HST_RX
-> TX
GND
->GND
VCC
- >VCC
*The jumper should be switched in 5V mode.
Note down the serial port number to which the board is connected.
Perform the following steps to flash the A9G with the compiled code:
- Go to
C:\CSDTK42\CSDTK42\cooltools
and run coolwatcher it should look like this:
- Select the 8955 from the profile options. scroll down update the last comport option to the port number at which your A9G is connected to.
- In my case the board is connected at com port 4.
- once you have selected the necessary options then click ok this window will appear :
- To upload the firmware to the board first choose the flash programmer file
- The file is located at
C:\CSDTK42\CSDTK42\cooltools\chipgen\Modem2G\toolpool\plugins\fastpf\flash_programmers
choose host_8955_flsh_spi32m_ramrun.lod
file for the board.
- Now choose the HEX or LOD file it is located in the HEX folder in the C SDK directory its location is
C:\GPRS_C_SDK_V2112\GPRS_C_SDK\hex\app
- Choose the
app_B2112_debug.lod
file from the folder. This file will always be bigger in the size as compared to rest of the files.
- Once all the files have been selected click the flash icon as shown it will start to flash the board with the compiled firmware.
- The program which was uploaded to the board actually prints some text over the serial connection to see this click the
Plugins -> Activate Tracer
.
- The Tracer will open now click the play button to capture the data from the A9G board.
- From below you can see that the data printed is
Test
Test2
.
This tutorial empowers you to embark on application development directly on the A9G module's system-on-a-chip (SOC) thanks to its integrated RDA processor. While we've only scratched the surface here, the C SDK folder holds a wealth of example code, inviting you to explore and unleash your creativity.
Addition code (Blinky)The A9G board also comes with built in leds and the pin number of them are 27 and 28. If you want to write a Blinky program then you can Flash the Blinky program provided below to the A9G board. Once you open the coolwatcher you will find serial print messages.
Comments