Framework OpenCPU - Wiz-IO/platform-quectel GitHub Wiki

Quectel OpenCPU Framework for PlatformIO

OpenCPU is an embedded development solution for M2M field that GSM/GPRS module can be designed as the main processor. And it has been designed to facilitate the design and accelerate the application development. OpenCPU makes it possible to create innovative applications and embed them directly into Quectel GSM/GPRS modules to run without external MCU. It has been widely used in M2M field, such as tracker & tracing, automotive, energy...

BC66, BC26 ATTENTION:

For Linux/macOS USB Drivers

https://www.maxlinear.com/product/interface/uarts/usb-uarts/xr21v1412 https://learn.sparkfun.com/tutorials/how-to-install-ch340-drivers/all#linux

First Update Firmware and Make Backup of NVDM Fields

  • IoT Flash Tool,
  • [Backup] button, check-box "Backup", select file for backup (use IMEI as name)
  • [Start] and keep the file

If you upload application to module you lose standart AT command via uarts

How to restore BC66 AT command interface:

Solution 1

  • Compile and run this OpenCPU application
  • After success, start IoT Flash Tool and Format memory (Remove Application)
  • Physical Address: 0x8292000, Length: 0x4000
  • Done
/*  WizIO 2018 Georgi Angelov https://github.com/Wiz-IO */

#include "custom_feature_def.h"
#include "ql_type.h"
#include "ql_stdlib.h"
#include "ql_uart.h"
#include "ril.h"

char cmd_1[] = "AT+EPORT=1,connl,0"; // set interface
char cmd_2[] = "AT+QPOWD=0"; // POWER-OFF
void CB_UART_Hdlr(Enum_SerialPort port, Enum_UARTEventType msg, bool level, void* customizedPara){}
char DBG_BUFFER[512];
#define DBG(FORMAT,...) {\
    Ql_memset(DBG_BUFFER, 0, 512);\
    Ql_sprintf(DBG_BUFFER, FORMAT, ##__VA_ARGS__); \
    Ql_UART_Write(UART_PORT0, (u8*)DBG_BUFFER, Ql_strlen(DBG_BUFFER));\
}

void proc_main_task(void) {
    ST_MSG msg;
    int ret = Ql_UART_Register(UART_PORT0, CB_UART_Hdlr, NULL);
    Ql_UART_Open(UART_PORT0, 115200, FC_NONE); 
    DBG("Restore AT Command Interface 2019 Georgi Angelov\n");     
    while (1) {
         Ql_OS_GetMessage(&msg);
        switch(msg.message) {
            case MSG_ID_RIL_READY:                
                Ql_RIL_Initialize();                
                if (( ret = Ql_RIL_SendATCmd(cmd_1, Ql_strlen(cmd_1), NULL, NULL, 300) )) {
                    DBG("[ERROR] EPORT = %d\n", ret);
                } else {
                    DBG("Start IoT Falsh Tool and FORMAT\n");
                    DBG("Physical Address: 0x8292000, Length: 0x4000\n");
                    ret = Ql_RIL_SendATCmd(cmd_2, Ql_strlen(cmd_2), NULL, NULL, 300);
                } 
                break;                                        
            default: 
                break;
        }       
    } 
}

Solution 2

  • IoT Flash Tool - Upload NVDM Backup
  • Remove Application: Format Physical Address: 0x8292000, Length: 0x4000
  • Done

Solution 3

  • IoT Flash Tool - Format all [ dangerous solution ] you will lost IMEI
  • Restore IMEI