Skip to content

lierda-iot/CAT1.bis_OpenCPU

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenCPU README_EN

English | 中文

1 Introduction

OPENSDK is an open SDK development system developed by Lierda for Cat.1 users. The kernel is based on a base package separation architecture built on FreeRTOS, featuring complete task management, memory management, exception management, system clock, and interrupt management. In addition to basic kernel functions, OPENSDK provides rich peripheral management, sleep/wake, secure boot, remote upgrade, and other features for Cat.1 modules, offering developers a "one-stop" complete software platform that effectively lowers the development barrier and shortens the development cycle.

2 OPENSDK Architecture

OPENSDK can be divided into three layers in terms of design: Base Package Layer, System Layer, and User Layer.

+----------------------------------------------------------------+
| [User Layer]   app        demo        ai        ...            |
+----------------------------------------------------------------+
|      stdlibC API | EC API | LIOT API | ThreadPart API          |
+----------------------------------------------------------------+
| [System Layer]                                                 |
|  +-------------------------+  +----------------------------+   |
|  | TTS  | OTA  | Driver    |  |        ThirdParty           |  |
|  +------+------+-----------+  |   lwip        CJSON         |  |
|  | SECBOOT     | PRECFG    |  |   Freertos    websocket     |  |
|  +-------------+-----------+  |   lvgl        mbedtls       |  |
|  | LIOTAPI .h  | ECAPI .h  |  |   ...                       |  |
|  +-------------+-----------+  +-----------------------------+  |
+----------------------------------------------------------------+
| [Base Package Layer]                                           |
|  +--------+------------+------+------+--------------+          |
|  | PortLib| bootloader |  AP  |  CP  | ELF Parser   |          |
|  +--------+------------+------+------+--------------+          |
|  |     LogLib          |    MemoryMap               |          |
|  +---------------------+----------------------------+          |
|                                                                |
+----------------------------------------------------------------+
| [Module]  NT26FCNB60WNA   NT26K2B1   NT26F6D0   ...            |
+----------------------------------------------------------------+
  1. Base Package Layer: The base package layer is not visible to users and is maintained by Lierda. Library files for different module models are packaged and placed in the components/basePkg/ directory. The base package provides the most fundamental build environment for code execution, integrating the APIs and library files required by the SDK. The SDK is developed based on the APIs exposed by the base package.

  2. System Layer: The core code that runs the SDK. After power-on, the system first completes base package and kernel initialization, then loads system layer components, starting execution from components/kernel/core/main.c:main(). The system layer adopts a modular design including kernel, configuration, drivers, open-source third-party libraries, TTS, OTA upgrade, etc. All modules except Kernel and configuration can be flexibly trimmed.

  3. User Layer: The area provided for developers to write their code. The system layer Main() function creates an independent thread of 10K size that calls the code entry point void user_main(void). User business code typically starts execution from this entry point. Code is mainly located in the examples directory. Lierda provides two preset projects for developers. The app project is an empty project with no specific functionality — users can develop their own code based on it. The demo project is an API interface example demo provided by Lierda for customers as a reference.

3 Directory Structure

──
├── components                  (Component library, core code is placed here)
│   ├── basePkg                 (Base package directory, generated by Lierda for different models)
│   │   └── F6B_A, F7B_A, F6D_A, K2B_A, ...
│   ├── driver                  (Open low-level drivers)
│   │   └── lcd, camera, ...
│   ├── kernel
│   │   ├── app.ld              (Linker script)
│   │   ├── core                (System startup entry)
│   │   ├── ecapi               (Header files for Eigencomm platform APIs)
│   │   ├── include             (General header file directory)
│   │   └── lierda_api          (Header files for Lierda APIs)
│   ├── ota                     (FOTA related code)
│   ├── precfg                  (Preset config, parameterized by config/default.ini and iodriver.ini)
│   ├── secboot                 (Secure boot verification related code)
│   ├── thirdparty              (Open-source third-party source code)
│   │   └── CJSON, freertos, websockets, lwip, mbedtls, etc.
│   └── tts                     (TTS related code)
├── config
│   ├── default.ini             (Preset config: default UART AT port, default CID, APN, etc.)
│   └── iodriver.ini            (IO pin config presets for UART/SPI/I2S/I2C/CAN drivers)
├── docs                        (Related documentation)
├── examples
│   ├── app                     (Default project, no actual functionality, add customer code here)
│   └── demo                    (Default demo project, provides API interface examples)
├── LICENSE                     (Open-source code license)
├── build.bat                   (Build entry for Windows)
├── Makefile                    (Makefile build entry, can compile directly on Linux)
├── README_EN.md                (English README file)
├── README.md                   (Chinese README file)
├── rules                       (Makefile build rules)
│   └── Makefile, Makefile.defs, Makefile.modem, Makefile.rules, Makefile.tools, Makefile.vars
└── tools                       (Scripts and tools)
    └── 7z, appota, fcelf, lfsutil, msys64, precfg, secboot, toolchain

4 Supported Models

Module models can be identified by the silkscreen on the module shielding cover. Base packages are split into different versions based on chip and functionality.

Base Package Version Chip Description FLASH RAM File System Compatible Module Models
F6B_A EC718PM B Series 812 KB 1 MB 780 KB NT26FCNB30WNA / NT26FCNB60WNA
F6D_A EC718PM D Series 812 KB 1 MB 780 KB NT26F6D0 (all series) / NT26F7D0
F7B_A EC718PM B Series VoLTE 452 KB 1 MB 168 KB NT26FCNB70WNA
K2B_A EC716E B Series 844 KB 512 KB 840 KB NT26KCNB20NNA / NT26KCNB2MNNA / NT26K2B1
K2F_A EC716E F Series 844 KB 512 KB 840 KB NT26KCNF20NNA
F6E_A EC718PM F Series 844 KB 512 KB 840 KB NT26F6E0 (under development)
F6C_A EC718PM F Series 844 KB 512 KB 840 KB NT26F6C0 (under development)

