Application of 4G communication module on ARM platform

Publisher:支持中文Latest update time:2020-02-22 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

4G module is an important carrier for connecting things to things, and is one of the core components for terminal devices to access the Internet of Things. With the popularization of 4G, the demand for 4G communication modules in many emerging markets is increasing, so how to quickly apply 4G modules on embedded devices on the ARM platform?


The 4G communication module integrates the frequency receiver and signal amplifier and other components together to achieve integration. With the development of industry, the demand for embedded devices to access the network is increasing. In an environment without wired or wireless networks such as WiFi, it is a good method to directly connect to the operator network through the 4G communication module to access the Internet. Therefore, this article will introduce to readers how to use the 4G module in Linux for embedded devices based on the ARM platform.


1. Development Environment

1. Development host environment:

Ubuntu12.04 (64-bit), arm-fls-linux-guneabi-gcc series cross-compilation chain.

2. Hardware List:

IoT-3960 industrial control board, Longshang 4G module U8300C or U8300W.

3. Software resources:

The kernel source code package in the CD EPC-280_283_287V1.04.iso is: linux-2.6.35.3-fec60fa.tar.bz2 (the CD content can be downloaded from the official website of ZHIYUAN Electronics http://www.zlg.cn).


2. Hardware Overview

IoT-3960L is an industrial IoT network controller developed by Guangzhou Zhiyuan Electronics Co., Ltd. with NXP i.MX287 processor as the core. It integrates multiple communication interfaces and supports multiple communication protocols. It has the characteristics of high cost performance, rich functions, stable operation and strong compatibility. The actual product is shown in Figure 1.

Figure 1 IoT-3960L industrial control board


Through the customized Mini-PCIE interface, IoT-3960L can expand 3G, 4G, GPRS, ZigBee, RFID and other wireless communication modules. The module expanded in this article is Longshang 4G module, and the model used is shown in Figure 2.

Figure 2 Longshang 4G modules U8300C and U8300W


3. Technical Implementation

1. Unzip the kernel source code

Copy the linux-2.6.35..3-fec60fa.tar.bz2 source package in the EPC-280_283_287 V1.04.iso CD to the "~/" directory of the Ubuntu system, and decompress it to get the linux-2.6.35.3 directory. The reference command is as follows:

vmuser@Linux-host:~$ tar -jxvf linux-2.6.35..3-fec60fa.tar.bz2

2. Modify the configuration file

The default configuration of CONFIG_GPIO_M28X macro is set in the Kconfig file under the kernel source directory "drivers/gpio/". Open this Kconfig file with the vim editor, search for "GPIO_M28X", find its configuration settings, and modify it to an independently configurable option. The modified configuration is as follows (the red mark is the modified part):

config GPIO_M28X

tristate "GPIO support for MiniPCI-E slot control"

#depends onIoT_3960 || IoT_3962

help

Say yes here to enable the IoT_396x boardgpio driver.

3. Modify the kernel compilation script

The build-kernel script file in the Linux source directory is mainly used to switch the kernel default configuration. However, since the script file in the CD is not flexible enough, it is recommended to directly replace the entire build-kernel text content with the code shown in the following list:

#!/bin/sh

echo "build menu, please select your choice:"

echo " 1 make clean"

echo "2 config for EPC_28xA"

echo "3 config for EPC_283 or EasyARM-i.MX283A"

echo "4 config for EPC_287 or EasyARM-i.MX287A"

echo " 5 config for EPC_280 or EasyARM-i.MX280A"

echo "6 config for IoT_3960"

echo "7 config for IoT_3962"

echo " 8 config for A287_W128LI"

echo " 9 config for A287_WB128LI"

echo " a make menuconfig"

echo " b make uImage"

echo " c make zImage"

echo "d make modules"

echo " q exit"

make_distclean() {

echo "make distclean"

make clean

}

config_EPC_28xA() {

echo "EPC_28xA"

cp .config .config.bk

cp arch/arm/configs/EPC_28xA_defconfig .config

}

config_EPC_283B() {

echo "EPC_283B"

cp .config .config.bk

cp arch/arm/configs/EPC_283B_defconfig .config

}

config_EPC_287B() {

echo "EPC_287B"

cp .config .config.bk

cp arch/arm/configs/EPC_287B_defconfig .config

}

config_EPC_280() {

echo "EPC_280"

cp .config .config.bk

cp arch/arm/configs/EPC_280_defconfig .config

}

config_IoT_3960() {

echo "IoT_3960"

cp .config .config.bk

cp arch/arm/configs/IoT_3960_defconfig .config

}

config_IoT_3962() {

echo "IoT_3962"

cp .config .config.bk

cp arch/arm/configs/IoT_3962_defconfig .config

}

config_A287_W128LI() {

echo "A287_W128LI"

cp .config .config.bk

cp arch/arm/configs/A287_W128LI_defconfig .config

}

config_A287_WB128LI() {

echo "A287_WB128LI"

cp .config .config.bk

cp arch/arm/configs/A287_WB128LI_defconfig .config

}

make_uImage() {

make uImage

}

make_zImage() {

make zImage

}

make_modules() {

make modules

}

make_menuconfig() {

make menuconfig

}

read sel

echo "select $sel"

case $sel in

[1]) make_distclean;;

