├── README.md ├── boards.png ├── boards ├── BC26.json ├── BC66.json ├── M66.json └── MC60.json ├── builder ├── frameworks │ ├── GFH_bc66.py │ ├── GFH_m66.py │ ├── GFH_mc60.py │ ├── bc66.py │ ├── m66.py │ └── mc60.py └── main.py ├── examples ├── hello_bc66 │ ├── .gitignore │ ├── .travis.yml │ ├── README.rst │ ├── lib │ │ └── readme.txt │ ├── platformio.ini │ └── src │ │ └── main.c ├── hello_m66 │ ├── .gitignore │ ├── .travis.yml │ ├── README.rst │ ├── lib │ │ └── readme.txt │ ├── platformio.ini │ └── src │ │ └── main.c └── hello_mc60 │ ├── .gitignore │ ├── .travis.yml │ ├── README.rst │ ├── lib │ └── readme.txt │ ├── platformio.ini │ └── src │ └── main.c ├── manifest.json ├── on_linux.png ├── platform.json ├── platform.png ├── project.png └── screenshot.png /README.md: -------------------------------------------------------------------------------- 1 | # Quectel development platform for [PlatformIO](http://platformio.org) 2 | # Тhe platform is there [platform-quectel](https://github.com/Wiz-IO/platform-quectel) for all Quectel modules 3 | 4 | 5 | **A few words in the beginning** 6 | * version: 1.0.0 ( work, but is NOT READY FOR AUTO INSTALL ) 7 | * this is base, I will rename platform to Quectel, and frameworks to OpenCPU, OpenLinux, ThreadX and Arduino... 8 | * Quectel Modules: now M66, M26, MC60, MC20 BC66, BC26 ... next BG96, EC21, EC25 ... 9 | 10 | What next 11 | 12 | ![Project](https://raw.githubusercontent.com/Wiz-IO/platform-opencpu/master/platform.png) 13 | ![Project](https://raw.githubusercontent.com/Wiz-IO/platform-opencpu/master/boards.png) 14 | 15 | Video 16 | https://youtu.be/YvHy1MLqH70 17 | 18 | ![ScreenShot](https://raw.githubusercontent.com/Wiz-IO/platform-opencpu/master/screenshot.png) 19 | 20 | 21 | **Install** 22 | 23 | https://github.com/Wiz-IO/platform-quectel 24 | 25 | 26 | **Thanks to** 27 | 28 | * Ivan Kravets ( PlatformIO ) 29 | * Radu Igret ( Quectel ) 30 | 31 | 32 | >If you want to help / support: 33 | [![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ESUP9LCZMZTD6) 34 | -------------------------------------------------------------------------------- /boards.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wiz-IO/platform-opencpu/d044183db60d73f85accb76282e99cbbedda8da5/boards.png -------------------------------------------------------------------------------- /boards/BC26.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Quectel BC26 module", 3 | "url": "https://www.quectel.com/", 4 | "build": { 5 | "core": "bc66", 6 | "f_cpu": "78000000L", 7 | "mcu": "ARM", 8 | "cpu": "cortex-m4", 9 | "variant": "BC66" 10 | }, 11 | "debug": { 12 | "tools": { 13 | "uart": { 14 | "onboard": true, 15 | "extra_cmds": [], 16 | "load_cmd": [], 17 | "server": { 18 | "arguments": [], 19 | "executable": "coda", 20 | "package": "tool-opencpu" 21 | } 22 | } 23 | } 24 | }, 25 | "frameworks": [ 26 | "OpenCPU BC66", 27 | "arduino" 28 | ], 29 | "vendor": "Quectel", 30 | "upload": { 31 | "maximum_ram_size": 100000, 32 | "maximum_size": 200000 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /boards/BC66.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Quectel BC66 module", 3 | "url": "https://www.quectel.com/", 4 | "build": { 5 | "core": "bc66", 6 | "f_cpu": "78000000L", 7 | "mcu": "ARM", 8 | "cpu": "cortex-m4", 9 | "variant": "BC66" 10 | }, 11 | "debug": { 12 | "tools": { 13 | "uart": { 14 | "onboard": true, 15 | "extra_cmds": [], 16 | "load_cmd": [], 17 | "server": { 18 | "arguments": [], 19 | "executable": "coda", 20 | "package": "tool-opencpu" 21 | } 22 | } 23 | } 24 | }, 25 | "frameworks": [ 26 | "OpenCPU BC66", 27 | "arduino" 28 | ], 29 | "vendor": "Quectel", 30 | "upload": { 31 | "maximum_ram_size": 100000, 32 | "maximum_size": 200000 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /boards/M66.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Quectel M66 module", 3 | "url": "https://www.quectel.com/", 4 | "build": { 5 | "core": "m66", 6 | "f_cpu": "260000000L", 7 | "mcu": "ARM", 8 | "cpu": "arm5", 9 | "variant": "M66" 10 | }, 11 | "debug": { 12 | "tools": { 13 | "uart": { 14 | "onboard": true, 15 | "extra_cmds": [], 16 | "load_cmd": [], 17 | "server": { 18 | "arguments": [], 19 | "executable": "exe", 20 | "package": "tool-opencpu" 21 | } 22 | } 23 | } 24 | }, 25 | "frameworks": [ 26 | "OpenCPU M66" 27 | ], 28 | "vendor": "Quectel", 29 | "upload": { 30 | "maximum_ram_size": 102400, 31 | "maximum_size": 368640 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /boards/MC60.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Quectel MC60 module", 3 | "url": "https://www.quectel.com/", 4 | "build": { 5 | "core": "mc60", 6 | "f_cpu": "260000000L", 7 | "mcu": "ARM", 8 | "cpu": "arm5", 9 | "variant": "MC60" 10 | }, 11 | "debug": { 12 | "tools": { 13 | "uart": { 14 | "onboard": true, 15 | "extra_cmds": [], 16 | "load_cmd": [], 17 | "server": { 18 | "arguments": [], 19 | "executable": "exe", 20 | "package": "tool-opencpu" 21 | } 22 | } 23 | } 24 | }, 25 | "frameworks": [ 26 | "OpenCPU MC60" 27 | ], 28 | "vendor": "Quectel", 29 | "upload": { 30 | "maximum_ram_size": 102400, 31 | "maximum_size": 327680 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /builder/frameworks/GFH_bc66.py: -------------------------------------------------------------------------------- 1 | # WizIO 2018 Georgi Angelov 2 | # http://www.wizio.eu/ 3 | # https://github.com/Wiz-IO 4 | 5 | import os 6 | import sys 7 | import struct 8 | import datetime 9 | from os.path import join 10 | 11 | def makeHDR( dat ): 12 | bin = dat.replace(".dat", ".bin") 13 | 14 | dst = open(bin, "wb") 15 | arr = [0x4D, 0x4D, 0x4D, 0x01, 0x40, 0x00, 0x00, 0x00, 0x46, 0x49, 0x4C, 0x45, 0x5F, 0x49, 0x4E, 0x46] 16 | data = bytearray(arr) 17 | dst.write(data) 18 | arr = [0x4F, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x70, 0x07, 0x00, 0x00, 0x20, 0x29, 0x08] 19 | data = bytearray(arr) 20 | dst.write(data) 21 | 22 | src_size = os.stat( dat ).st_size # ? ? ? 23 | print "APPLICATION SIZE: ", src_size + 64, " bytes" 24 | dst.write( struct.pack(' 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | # Autor: WizIO 2018 Georgi Angelov 16 | # http://www.wizio.eu/ 17 | # https://github.com/Wiz-IO 18 | # 19 | # Support: Quectel 20 | # https://www.quectel.com/support/contact.htm 21 | # 22 | # Support: Comet Electronics 23 | # https://www.comet.bg/?cid=92 24 | # 25 | 26 | from os.path import join 27 | from SCons.Script import (AlwaysBuild, Builder, COMMAND_LINE_TARGETS, Default, DefaultEnvironment) 28 | from colorama import Fore, Back, Style 29 | 30 | env = DefaultEnvironment() 31 | platform = env.PioPlatform() 32 | print(Fore.GREEN + '----- Quectel OpenCPU '+env.BoardConfig().get("build.core").upper()+" 2018 Georgi Angelov -----") 33 | #print env.Dump() 34 | 35 | env.Replace( 36 | BUILD_DIR = env.subst("$BUILD_DIR").replace("\\", "/"), 37 | AR="arm-none-eabi-ar", 38 | AS="arm-none-eabi-as", 39 | CC="arm-none-eabi-gcc", 40 | GDB="arm-none-eabi-gdb", 41 | CXX="arm-none-eabi-g++", 42 | OBJCOPY="arm-none-eabi-objcopy", 43 | RANLIB="arm-none-eabi-ranlib", 44 | SIZETOOL="arm-none-eabi-size", 45 | ARFLAGS=["rc"], 46 | SIZEPROGREGEXP=r"^(?:\.text|\.data|\.bootloader)\s+(\d+).*", 47 | SIZEDATAREGEXP=r"^(?:\.data|\.bss|\.noinit)\s+(\d+).*", 48 | SIZECHECKCMD="$SIZETOOL -A -d $SOURCES", 49 | SIZEPRINTCMD='$SIZETOOL --mcu=$BOARD_MCU -C -d $SOURCES', 50 | PROGSUFFIX=".elf", 51 | UPLOADNAME=join("$BUILD_DIR", "${PROGNAME}.cfg"), 52 | ) 53 | 54 | #################################################### 55 | # Target: Build executable and linkable program 56 | #################################################### 57 | elf = None 58 | elf = env.BuildProgram() 59 | src = env.GFH( 60 | join("$BUILD_DIR", "${PROGNAME}"), 61 | env.ElfToBin(join("$BUILD_DIR", "${PROGNAME}"), elf), 62 | ) 63 | AlwaysBuild( env.Alias("nobuild", src) ) 64 | 65 | #################################################### 66 | # Target: Upload BC66 67 | #################################################### 68 | target_upload = env.Alias("upload", src, [ 69 | env.VerboseAction(env.AutodetectUploadPort, "Looking for upload port..."), 70 | env.VerboseAction("", "--- WAITING MODULE ---"), 71 | env.VerboseAction("$UPLOADCMD", "RESET BOARD TO START FLASHING"), 72 | env.VerboseAction("", "POWER ON BOARD"), 73 | 74 | ]) 75 | 76 | 77 | AlwaysBuild( target_upload ) 78 | 79 | Default( src ) 80 | -------------------------------------------------------------------------------- /examples/hello_bc66/.gitignore: -------------------------------------------------------------------------------- 1 | .pioenvs 2 | -------------------------------------------------------------------------------- /examples/hello_bc66/.travis.yml: -------------------------------------------------------------------------------- 1 | # Continuous Integration (CI) is the practice, in software 2 | # engineering, of merging all developer working copies with a shared mainline 3 | # several times a day < http://docs.platformio.org/page/ci/index.html > 4 | # 5 | # Documentation: 6 | # 7 | # * Travis CI Embedded Builds with PlatformIO 8 | # < https://docs.travis-ci.com/user/integration/platformio/ > 9 | # 10 | # * PlatformIO integration with Travis CI 11 | # < http://docs.platformio.org/page/ci/travis.html > 12 | # 13 | # * User Guide for `platformio ci` command 14 | # < http://docs.platformio.org/page/userguide/cmd_ci.html > 15 | # 16 | # 17 | # Please choose one of the following templates (proposed below) and uncomment 18 | # it (remove "# " before each line) or use own configuration according to the 19 | # Travis CI documentation (see above). 20 | # 21 | 22 | 23 | # 24 | # Template #1: General project. Test it using existing `platformio.ini`. 25 | # 26 | 27 | # language: python 28 | # python: 29 | # - "2.7" 30 | # 31 | # sudo: false 32 | # cache: 33 | # directories: 34 | # - "~/.platformio" 35 | # 36 | # install: 37 | # - pip install -U platformio 38 | # 39 | # script: 40 | # - platformio run 41 | 42 | 43 | # 44 | # Template #2: The project is intended to by used as a library with examples 45 | # 46 | 47 | # language: python 48 | # python: 49 | # - "2.7" 50 | # 51 | # sudo: false 52 | # cache: 53 | # directories: 54 | # - "~/.platformio" 55 | # 56 | # env: 57 | # - PLATFORMIO_CI_SRC=path/to/test/file.c 58 | # - PLATFORMIO_CI_SRC=examples/file.ino 59 | # - PLATFORMIO_CI_SRC=path/to/test/directory 60 | # 61 | # install: 62 | # - pip install -U platformio 63 | # 64 | # script: 65 | # - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N 66 | -------------------------------------------------------------------------------- /examples/hello_bc66/README.rst: -------------------------------------------------------------------------------- 1 | .. Copyright 2014-present PlatformIO 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | http://www.apache.org/licenses/LICENSE-2.0 6 | Unless required by applicable law or agreed to in writing, software 7 | distributed under the License is distributed on an "AS IS" BASIS, 8 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | See the License for the specific language governing permissions and 10 | limitations under the License. 11 | 12 | How to build PlatformIO based project 13 | ===================================== 14 | 15 | -------------------------------------------------------------------------------- /examples/hello_bc66/lib/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for the project specific (private) libraries. 3 | PlatformIO will compile them to static libraries and link to executable file. 4 | 5 | The source code of each library should be placed in separate directory, like 6 | "lib/private_lib/[here are source files]". 7 | 8 | For example, see how can be organized `Foo` and `Bar` libraries: 9 | 10 | |--lib 11 | | |--Bar 12 | | | |--docs 13 | | | |--examples 14 | | | |--src 15 | | | |- Bar.c 16 | | | |- Bar.h 17 | | |--Foo 18 | | | |- Foo.c 19 | | | |- Foo.h 20 | | |- readme.txt --> THIS FILE 21 | |- platformio.ini 22 | |--src 23 | |- main.c 24 | 25 | Then in `src/main.c` you should use: 26 | 27 | #include 28 | #include 29 | 30 | // rest H/C/CPP code 31 | 32 | PlatformIO will find your libraries automatically, configure preprocessor's 33 | include paths and build them. 34 | 35 | See additional options for PlatformIO Library Dependency Finder `lib_*`: 36 | 37 | http://docs.platformio.org/page/projectconf.html#lib-install 38 | 39 | -------------------------------------------------------------------------------- /examples/hello_bc66/platformio.ini: -------------------------------------------------------------------------------- 1 | ; PlatformIO Project Configuration File 2 | ; 3 | ; Build options: build flags, source filter 4 | ; Upload options: custom upload port, speed and extra flags 5 | ; Library options: dependencies, extra library storages 6 | ; Advanced options: extra scripting 7 | ; 8 | ; Please visit documentation for the other options and examples 9 | ; http://docs.platformio.org/page/projectconf.html 10 | 11 | [env:BC66] 12 | board = BC66 13 | framework = OpenCPU BC66 14 | platform = opencpu 15 | -------------------------------------------------------------------------------- /examples/hello_bc66/src/main.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * WizIO 2018 Georgi Angelov 3 | * http://www.wizio.eu/ 4 | * https://github.com/Wiz-IO 5 | ****************************************************************************/ 6 | 7 | /**************************************************************************** 8 | * Included Files 9 | ****************************************************************************/ 10 | 11 | #include "custom_feature_def.h" 12 | #include "ql_type.h" 13 | #include "ql_stdlib.h" 14 | #include "ql_trace.h" 15 | #include "ql_uart.h" 16 | #include "ql_error.h" 17 | 18 | /**************************************************************************** 19 | * Defines 20 | ****************************************************************************/ 21 | 22 | #ifdef CORE_BC66 23 | # define DPORT UART_PORT0 24 | #else 25 | # define DPORT UART_PORT1 26 | #endif 27 | 28 | static Enum_SerialPort m_myUartPort = DPORT; 29 | #define DEBUG_ENABLE 1 30 | #if DEBUG_ENABLE > 0 31 | #define DEBUG_PORT DPORT 32 | #define DBG_BUF_LEN 512 33 | static char DBG_BUFFER[DBG_BUF_LEN]; 34 | #define APP_DEBUG(FORMAT,...) {\ 35 | Ql_memset(DBG_BUFFER, 0, DBG_BUF_LEN);\ 36 | Ql_sprintf(DBG_BUFFER,FORMAT,##__VA_ARGS__); \ 37 | if (UART_PORT2 == (DEBUG_PORT)) {\ 38 | Ql_Debug_Trace(DBG_BUFFER);\ 39 | } else {\ 40 | Ql_UART_Write((Enum_SerialPort)(DEBUG_PORT), (u8*)(DBG_BUFFER), Ql_strlen((const char *)(DBG_BUFFER)));\ 41 | }\ 42 | } 43 | #else 44 | #define APP_DEBUG(FORMAT,...) 45 | #endif 46 | 47 | static void CallBack_UART_Hdlr(Enum_SerialPort port, Enum_UARTEventType msg, bool level, void* customizedPara){} 48 | 49 | /**************************************************************************** 50 | * Source 51 | ****************************************************************************/ 52 | 53 | void proc_main_task(void) { 54 | s32 ret; 55 | ST_MSG msg; 56 | Ql_UART_Register(m_myUartPort, CallBack_UART_Hdlr, NULL); 57 | Ql_UART_Open(m_myUartPort, 115200, FC_NONE); 58 | APP_DEBUG("PlatformIO - Quectel OpenCPU 2018 Georgi Angelov\n"); 59 | while (1) { 60 | Ql_OS_GetMessage(&msg); 61 | switch(msg.message) { 62 | case MSG_ID_RIL_READY: 63 | Ql_RIL_Initialize(); 64 | APP_DEBUG("RIL is ready\n"); 65 | break; 66 | case MSG_ID_URC_INDICATION: 67 | APP_DEBUG("MSG_ID_URC_INDICATION: %d, %d\n", msg.param1, msg.param2); 68 | if (msg.param1 == 5 && msg.param2 == 1) { 69 | APP_DEBUG("Network Connected\n"); 70 | } 71 | default: 72 | break; 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /examples/hello_m66/.gitignore: -------------------------------------------------------------------------------- 1 | .pioenvs 2 | -------------------------------------------------------------------------------- /examples/hello_m66/.travis.yml: -------------------------------------------------------------------------------- 1 | # Continuous Integration (CI) is the practice, in software 2 | # engineering, of merging all developer working copies with a shared mainline 3 | # several times a day < http://docs.platformio.org/page/ci/index.html > 4 | # 5 | # Documentation: 6 | # 7 | # * Travis CI Embedded Builds with PlatformIO 8 | # < https://docs.travis-ci.com/user/integration/platformio/ > 9 | # 10 | # * PlatformIO integration with Travis CI 11 | # < http://docs.platformio.org/page/ci/travis.html > 12 | # 13 | # * User Guide for `platformio ci` command 14 | # < http://docs.platformio.org/page/userguide/cmd_ci.html > 15 | # 16 | # 17 | # Please choose one of the following templates (proposed below) and uncomment 18 | # it (remove "# " before each line) or use own configuration according to the 19 | # Travis CI documentation (see above). 20 | # 21 | 22 | 23 | # 24 | # Template #1: General project. Test it using existing `platformio.ini`. 25 | # 26 | 27 | # language: python 28 | # python: 29 | # - "2.7" 30 | # 31 | # sudo: false 32 | # cache: 33 | # directories: 34 | # - "~/.platformio" 35 | # 36 | # install: 37 | # - pip install -U platformio 38 | # 39 | # script: 40 | # - platformio run 41 | 42 | 43 | # 44 | # Template #2: The project is intended to by used as a library with examples 45 | # 46 | 47 | # language: python 48 | # python: 49 | # - "2.7" 50 | # 51 | # sudo: false 52 | # cache: 53 | # directories: 54 | # - "~/.platformio" 55 | # 56 | # env: 57 | # - PLATFORMIO_CI_SRC=path/to/test/file.c 58 | # - PLATFORMIO_CI_SRC=examples/file.ino 59 | # - PLATFORMIO_CI_SRC=path/to/test/directory 60 | # 61 | # install: 62 | # - pip install -U platformio 63 | # 64 | # script: 65 | # - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N 66 | -------------------------------------------------------------------------------- /examples/hello_m66/README.rst: -------------------------------------------------------------------------------- 1 | .. Copyright 2014-present PlatformIO 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | http://www.apache.org/licenses/LICENSE-2.0 6 | Unless required by applicable law or agreed to in writing, software 7 | distributed under the License is distributed on an "AS IS" BASIS, 8 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | See the License for the specific language governing permissions and 10 | limitations under the License. 11 | 12 | How to build PlatformIO based project 13 | ===================================== 14 | 15 | -------------------------------------------------------------------------------- /examples/hello_m66/lib/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for the project specific (private) libraries. 3 | PlatformIO will compile them to static libraries and link to executable file. 4 | 5 | The source code of each library should be placed in separate directory, like 6 | "lib/private_lib/[here are source files]". 7 | 8 | For example, see how can be organized `Foo` and `Bar` libraries: 9 | 10 | |--lib 11 | | |--Bar 12 | | | |--docs 13 | | | |--examples 14 | | | |--src 15 | | | |- Bar.c 16 | | | |- Bar.h 17 | | |--Foo 18 | | | |- Foo.c 19 | | | |- Foo.h 20 | | |- readme.txt --> THIS FILE 21 | |- platformio.ini 22 | |--src 23 | |- main.c 24 | 25 | Then in `src/main.c` you should use: 26 | 27 | #include 28 | #include 29 | 30 | // rest H/C/CPP code 31 | 32 | PlatformIO will find your libraries automatically, configure preprocessor's 33 | include paths and build them. 34 | 35 | See additional options for PlatformIO Library Dependency Finder `lib_*`: 36 | 37 | http://docs.platformio.org/page/projectconf.html#lib-install 38 | 39 | -------------------------------------------------------------------------------- /examples/hello_m66/platformio.ini: -------------------------------------------------------------------------------- 1 | ; PlatformIO Project Configuration File 2 | ; 3 | ; Build options: build flags, source filter 4 | ; Upload options: custom upload port, speed and extra flags 5 | ; Library options: dependencies, extra library storages 6 | ; Advanced options: extra scripting 7 | ; 8 | ; Please visit documentation for the other options and examples 9 | ; http://docs.platformio.org/page/projectconf.html 10 | 11 | [env:M66] 12 | board = M66 13 | framework = OpenCPU M66 14 | platform = opencpu 15 | -------------------------------------------------------------------------------- /examples/hello_m66/src/main.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * WizIO 2018 Georgi Angelov 3 | * http://www.wizio.eu/ 4 | * https://github.com/Wiz-IO 5 | ****************************************************************************/ 6 | 7 | /**************************************************************************** 8 | * Included Files 9 | ****************************************************************************/ 10 | 11 | #include "custom_feature_def.h" 12 | #include "ql_type.h" 13 | #include "ql_stdlib.h" 14 | #include "ql_trace.h" 15 | #include "ql_uart.h" 16 | #include "ql_error.h" 17 | 18 | /**************************************************************************** 19 | * Defines 20 | ****************************************************************************/ 21 | 22 | #ifdef CORE_BC66 23 | # define DPORT UART_PORT0 24 | #else 25 | # define DPORT UART_PORT1 26 | #endif 27 | 28 | static Enum_SerialPort m_myUartPort = DPORT; 29 | #define DEBUG_ENABLE 1 30 | #if DEBUG_ENABLE > 0 31 | #define DEBUG_PORT DPORT 32 | #define DBG_BUF_LEN 512 33 | static char DBG_BUFFER[DBG_BUF_LEN]; 34 | #define APP_DEBUG(FORMAT,...) {\ 35 | Ql_memset(DBG_BUFFER, 0, DBG_BUF_LEN);\ 36 | Ql_sprintf(DBG_BUFFER,FORMAT,##__VA_ARGS__); \ 37 | if (UART_PORT2 == (DEBUG_PORT)) {\ 38 | Ql_Debug_Trace(DBG_BUFFER);\ 39 | } else {\ 40 | Ql_UART_Write((Enum_SerialPort)(DEBUG_PORT), (u8*)(DBG_BUFFER), Ql_strlen((const char *)(DBG_BUFFER)));\ 41 | }\ 42 | } 43 | #else 44 | #define APP_DEBUG(FORMAT,...) 45 | #endif 46 | 47 | static void CallBack_UART_Hdlr(Enum_SerialPort port, Enum_UARTEventType msg, bool level, void* customizedPara){} 48 | 49 | /**************************************************************************** 50 | * Source 51 | ****************************************************************************/ 52 | 53 | void proc_main_task(void) { 54 | s32 ret; 55 | ST_MSG msg; 56 | Ql_UART_Register(m_myUartPort, CallBack_UART_Hdlr, NULL); 57 | Ql_UART_Open(m_myUartPort, 115200, FC_NONE); 58 | APP_DEBUG("PlatformIO - Quectel OpenCPU 2018 Georgi Angelov\n"); 59 | while (1) { 60 | Ql_OS_GetMessage(&msg); 61 | switch(msg.message) { 62 | case MSG_ID_RIL_READY: 63 | Ql_RIL_Initialize(); 64 | APP_DEBUG("RIL is ready\n"); 65 | break; 66 | case MSG_ID_URC_INDICATION: 67 | APP_DEBUG("MSG_ID_URC_INDICATION: %d, %d\n", msg.param1, msg.param2); 68 | if (msg.param1 == 5 && msg.param2 == 1) { 69 | APP_DEBUG("Network Connected\n"); 70 | } 71 | default: 72 | break; 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /examples/hello_mc60/.gitignore: -------------------------------------------------------------------------------- 1 | .pioenvs 2 | -------------------------------------------------------------------------------- /examples/hello_mc60/.travis.yml: -------------------------------------------------------------------------------- 1 | # Continuous Integration (CI) is the practice, in software 2 | # engineering, of merging all developer working copies with a shared mainline 3 | # several times a day < http://docs.platformio.org/page/ci/index.html > 4 | # 5 | # Documentation: 6 | # 7 | # * Travis CI Embedded Builds with PlatformIO 8 | # < https://docs.travis-ci.com/user/integration/platformio/ > 9 | # 10 | # * PlatformIO integration with Travis CI 11 | # < http://docs.platformio.org/page/ci/travis.html > 12 | # 13 | # * User Guide for `platformio ci` command 14 | # < http://docs.platformio.org/page/userguide/cmd_ci.html > 15 | # 16 | # 17 | # Please choose one of the following templates (proposed below) and uncomment 18 | # it (remove "# " before each line) or use own configuration according to the 19 | # Travis CI documentation (see above). 20 | # 21 | 22 | 23 | # 24 | # Template #1: General project. Test it using existing `platformio.ini`. 25 | # 26 | 27 | # language: python 28 | # python: 29 | # - "2.7" 30 | # 31 | # sudo: false 32 | # cache: 33 | # directories: 34 | # - "~/.platformio" 35 | # 36 | # install: 37 | # - pip install -U platformio 38 | # 39 | # script: 40 | # - platformio run 41 | 42 | 43 | # 44 | # Template #2: The project is intended to by used as a library with examples 45 | # 46 | 47 | # language: python 48 | # python: 49 | # - "2.7" 50 | # 51 | # sudo: false 52 | # cache: 53 | # directories: 54 | # - "~/.platformio" 55 | # 56 | # env: 57 | # - PLATFORMIO_CI_SRC=path/to/test/file.c 58 | # - PLATFORMIO_CI_SRC=examples/file.ino 59 | # - PLATFORMIO_CI_SRC=path/to/test/directory 60 | # 61 | # install: 62 | # - pip install -U platformio 63 | # 64 | # script: 65 | # - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N 66 | -------------------------------------------------------------------------------- /examples/hello_mc60/README.rst: -------------------------------------------------------------------------------- 1 | .. Copyright 2014-present PlatformIO 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | http://www.apache.org/licenses/LICENSE-2.0 6 | Unless required by applicable law or agreed to in writing, software 7 | distributed under the License is distributed on an "AS IS" BASIS, 8 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | See the License for the specific language governing permissions and 10 | limitations under the License. 11 | 12 | How to build PlatformIO based project 13 | ===================================== 14 | 15 | -------------------------------------------------------------------------------- /examples/hello_mc60/lib/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for the project specific (private) libraries. 3 | PlatformIO will compile them to static libraries and link to executable file. 4 | 5 | The source code of each library should be placed in separate directory, like 6 | "lib/private_lib/[here are source files]". 7 | 8 | For example, see how can be organized `Foo` and `Bar` libraries: 9 | 10 | |--lib 11 | | |--Bar 12 | | | |--docs 13 | | | |--examples 14 | | | |--src 15 | | | |- Bar.c 16 | | | |- Bar.h 17 | | |--Foo 18 | | | |- Foo.c 19 | | | |- Foo.h 20 | | |- readme.txt --> THIS FILE 21 | |- platformio.ini 22 | |--src 23 | |- main.c 24 | 25 | Then in `src/main.c` you should use: 26 | 27 | #include 28 | #include 29 | 30 | // rest H/C/CPP code 31 | 32 | PlatformIO will find your libraries automatically, configure preprocessor's 33 | include paths and build them. 34 | 35 | See additional options for PlatformIO Library Dependency Finder `lib_*`: 36 | 37 | http://docs.platformio.org/page/projectconf.html#lib-install 38 | 39 | -------------------------------------------------------------------------------- /examples/hello_mc60/platformio.ini: -------------------------------------------------------------------------------- 1 | ; PlatformIO Project Configuration File 2 | ; 3 | ; Build options: build flags, source filter 4 | ; Upload options: custom upload port, speed and extra flags 5 | ; Library options: dependencies, extra library storages 6 | ; Advanced options: extra scripting 7 | ; 8 | ; Please visit documentation for the other options and examples 9 | ; http://docs.platformio.org/page/projectconf.html 10 | 11 | [env:MC60] 12 | board = MC60 13 | framework = OpenCPU MC60 14 | platform = opencpu 15 | -------------------------------------------------------------------------------- /examples/hello_mc60/src/main.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * WizIO 2018 Georgi Angelov 3 | * http://www.wizio.eu/ 4 | * https://github.com/Wiz-IO 5 | ****************************************************************************/ 6 | 7 | /**************************************************************************** 8 | * Included Files 9 | ****************************************************************************/ 10 | 11 | #include "custom_feature_def.h" 12 | #include "ql_type.h" 13 | #include "ql_stdlib.h" 14 | #include "ql_trace.h" 15 | #include "ql_uart.h" 16 | #include "ql_error.h" 17 | 18 | /**************************************************************************** 19 | * Defines 20 | ****************************************************************************/ 21 | 22 | #ifdef CORE_BC66 23 | # define DPORT UART_PORT0 24 | #else 25 | # define DPORT UART_PORT1 26 | #endif 27 | 28 | static Enum_SerialPort m_myUartPort = DPORT; 29 | #define DEBUG_ENABLE 1 30 | #if DEBUG_ENABLE > 0 31 | #define DEBUG_PORT DPORT 32 | #define DBG_BUF_LEN 512 33 | static char DBG_BUFFER[DBG_BUF_LEN]; 34 | #define APP_DEBUG(FORMAT,...) {\ 35 | Ql_memset(DBG_BUFFER, 0, DBG_BUF_LEN);\ 36 | Ql_sprintf(DBG_BUFFER,FORMAT,##__VA_ARGS__); \ 37 | if (UART_PORT2 == (DEBUG_PORT)) {\ 38 | Ql_Debug_Trace(DBG_BUFFER);\ 39 | } else {\ 40 | Ql_UART_Write((Enum_SerialPort)(DEBUG_PORT), (u8*)(DBG_BUFFER), Ql_strlen((const char *)(DBG_BUFFER)));\ 41 | }\ 42 | } 43 | #else 44 | #define APP_DEBUG(FORMAT,...) 45 | #endif 46 | 47 | static void CallBack_UART_Hdlr(Enum_SerialPort port, Enum_UARTEventType msg, bool level, void* customizedPara){} 48 | 49 | /**************************************************************************** 50 | * Source 51 | ****************************************************************************/ 52 | 53 | void proc_main_task(void) { 54 | s32 ret; 55 | ST_MSG msg; 56 | Ql_UART_Register(m_myUartPort, CallBack_UART_Hdlr, NULL); 57 | Ql_UART_Open(m_myUartPort, 115200, FC_NONE); 58 | APP_DEBUG("PlatformIO - Quectel OpenCPU 2018 Georgi Angelov\n"); 59 | while (1) { 60 | Ql_OS_GetMessage(&msg); 61 | switch(msg.message) { 62 | case MSG_ID_RIL_READY: 63 | Ql_RIL_Initialize(); 64 | APP_DEBUG("RIL is ready\n"); 65 | break; 66 | case MSG_ID_URC_INDICATION: 67 | APP_DEBUG("MSG_ID_URC_INDICATION: %d, %d\n", msg.param1, msg.param2); 68 | if (msg.param1 == 5 && msg.param2 == 1) { 69 | APP_DEBUG("Network Connected\n"); 70 | } 71 | default: 72 | break; 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "framework-opencpu": [ 3 | { 4 | "url": "http://wizio.eu/platformio/framework-opencpu-1.0.0.tar.gz", 5 | "sha1": "", 6 | "system": "*", 7 | "version": "1.0.0" 8 | } 9 | ], 10 | "tool-opencpu": [ 11 | { 12 | "url": "http://wizio.eu/platformio/tool-opencpu-1.0.0.tar.gz", 13 | "sha1": "", 14 | "system": [ 15 | "windows" 16 | ], 17 | "version": "1.0.0" 18 | } 19 | ], 20 | "toolchain-opencpu": [ 21 | { 22 | "url": "http://wizio.eu/platformio/toolchain-opencpu-4.8.3.tar.gz", 23 | "sha1": "", 24 | "system": [ 25 | "windows" 26 | ], 27 | "version": "4.8.3" 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /on_linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wiz-IO/platform-opencpu/d044183db60d73f85accb76282e99cbbedda8da5/on_linux.png -------------------------------------------------------------------------------- /platform.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "opencpu", 3 | "title": "Quectel OpenCPU", 4 | "description": "Quectel OpenCPU 2018 Georgi Angelov", 5 | "url": "http://platformio.org/platforms/opencpu", 6 | "homepage": "http://www.wizio.eu/", 7 | "license": "Apache-2.0", 8 | "engines": { 9 | "platformio": "^3.0.0" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "https://github.com/Wiz-IO/platform-opencpu.git" 14 | }, 15 | "version": "1.0.0", 16 | "packageRepositories": [ 17 | "https://dl.bintray.com/platformio/dl-packages/manifest.json", 18 | "http://dl.platformio.org/packages/manifest.json", 19 | "http://wizio.eu/platformio/manifest.json" 20 | ], 21 | "frameworks": { 22 | "OpenCPU BC66": { 23 | "package": "framework-opencpu", 24 | "script": "builder/frameworks/bc66.py" 25 | }, 26 | "OpenCPU M66": { 27 | "package": "framework-opencpu", 28 | "script": "builder/frameworks/m66.py" 29 | }, 30 | "OpenCPU MC60": { 31 | "package": "framework-opencpu", 32 | "script": "builder/frameworks/mc60.py" 33 | } 34 | }, 35 | "packages": { 36 | "toolchain-opencpu": { 37 | "type": "toolchain", 38 | "version": ">=4.8.3" 39 | }, 40 | "framework-opencpu": { 41 | "type": "framework", 42 | "optional": true, 43 | "version": ">=1.0.0" 44 | }, 45 | "tool-opencpu": { 46 | "type": "uploader", 47 | "optional": true, 48 | "version": ">=1.0.0" 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /platform.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wiz-IO/platform-opencpu/d044183db60d73f85accb76282e99cbbedda8da5/platform.png -------------------------------------------------------------------------------- /project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wiz-IO/platform-opencpu/d044183db60d73f85accb76282e99cbbedda8da5/project.png -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wiz-IO/platform-opencpu/d044183db60d73f85accb76282e99cbbedda8da5/screenshot.png --------------------------------------------------------------------------------