Skip to content

Framework ThreadX

Georgi Angelov edited this page Nov 29, 2019 · 86 revisions

Quectel BG96 Framework for PlatformIO

  • ThreadX is default API for user applications inside the modules with Qualcomm chipset
  • Module BG96 (GPRS + CAT/NB + GPS)
  • Quectel Support

Firmwares and Quectel BG96 ThreadX SDK

  • SDK2 used by default ( recommended ) (2.7.3.3) firmwares labeled with BG96...R02...
    • BG96MAR02...ALL
    • BG96MAR02A09M1G_01.011.01.011 ( recommended )
  • SDK2831 ( see SDK2 )
  • SDK325 ( in progress ) MMU Enabled (..R03..)
    • BG96MAR03A03M1G_01.002.01.002 ( in progress )
  • SDK424 ( not tested ) MMU Enabled (..R04..)

Documentations, Firmwares and Tools ask Quectel

  • Integrated application uploader ( Windows & Unix-like )
  • QFlash ( Windows )
  • QEFS Explore ( Windows )

Create New Project

  • PlatformIO Home - New Project
    • Name: { project-name }
    • Board: bg96 ( search bg96 )
    • Framework: ThreadX
    • Тhe platform will create as template main.c

Project INI file

[env:bg6]
platform = quectel
framework = threadx
board = bg96

; select DM COM Port
upload_port   = COM12 

; select module uart
monitor_port  = COM34 
monitor_speed = 115200

;board_build.base = 
;   empty is 0x40000000 or 0x43000000

;board_build.sdk =  
;   empty is SDK2 or SDK2831 SDK325 SDK424

;board_build.heap = 
;   empty is -D HEAP=1048576

The MAIN entry

#include <txm_module.h>
__attribute__((section(".library"))) int TXM_MODULE_THREAD_ENTRY(void) {
    while (1) {
        tx_thread_sleep(1000); // USE ONLY HERE
    }
}

remark: attribute section library is used only for 'sorting' ... can be removed

Thread Examples

NOTES

Sometimes user application crash on developing ( MMU, NULL, allocate ... etc )

and application can not be removed or upload new ...

Solution 1

Use SIM card as "key"

begin project with wait SIM ready ... qapi_Device_Info_Get(QAPI_DEVICE_INFO_SIM_STATE_E ... )

and next allocate resources. If app crash, remove sim, reset module and upload new app ...

Solution 2

  • Full Reflash ( slow )
  • Reflash only EFS ( fast )
    • and read the scrypt beginning for instructions

ARDUINO Applications

note: in process, there may be bugs

Arduino Quectel BG96

Video https://www.youtube.com/watch?v=OjdAD0WR6vw

Create New Project

  • PlatformIO Home - New Project
    • Name: { project-name }
    • Board: bg96 ( search bg96 )
    • Framework: Arduino

Project INI file

[env:bg6]
platform = quectel
framework = arduino
board = bg96

;   select DM COM Port
upload_port = COM34 

; select module uart
monitor_port = COM24 
monitor_speed = 115200

;   empty is 0x40000000 or 0x43000000
;board_build.base = 

;   empty is SDK2 or SDK2831 SDK325 SDK424 
;board_build.sdk =  

;   empty is -D HEAP=1048576
;board_build.heap = 

Arduino Examples

  • ( will more ) LINK