8000 Merge pull request #456 from pycom/v1.20.2.rc9_Dev_againagain · embenix/pycom-micropython-sigfox@1a257d8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1a257d8

Browse files
authored
Merge pull request pycom#456 from pycom/v1.20.2.rc9_Dev_againagain
V1.20.2.rc9
2 parents 6d01270 + 38d9cc7 commit 1a257d8

32 files changed

+232
-157
lines changed

esp32/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ifeq ($(wildcard boards/$(BOARD)/.),)
1414
$(error Invalid BOARD specified)
1515
endif
1616

17-
IDF_HASH=d072c55
17+
IDF_HASH=6ec081c
1818

1919
TARGET ?= boot_app
2020

esp32/PyJTAG/Readme.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,17 @@ It can be advisable to use the `gdb` from the latest xtensa toolchain, even if a
8080

8181
If `gdb` does not reach the `Thread 1 hit Temporary breakpoint ...` line, close and reopen `gdb`.
8282

83+
84+
## Versions
85+
There are two generations of PyJTAG boards:
86+
87+
1) First generation with green PCB has three blocks of switches. (Make sure SAFE_BOOT_SW is off.)
88+
2) Second generation with black PCB and two blocks of switches.
89+
90+
Both generation boards can be equipped with pogo pins that connect to the bottom of the development board and allow LTE debugging. There can either be pins that connect to a GPy or pins that conenct to a FiPy.
91+
92+
To reach the modem UART connect to `/dev/ttyUSB1`.
93+
8394
## Extra
8495
A few more details are here: https://pycomiot.atlassian.net/wiki/spaces/FIR/pages/966295564/Usage+of+PyJTAG
8596