[2]) config_EPC_28xA;;

[3]) config_EPC_283B;;

[4]) config_EPC_287B;;

[5]) config_EPC_280;;

[6]) config_IoT_3960;;

[7]) config_IoT_3962;;

[8]) config_A287_W128LI;;

[9]) config_A287_WB128LI;;

[a]) make_menuconfig;;

[b]) make_uImage;;

[c]) make_zImage;;

[d]) make_modules;;

[q] | [Q]) exit 0;;

*) echo "ONLY accept 1~9,a~d/q/Q"

esac

(Pull down to show more codes)


4. Configure kernel source code

Enter the root directory of the unpacked Linux source code and use the default kernel configuration of IoT-3960L. The reference command is as follows:

vmuser@Linux_host:~/linux-2.6.35.3$ ./build-kernel

Then enter 6 to select Iot3960. If it is other industrial control boards or development kits, select the corresponding options. If there is no .config file in the corresponding Linux source code root directory, a cp command execution error will be prompted after running this step. Just ignore this error.


The industrial control board or development kit uses the USB interface to communicate with the Longshang 4G module. The kernel needs to be configured to support the USB to serial port function. The reference command is as follows:

vmuser@Linux-host:~/linux-2.6.35.3 $ make menuconfig

After entering the configuration interface, press the Enter key to enter the "Device Drivers --->" option. After configuring the kernel, save and exit the kernel configuration operation.


5. Modify & compile kernel source code

For the Longshang 4G module, we need to modify the contents of three arrays in the linux-2.6.35.3 directory:

  • Use vi or vim command to open drivers/gpio/gpio_m28x.c file and make changes in all_gpios_info[ ] array;

  • Use vi or vim command to open the arch/arm/mach-mx28/mx28evk_pins.c file and make changes in the mx28evk_fixed_pins[] array;

  • Use vi or vim command to open drivers/usb/serial/option.c file and make changes in option_ids[] array.

After completing the above modifications, you can compile the kernel. The kernel compilation reference command is as follows:

vmuser@Linux-host:~/linux-2.6.35.3 $ make uImage

After the kernel is compiled, burn the generated uImage file (which can be found in the arch/arm/boot directory) to the industrial control board or development kit. For the burning method, please refer to Chapter 6 of the "IoT-3960 User Manual.pdf".


4. 4G module test

This article mainly introduces the control interfaces of the Longshang 4G module, such as telephone and network, and the communication process of the IoT-3960L industrial control board. The industrial control board used for testing must be burned with the V1.03 uboot and file system in the EPC-280_283_287 V1.04.iso CD, because it contains the necessary dial-up Internet access tools.


1. Telephone control interface

The commands for answering and dialing a phone call are shown in Table 1. By sending the corresponding commands to the serial port, you can answer and dial a phone call. For example, you can send "ATD12345678901;nr" to the serial port to dial 12345678901.

Table 1 Phone dialing and answering control commands

OrderSyntax and function
ATD

Make a phone call: ATD+phone number+;rn" such as ATD10010; followed by a semicolon

Cannot be less, return OK or ERROR

AT+COPS?"AT+COPS?rn" detects the operator and returns OK or ERROR
AT+CVHU=0 and ATHHang up the phone: "AT+CVHU=0rn" and then send "ATHrn"
ATAAnswer the call: "ATAnr"

The execution flow of the phone dialing and answering code is shown in Figure 3. The code will first display the available menus, such as phone dialing, SMS receiving, etc. Wait for the user to enter parameters and execute the process corresponding to the parameters. Then determine whether the execution is successful. If the execution is successful, it will return to the menu display code to continue the next cycle.

Figure 3 Flowchart of phone call dialing and answering


2. Network control interface

The 4G module Internet access function connects to the network through the interface provided by PPP dial-up. A dial-up script for reference is preset in the "/etc/ppp" directory of the development kit file system. After the dial-up is successful (execute the PPP dial-up script), the kernel will generate a PPP network device. You can access the network by creating a socket.


3. Demonstration program operation

  • Enable 4G module

When the default kernel starts, the reset pin of the 4G module is pulled low, making the module in a non-working state. To fully enable the module, run the upmodule.sh script in the /opt directory.

At this time, the WWAN LED of the board will flash, with a flashing frequency of about 800 milliseconds, and then the device will start to access the network. After successful access, the flashing frequency of the WWAN LED of the board will change to about 3 seconds. At the same time, about 10 seconds later, the board will start to detect the insertion of the USB device, and then the board will automatically install the USB to serial port driver. After the driver is installed, the 6 serial port devices ttyUSB0~ttyUSB5 will be automatically generated in the /dev directory of the board.


  • Compile the demo program

Copy the longsung-test folder in the /works/mx28x/app/ directory to the Linux development host, compile the code under longsung-test, and copy the generated longsung-test file to the board for subsequent phone function testing.

[1] [2]
Reference address:Application of 4G communication module on ARM platform

Previous article:The composition and difference of gcc, arm-Linux-gcc and arm-elf-gcc
Next article:ARM instruction set - conditional execution, memory operation instructions, jump instructions

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号