Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

V1.20.2.rc9 dev againagain #456

Merged
merged 26 commits into from
Jun 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
618f71d
Fix core panics: Don't use m_malloc and gc_malloc unintended
amotl Nov 14, 2019
97620ae
assert the layout of the config block
peter-pycom Mar 20, 2020
873040c
document the pycom_config_block_t layout
peter-pycom Mar 20, 2020
8495c7d
Fixed memory allocations in LittleFS files.
salal-m May 6, 2020
669dfe2
Updated mem free in socketfifo.c required for last commit's changes i…
salal-m May 7, 2020
6cb700a
Fixed memory allocations in Pycom Modules files
salal-m May 7, 2020
25183fb
Re-added the indentations to signify the code blocks under mutex lock.
salal-m May 8, 2020
a106cb4
Added a check before accessing the IP Address in the MDNS query respo…
salal-m May 8, 2020
8e08fab
Replaced heap_caps_malloc/free with malloc/free.
salal-m May 8, 2020
f58301e
Merge pull request #123 from pycom/pr418
May 18, 2020
5a6aa0a
PyJTAG: LTE uart 1
peter-pycom May 19, 2020
71354b9
Merge pull request #124 from pycom/pyjtag_lte
peter-pycom May 19, 2020
ba5b4f1
sigfox: fix commit hash (#125)
peter-pycom May 25, 2020
79ee9bf
Merge pull request #115 from pycom/pybytes_config_block
peter-pycom May 25, 2020
6cc3aff
Fix an issue in wrap_socket() results exception when no certificate v…
geza-pycom May 31, 2020
36b44d3
Merge pull request #126 from geza-pycom/SSL_no_verification
Jun 2, 2020
b74db42
Fix integer overflow in filesystem stat implementation. Resolve #409.…
geza-pycom Jun 10, 2020
669d1e3
add wlan_ap_tcpip_sta_list function that lists the connected devices …
geza-pycom Jun 10, 2020
73f0021
HTTP/S Server/Client Module (#118)
mate-pycom Jun 10, 2020
c9b534a
update idf hash (#130)
peter-pycom Jun 10, 2020
29d8021
Revert "update idf hash (#130)"
peter-pycom Jun 10, 2020
7f84b9c
Revert "HTTP/S Server/Client Module (#118)"
peter-pycom Jun 10, 2020
2186b33
idf 6ec081c (#132)
peter-pycom Jun 10, 2020
9f6e28e
Update pybytes to 1.5.0 (#133)
Xykon Jun 10, 2020
63d7be9
v1.20.2.rc9 (#135)
peter-pycom Jun 10, 2020
38d9cc7
Merge remote-tracking branch 'pycom-public/Dev'
peter-pycom Jun 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion esp32/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ifeq ($(wildcard boards/$(BOARD)/.),)
$(error Invalid BOARD specified)
endif

IDF_HASH=d072c55
IDF_HASH=6ec081c

TARGET ?= boot_app

Expand Down
11 changes: 11 additions & 0 deletions esp32/PyJTAG/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ It can be advisable to use the `gdb` from the latest xtensa toolchain, even if a

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


## Versions
There are two generations of PyJTAG boards:

1) First generation with green PCB has three blocks of switches. (Make sure SAFE_BOOT_SW is off.)
2) Second generation with black PCB and two blocks of switches.

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.

To reach the modem UART connect to `/dev/ttyUSB1`.

## Extra
A few more details are here: https://pycomiot.atlassian.net/wiki/spaces/FIR/pages/966295564/Usage+of+PyJTAG

2 changes: 1 addition & 1 deletion esp32/fatfs/src/drivers/sflash_diskio.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ DRESULT sflash_disk_init (void) {
sflash_start_address = SFLASH_START_ADDR_4MB;
sflash_fs_sector_count = SFLASH_FS_SECTOR_COUNT_4MB;
}
sflash_block_cache = (uint8_t *)heap_caps_malloc(SFLASH_BLOCK_SIZE, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
sflash_block_cache = (uint8_t *)malloc(SFLASH_BLOCK_SIZE);
sflash_prev_block_addr = UINT32_MAX;
sflash_cache_is_dirty = false;
sflash_init_done = true;
Expand Down
17 changes: 7 additions & 10 deletions esp32/frozen/Pybytes/_pybytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,16 +273,13 @@ def connect(self):
self.enable_terminal()

# CHECK PYMESH FIRMWARE VERSION
try:
if hasattr(os.uname(),'pymesh'):
try:
from pybytes_pymesh_config import PybytesPymeshConfig
except:
from _pybytes_pymesh_config import PybytesPymeshConfig
self.__pymesh = PybytesPymeshConfig(self)
self.__pymesh.pymesh_init()
except Exception as e:
print("Exception: {}".format(e))
if hasattr(os.uname(), 'pymesh'):
try:
from pybytes_pymesh_config import PybytesPymeshConfig
except:
from _pybytes_pymesh_config import PybytesPymeshConfig
self.__pymesh = PybytesPymeshConfig(self)
self.__pymesh.pymesh_init()
else:
print('ERROR! Could not connect to Pybytes!')

Expand Down
1 change: 1 addition & 0 deletions esp32/frozen/Pybytes/_pybytes_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class constants:
__FCOTA_COMMAND_FILE_UPDATE = 0x02
__FCOTA_PING = 0x03
__FCOTA_COMMAND_FILE_DELETE = 0x04
__FCOTA_COMMAND_FILE_UPDATE_NO_RESET = 0x05

__DEVICE_TYPE_WIPY = 0x00
__DEVICE_TYPE_LOPY = 0x01
Expand Down
17 changes: 17 additions & 0 deletions esp32/frozen/Pybytes/_pybytes_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,23 @@ def __process_recv_message(self, message):
else:
self.send_fcota_ping("file update failed!")

elif (command == constants.__FCOTA_COMMAND_FILE_UPDATE_NO_RESET):
bodyString = body[1:len(body)].decode()
splittedBody = bodyString.split(',')
if (len(splittedBody) >= 2):
path = splittedBody[0]
print_debug(2, path[len(path)-7:len(path)])
if (path[len(path)-7:len(path)] != '.pymakr'):
self.send_fcota_ping('updating file...')
newContent = bodyString[len(path)+1:len(body)]
if (self.__FCOTA.update_file_content(path, newContent) is True): # noqa
size = self.__FCOTA.get_file_size(path)
self.send_fcota_file(newContent, path, size)
else:
self.send_fcota_ping('file update failed!')
else:
self.send_fcota_ping("file update failed!")

elif (command == constants.__FCOTA_PING):
self.send_fcota_ping('')

Expand Down
2 changes: 1 addition & 1 deletion esp32/frozen/Pybytes/_pybytes_pymesh_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def write_config(self, wmac, file='/flash/pymesh_config.json', pymeshSettings={}
"ble_api": False,
"ble_name_prefix": "Device-{}".format(wmac),
"br_prio": 0,
"br_ena": False,
"br_ena": customSettings["br_ena"],
"autostart": True
}

Expand Down
20 changes: 10 additions & 10 deletions esp32/ftp/ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ STATIC FRESULT f_readdir_helper(ftp_dir_t *dp, ftp_fileinfo_t *fno ) {
if(length_of_relative_path > 1) {
path_length++;
}
char* file_relative_path = m_malloc(path_length);
char* file_relative_path = malloc(path_length);

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

m_free(file_relative_path);
free(file_relative_path);
}

xSemaphoreGive(littlefs->mutex);
Expand Down Expand Up @@ -614,10 +614,10 @@ static void ftp_return_to_previous_path (char *pwd, char *dir);
******************************************************************************/
void ftp_init (void) {
// allocate memory for the data buffer, and the file system structs (from the RTOS heap)
ftp_data.dBuffer = heap_caps_malloc(FTP_BUFFER_SIZE, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
ftp_path = heap_caps_malloc(FTP_MAX_PARAM_SIZE, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
ftp_scratch_buffer = heap_caps_malloc(FTP_MAX_PARAM_SIZE, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
ftp_cmd_buffer = heap_caps_malloc(FTP_MAX_PARAM_SIZE + FTP_CMD_SIZE_MAX, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
ftp_data.dBuffer = malloc(FTP_BUFFER_SIZE);
ftp_path = malloc(FTP_MAX_PARAM_SIZE);
ftp_scratch_buffer = malloc(FTP_MAX_PARAM_SIZE);
ftp_cmd_buffer = malloc(FTP_MAX_PARAM_SIZE + FTP_CMD_SIZE_MAX);
SOCKETFIFO_Init (&ftp_socketfifo, (void *)ftp_fifoelements, FTP_SOCKETFIFO_ELEMENTS_MAX);
ftp_data.c_sd = -1;
ftp_data.d_sd = -1;
Expand Down Expand Up @@ -933,7 +933,7 @@ static void ftp_send_reply (uint32_t status, char *message) {
strcat ((char *)ftp_cmd_buffer, "\r\n");
fifoelement.sd = &ftp_data.c_sd;
fifoelement.datasize = strlen((char *)ftp_cmd_buffer);
fifoelement.data = pvPortMalloc(fifoelement.datasize);
fifoelement.data = malloc(fifoelement.datasize);
if (status == 221) {
fifoelement.closesockets = E_FTP_CLOSE_CMD_AND_DATA;
} else if (status == 426 || status == 451 || status == 550) {
Expand All @@ -945,7 +945,7 @@ static void ftp_send_reply (uint32_t status, char *message) {
if (fifoelement.data) {
memcpy (fifoelement.data, ftp_cmd_buffer, fifoelement.datasize);
if (!SOCKETFIFO_Push (&fifoelement)) {
vPortFree(fifoelement.data);
free(fifoelement.data);
}
}
}
Expand Down Expand Up @@ -979,13 +979,13 @@ static void ftp_send_from_fifo (void) {
ftp_close_filesystem_on_error();
}
if (fifoelement.freedata) {
vPortFree(fifoelement.data);
free(fifoelement.data);
}
}
} else { // socket closed, remove it from the queue
SOCKETFIFO_Pop (&fifoelement);
if (fifoelement.freedata) {
vPortFree(fifoelement.data);
free(fifoelement.data);
}
}
} else if (ftp_data.state == E_FTP_STE_END_TRANSFER && (ftp_data.d_sd > 0)) {
Expand Down
5 changes: 2 additions & 3 deletions esp32/littlefs/lfs_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

#include "py/mpconfig.h"
#include "py/misc.h"
#include "py/gc.h"

// System includes
#include <stdint.h>
Expand Down Expand Up @@ -204,7 +203,7 @@ uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size);
// Note, memory must be 64-bit aligned
static inline void *lfs_malloc(size_t size) {
#ifndef LFS_NO_MALLOC
return gc_alloc(size, false);
return malloc(size);
#else
return NULL;
#endif
Expand All @@ -213,7 +212,7 @@ static inline void *lfs_malloc(size_t size) {
// Deallocate memory, only used if buffers are not provided to littlefs
static inline void lfs_free(void *p) {
#ifndef LFS_NO_MALLOC
m_free(p);
free(p);
#endif
}

Expand Down
Loading