esp32/fatfs/src/drivers/sflash_diskio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ DRESULT sflash_disk_init (void) {
5454
sflash_start_address = SFLASH_START_ADDR_4MB;
5555
sflash_fs_sector_count = SFLASH_FS_SECTOR_COUNT_4MB;
5656
}
57-
sflash_block_cache = (uint8_t *)heap_caps_malloc(SFLASH_BLOCK_SIZE, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
57+
sflash_block_cache = (uint8_t *)malloc(SFLASH_BLOCK_SIZE);
5858
sflash_prev_block_addr = UINT32_MAX;
5959
sflash_cache_is_dirty = false;
6060
sflash_init_done = true;

esp32/frozen/Pybytes/_pybytes.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -273,16 +273,13 @@ def connect(self):
273273
self.enable_terminal()
274274

275275
# CHECK PYMESH FIRMWARE VERSION
276-
try:
277-
if hasattr(os.uname(),'pymesh'):
278-
try:
279-
from pybytes_pymesh_config import PybytesPymeshConfig
280-
except:
281-
from _pybytes_pymesh_config import PybytesPymeshConfig
282-
self.__pymesh = PybytesPymeshConfig(self)
283-
self.__pymesh.pymesh_init()
284-
except Exception as e:
285-
print("Exception: {}".format(e))
276+
if hasattr(os.uname(), 'pymesh'):
277+
try:
278+
from pybytes_pymesh_config import PybytesPymeshConfig
279+
except:
280+
from _pybytes_pymesh_config import PybytesPymeshConfig
281+
self.__pymesh = PybytesPymeshConfig(self)
282+
self.__pymesh.pymesh_init()
286283
else:
287284
print('ERROR! Could not connect to Pybytes!')
288285

esp32/frozen/Pybytes/_pybytes_constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ class constants:
9696
__FCOTA_COMMAND_FILE_UPDATE = 0x02
9797
__FCOTA_PING = 0x03
9898
__FCOTA_COMMAND_FILE_DELETE = 0x04
99+
__FCOTA_COMMAND_FILE_UPDATE_NO_RESET = 0x05
99100

100101
__DEVICE_TYPE_WIPY = 0x00
101102
__DEVICE_TYPE_LOPY = 0x01

esp32/frozen/Pybytes/_pybytes_protocol.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,23 @@ def __process_recv_message(self, message):
276276
else:
277277
self.send_fcota_ping("file update failed!")
278278

279+
elif (command == constants.__FCOTA_COMMAND_FILE_UPDATE_NO_RESET):
280+
bodyString = body[1:len(body)].decode()
281+
splittedBody = bodyString.split(',')
282+
if (len(splittedBody) >= 2):
283+
path = splittedBody[0]
284+
print_debug(2, path[len(path)-7:len(path)])
285+
if (path[len(path)-7:len(path)] != '.pymakr'):
286+
self.send_fcota_ping('updating file...')
287+
newContent = bodyString[len(path)+1:len(body)]
288+
if (self.__FCOTA.update_file_content(path, newContent) is True): # noqa
289+
size = self.__FCOTA.get_file_size(path)
290+
self.send_fcota_file(newContent, path, size)
291+
else:
292+
self.send_fcota_ping('file update failed!')
293+
else:
294+
self.send_fcota_ping("file update failed!")
295+
279296
elif (command == constants.__FCOTA_PING):
280297
self.send_fcota_ping('')
281298

esp32/frozen/Pybytes/_pybytes_pymesh_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def write_config(self, wmac, file='/flash/pymesh_config.json', pymeshSettings={}
150150
"ble_api": False,
151151
"ble_name_prefix": "Device-{}".format(wmac),
152152
"br_prio": 0,
153-
"br_ena": False,
153+
"br_ena": customSettings["br_ena"],
154154
"autostart": True
155155
}
156156

esp32/ftp/ftp.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ STATIC FRESULT f_readdir_helper(ftp_dir_t *dp, ftp_fileinfo_t *fno ) {
338338
if(length_of_relative_path > 1) {
339339
path_length++;
340340
}
341-
char* file_relative_path = m_malloc(path_length);
341+
char* file_relative_path = malloc(path_length);
342342

343343
// Copy the current working directory (relative path)
344344
memcpy(file_relative_path, path_relative, length_of_relative_path);
@@ -359,7 +359,7 @@ STATIC FRESULT f_readdir_helper(ftp_dir_t *dp, ftp_fileinfo_t *fno ) {
359359
fno->u.fpinfo_lfs.timestamp.ftime = 0;
360360
}
361361

362-
m_free(file_relative_path);
362+
free(file_relative_path);
363363
}
364364

365365
xSemaphoreGive(littlefs->mutex);
@@ -614,10 +614,10 @@ static void ftp_return_to_previous_path (char *pwd, char *dir);
614614
******************************************************************************/
615615
void ftp_init (void) {
616616
// allocate memory for the data buffer, and the file system structs (from the RTOS heap)
617-
ftp_data.dBuffer = heap_caps_malloc(FTP_BUFFER_SIZE, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
618-
ftp_path = heap_caps_malloc(FTP_MAX_PARAM_SIZE, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
619-
ftp_scratch_buffer = heap_caps_malloc(FTP_MAX_PARAM_SIZE, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
620-
ftp_cmd_buffer = heap_caps_malloc(FTP_MAX_PARAM_SIZE + FTP_CMD_SIZE_MAX, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
617+
ftp_data.dBuffer = malloc(FTP_BUFFER_SIZE);
618+
ftp_path = malloc(FTP_MAX_PARAM_SIZE);
619+
ftp_scratch_buffer = malloc(FTP_MAX_PARAM_SIZE);
620+
ftp_cmd_buffer = malloc(FTP_MAX_PARAM_SIZE + FTP_CMD_SIZE_MAX);
621621
SOCKETFIFO_Init (&ftp_socketfifo, (void *)ftp_fifoelements, FTP_SOCKETFIFO_ELEMENTS_MAX);
622622
ftp_data.c_sd = -1;
623623
ftp_data.d_sd = -1;
@@ -933,7 +933,7 @@ static void ftp_send_reply (uint32_t status, char *message) {
933933
strcat ((char *)ftp_cmd_buffer, "\r\n");
934934
fifoelement.sd = &ftp_data.c_sd;
935935
fifoelement.datasize = strlen((char *)ftp_cmd_buffer);
936-
fifoelement.data = pvPortMalloc(fifoelement.datasize);
936+
fifoelement.data = malloc(fifoelement.datasize);
937937
if (status == 221) {
938938
fifoelement.closesockets = E_FTP_CLOSE_CMD_AND_DATA;
939939
} else if (status == 426 || status == 451 || status == 550) {
@@ -945,7 +945,7 @@ static void ftp_send_reply (uint32_t status, char *message) {
945945
if (fifoelement.data) {
946946
memcpy (fifoelement.data, ftp_cmd_buffer, fifoelement.datasize);
947947
if (!SOCKETFIFO_Push (&fifoelement)) {
948-
vPortFree(fifoelement.data);
948+
free(fifoelement.data);
949949
}
950950
}
951951
}
@@ -979,13 +979,13 @@ static void ftp_send_from_fifo (void) {
979979
ftp_close_filesystem_on_error();
980980
}
981981
if (fifoelement.freedata) {
982-
vPortFree(fifoelement.data);
982+
free(fifoelement.data);
983983
}
984984
}
985985
} else { // socket closed, remove it from the queue
986986
SOCKETFIFO_Pop (&fifoelement);
987987
if (fifoelement.freedata) {
988-
vPortFree(fifoelement.data);
988+
free(fifoelement.data);
989989
}
990990
}
991991
} else if (ftp_data.state == E_FTP_STE_END_TRANSFER && (ftp_data.d_sd > 0)) {

esp32/littlefs/lfs_util.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
#include "py/mpconfig.h"
2323
#include "py/misc.h"
24-
#include "py/gc.h"
2524

2625
// System includes
2726
#include <stdint.h>
@@ -204,7 +203,7 @@ uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size);
204203
// Note, memory must be 64-bit aligned
205204
static inline void *lfs_malloc(size_t size) {
206205
#ifndef LFS_NO_MALLOC
207-
return gc_alloc(size, false);
206+
return malloc(size);
208207
#else
209208
return NULL;
210209
#endif
@@ -213,7 +212,7 @@ static inline void *lfs_malloc(size_t size) {
213212
// Deallocate memory, only used if buffers are not provided to littlefs
214213
static inline void lfs_free(void *p) {
215214
#ifndef LFS_NO_MALLOC
216-
m_free(p);
215+
free(p);
217216
#endif
218217
}
219218

0 commit comments

Comments
 (0)
0