5 Peripheral Resources

Peripheral K2B_A F6B/F6D/F7B
UART 3 channels 4 channels
Baud rate: 4.9Kbps, 9.6Kbps, 115.2Kbps, 921.6Kbps, up to 3 Mbps
Data bits: 5~8 bits
Parity: None, Odd, Even
Stop bits: 1, 2
Flow control supported
UART1 supports LPUART
GPIO 21 channels 39 channels
Includes 9 AONGPIO channels
Level: Default 1.8V, software adjustable range: 1.65V~3.30V
Configuration mode: Input, Output
Interrupt trigger: Low level, High level, Rising edge, Falling edge
Internal pull-up/pull-down: Supported on some IOs
I2C Mode: Supports Master and Slave modes
Speed: 100 KHz~1 MHz
Addressing: Supports 7/10-bit addressing
SPI 1 channel 2 channels
Mode: Supports Master and Slave modes
Speed: Up to 25.6 MHz
Data width: 8-bit, 16-bit
USP 1 channel 3 channels
Quantity: 3 channels (I2S/CSPI/LSPI)
Mode: Supports Master and Slave modes
Supports 896k, 16 or 24-bit, 848k, 32-bit
Supports standard I2S/LJ/RJ mode, PCM mode A/B
I2S/PCM supports TXRX/TX/RX
CSPI supports slave reception
USP0/USP1 have hardware acceleration
Newly supports QSPI and 8080 interface (only 718(P_M/P_VM) series)
USB Supports USB 2.0
Supports 480Mbps (HS), 12Mbps (FS) data transfer
Supports device mode
ADC 2 channels 4 channels
Analog channels: 4, input range: 0V3.4V
Temperature sensor: 1 channel, input range: -40°C
85°C
VBAT voltage: 1 channel, input range: 2.7V~4.5V
Resolution: 12-bit AUXADC
Timer Quantity: Supports 6 hardware timers
PWM Quantity: Supports 6 channels
Low-power Timer Quantity: Supports 7
WAKEUP Quantity: Supports 6 low-power wake-up sources
CAN Not supported Not supported

6 Quick Development

Below is a quick development guide. For more detailed development reference, see "Quick Start Guide".

6.1 Get Module Model and Confirm Build Project

  • Check the module model on the module silkscreen.
  • Project names are under the examples/ directory, where the directory name corresponds to the project name, e.g., examples/demo -> demo project.

6.2 Build

The SDK supports both Windows and Linux development. On Windows you can use the lierda_upgrade_tool or Makefile to build. Choose the method that suits your situation. For details, refer to: "Lierda Cellular Firmware Flashing Tool User Guide"

Below is the main introduction to command-line building from the SDK root directory:

6.2.1 Linux Build

Linux recommended system: Ubuntu 20.04 or above. Make, Python3, and 32-bit runtime environment need to be installed.

sudo apt update
sudo apt install -y make
sudo apt install -y lib32z1 lib32stdc++6
sudo apt install -y python3.10 python3.10-dev python3.10-distutils
# Enter SDK directory
cd CAT1.bis_OpenCPU
# Incremental build, unchanged files are not recompiled
make
# Clean build, cleans examples then recompiles
make all
# Build with parameters: clean build + specify demo project + use F6D_A base package
make all PROJECT=demo MODEM=NT26F6D0 MODEMPKG=F6D_A

6.2.2 Windows Build

# Enter SDK directory
cd CAT1.bis_OpenCPU
# Incremental build, unchanged files are not recompiled
./build.bat
# Clean build, cleans examples then recompiles
./build.bat all
# Build with parameters: clean build + specify demo project + use F6D_A base package
./build.bat all PROJECT=demo MODEM=NT26F6D0 MODEMPKG=F6D_A

6.3 Generated Files

Generated files are located in the gccout/project_name directory under the root. Taking the demo project + module NT26F6D0 as an example, in the gccout/demo/ directory:

  • demo_NT26F6D0_01.binpkg: Combined package of base package + application layer.
  • demo_NT26F6D0.bin: Package containing only the application layer.
  • F6D_A_base.binpkg: Combined package containing only the base package without the application.

6.4 Flashing

We use the lierda_upgrade_tool for flashing. For tool usage documentation, refer to:

"Lierda Cellular Firmware Flashing Tool User Guide"

6.5 Viewing Logs

Open any serial port tool, select baud rate 115200, open the serial port, and you can view the APP logs.

For more log details, refer to: "Windows Log Capture Guide"

7 Documentation

General Guide | Hardware | Software Development | Tools

8 More Development Examples

"Based on L-CT4IT00-YP00W-01_V04 Hardware"

"Lierda XiaoDa Application Guide"

9 Tools

10 License

71x OPENSDK follows the Apache License 2.0 open-source license. It can be used freely in commercial products without the need to disclose private code, with no potential commercial risk.

/*
 * Copyright (c) Lierda Science & Technology Group Co., Ltd.
 *
 * SPDX-License-Identifier: Apache-2.0
 */

About

利尔达opencpu SDK,cat1bis通讯,支持NT26F6D0,NT26K2全系列模组

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages