-
-
Notifications
You must be signed in to change notification settings - Fork 43
Framework ThreadX
Georgi Angelov edited this page Oct 19, 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
- SDK2 used by default ( 2.7.3.3 ) firmwares labeled with BG96...R02...
-
- BG96MAR02A07M1G_BETA0310A
-
- BG96MAR02A09M1G_01.011.01.011 ( recommended )
- SDK2831 ( see SDK2 )
- SDK325 ( not tested ) MMU Enabled [ Memory Management Unit ]
- SDK424 ( not tested ) MMU Enabled
- QFlash ( Windows )
- QEFS Explore ( Windows )
- Lunux uploader
- PlatformIO Home - New Project
-
- Name: { project-name }
-
- Board: bg96 ( search bg96 )
-
- Framework: ThreadX
-
- Тhe platform will create a main.c
[env:bg6]
platform = quectel
framework = threadx
board = bg96
upload_port = COM34 ; select DM COM Port
monitor_port = COM24 ; select module uart
monitor_speed = 115200
;board_build.base = ; empty is 0x40000000
;board_build.sdk = ; empty is SDK2, other SDK2831 SDK325 SDK424
;board_build.heap = ; empty is -D HEAP=1048576
#include <txm_module.h>
__attribute__((section(".library"))) int TXM_MODULE_THREAD_ENTRY(void) {
while (1) {
tx_thread_sleep(1000); // USE ONLY HERE
}
}
- From SDK 3 LINK
Sometimes user app crash and can not be removed or upload new
Solution 1
Begin project with wait SIM ready ... qapi_Device_Info_Get(QAPI_DEVICE_INFO_SIM_STATE_E ... )
Solution 2
- Reflash ( _slow _ )
- Reflash only EFS ( fast )
-
- Download this python scrypt
-
- and read the scrypt beginning for instructions
Note: is in process, there may be bugs
Video https://www.youtube.com/watch?v=OjdAD0WR6vw
Tested with SDK2
-
- BG96MAR02A07M1G_BETA0310A
-
- BG96MAR02A09M1G_01.011.01.011 ( recommended )
- other - later
- PlatformIO Home - New Project
-
- Name: { project-name }
-
- Board: bg96 ( search bg96 )
-
- Framework: Arduino
[env:bg6]
platform = quectel
framework = arduino
board = bg96
upload_port = COM34 ; select DM COM Port
monitor_port = COM24 ; select module uart
monitor_speed = 115200
;board_build.base = ; empty is 0x40000000
;board_build.sdk = ; empty is SDK2
;board_build.heap = ; empty is -D HEAP=1048576
- ( will more ) LINK
void http_get(const char *str_ip, const char *s_request)
{
int sock = socket(AF_INET, SOCK_STREAM, 0);
printf("[SOC] Socket = %d\n", sock);
struct sockaddr_in address;
address.sin_addr.s_addr = inet_addr(str_ip);
address.sin_family = AF_INET;
address.sin_port = htons(80);
int rc = connect(sock, (struct sockaddr *)&address, sizeof(address));
printf("[SOC] Connect = %d\n", rc);
rc = write(sock, s_request, strlen(s_request));
printf("[SOC] Write = %d\n", rc);
rc = read(sock, http_buffer, sizeof(http_buffer));
printf("[SOC] Read = %d\n", rc);
printf("%.*s", sizeof(http_buffer), http_buffer);
rc = close(sock);
printf("[SOC] Close = %d\n", rc);
}
void TEST_SOCKET(void)
{
printf("\n -= TEST SOCKET =-\n");
int dss = open("/dss/act", 0); // open Data-Call, default GPRS, IPv4, connect blocked
http_get(HOST_IP, HTTP_REQUEST);
close(dss);
printf("\n");
}
WizIO 2018 Georgi Angelov