10000 esp32: Update with master up to version 1.10.2.b1. · ayoy/pycom-micropython-sigfox@aef3e7c · GitHub
[go: up one dir, main page]

Skip to content

Commit aef3e7c

Browse filesBrowse files
author
Daniel Campora
committed
esp32: Update with master up to version 1.10.2.b1.
1 parent 859c7d0 commit aef3e7c

31 files changed

+27
-18
lines changed

esp32/bootloader/bootloader.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,13 @@ static void IRAM_ATTR flash_gpio_configure()
851851

852852
static void clock_configure(void)
853853
{
854+
// ROM bootloader may have put a lot of text into UART0 FIFO.
855+
// Wait for it to be printed.
856+
// This is not needed on power on reset, when ROM bootloader is running at
857+
// 40 MHz. But in case of TG WDT reset, CPU may still be running at >80 MHZ,
858+
// and will be done with the bootloader much earlier than UART FIFO is empty.
859+
uart_tx_wait_idle(0);
860+
854861
/* Set CPU to 80MHz. Keep other clocks unmodified. */
855862
rtc_cpu_freq_t cpu_freq = RTC_CPU_FREQ_80M;
856863

@@ -892,8 +899,7 @@ static void uart_console_configure(void)
892899
uartAttach();
893900
ets_install_uart_printf();
894901

895-
// ROM bootloader may have put a lot of text into UART0 FIFO.
896-
// Wait for it to be printed.
902+
// Wait for UART FIFO to be empty.
897903
uart_tx_wait_idle(0);
898904

899905
#if CONFIG_CONSOLE_UART_CUSTOM

esp32/frozen/MQTTMsgHandler.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,8 @@ def __init__(self, receive_callback, connect_helper):
2323
self._poll = select.poll()
2424
self._output_queue=[]
2525
self._out_packet_mutex=_thread.allocate_lock()
26-
<<<<<<< HEAD
27-
_thread.stack_size(5120)
28-
_thread.start_new_thread(self._io_thread_func,())
29-
=======
3026
_thread.stack_size(8192)
3127
_thread.start_new_thread(self._io_thread_func, ())
32-
>>>>>>> esp32: Update with master up to release 1.10.1.b1
3328
self._recv_callback = receive_callback
3429
self._connect_helper = connect_helper
3530
self._pingSent=False

esp32/lib/libbt.a

0 Bytes
Binary file not shown.

esp32/lib/libcxx.a

0 Bytes
Binary file not shown.

esp32/lib/libdriver.a

64 Bytes
Binary file not shown.

esp32/lib/libesp32.a

8 Bytes
Binary file not shown.

esp32/lib/libesp_adc_cal.a

0 Bytes
Binary file not shown.

esp32/lib/libexpat.a

0 Bytes
Binary file not shown.

esp32/lib/libfreertos.a

512 Bytes
Binary file not shown.

esp32/lib/libheap.a

0 Bytes
Binary file not shown.

esp32/lib/libjsmn.a

0 Bytes
Binary file not shown.

esp32/lib/libjson.a

0 Bytes
Binary file not shown.

esp32/lib/liblog.a

0 Bytes
Binary file not shown.

esp32/lib/liblwip.a

0 Bytes
Binary file not shown.

esp32/lib/libmbedtls.a

0 Bytes
Binary file not shown.

esp32/lib/libmicro-ecc.a

0 Bytes
Binary file not shown.

esp32/lib/libnewlib.a

0 Bytes
Binary file not shown.

esp32/lib/libnghttp.a

0 Bytes
Binary file not shown.

esp32/lib/libnvs_flash.a

0 Bytes
Binary file not shown.

esp32/lib/libopenssl.a

0 Bytes
Binary file not shown.

esp32/lib/libpthread.a

0 Bytes
Binary file not shown.

esp32/lib/libsdmmc.a

0 Bytes
Binary file not shown.

esp32/lib/libsoc.a

56 Bytes
Binary file not shown.

esp32/lib/libspi_flash.a

0 Bytes
Binary file not shown.

esp32/lib/libtcpip_adapter.a

0 Bytes
Binary file not shown.

esp32/lib/libvfs.a

0 Bytes
Binary file not shown.

esp32/lib/libwpa_supplicant.a

0 Bytes
Binary file not shown.

esp32/lib/libxtensa-debug-module.a

0 Bytes
Binary file not shown.

esp32/main.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ void app_main(void) {
104104
machine_init0();
105105

106106
// initalize the non-volatile flash space
107-
nvs_flash_init();
107+
if (nvs_flash_init() == ESP_ERR_NVS_NO_FREE_PAGES) {
108+
nvs_flash_erase();
109+
nvs_flash_init();
110+
}
108111

109112
esp_chip_info_t chip_info;
110113
esp_chip_info(&chip_info);
@@ -148,5 +151,5 @@ void app_main(void) {
148151
// create the MicroPython task
149152
mpTaskHandle =
150153
(TaskHandle_t)xTaskCreateStaticPinnedToCore(TASK_Micropython, "MicroPy", MICROPY_TASK_STACK_LEN, NULL,
151-
MICROPY_TASK_PRIORITY, mpTaskStack, &mpTaskTCB, 0);
154+
MICROPY_TASK_PRIORITY, mpTaskStack, &mpTaskTCB, 0);
152155
}

esp32/mods/machuart.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,19 @@ bool uart_tx_char(mach_uart_obj_t *self, int c) {
145145

146146
bool uart_tx_strn(mach_uart_obj_t *self, const char *str, uint len) {
147147
bool ret = true;
148+
uint32_t isrmask = 0;
149+
pin_obj_t * pin = (pin_obj_t *)((mp_obj_t *)self->pins)[0];
148150

149151
if (self->n_pins == 1) {
150-
pin_obj_t * pin = (pin_obj_t *)((mp_obj_t *)self->pins)[0];
151152
// make it UART Tx
152153
pin->value = 1;
153154
pin_deassign(pin);
154-
pin->mode = GPIO_MODE_OUTPUT;
155155
pin->af_out = mach_uart_pin_af[self->uart_id][0];
156156
gpio_matrix_out(pin->pin_number, pin->af_out, false, false);
157+
// clear the Tx FIFO empty flag
158+
self->uart_reg->int_clr.tx_done = 1;
159+
160+
isrmask = MICROPY_BEGIN_ATOMIC_SECTION();
157161
}
158162

159163
for (const char *top = str + len; str < top; str++) {
@@ -164,15 +168,17 @@ bool uart_tx_strn(mach_uart_obj_t *self, const char *str, uint len) {
164168
}
165169

166170
if (self->n_pins == 1) {
167-
pin_obj_t * pin = (pin_obj_t *)((mp_obj_t *)self->pins)[0];
168-
169171
// wait for the TX FIFO to be empty
170-
uart_wait_tx_done(self->uart_id, portMAX_DELAY);
172+
while (!self->uart_reg->int_raw.tx_done) {
173+
ets_delay_us(1);
174+
}
171175

172176
// make it an input again
173177
pin_deassign(pin);
174178
pin->af_in = mach_uart_pin_af[self->uart_id][1];
175-
pin_config(pin, pin->af_in, -1, GPIO_MODE_INPUT, MACHPIN_PULL_UP, 1);
179+
gpio_matrix_in(pin->pin_number, pin->af_in, false);
180+
MICROPY_END_ATOMIC_SECTION(isrmask);
181+
self->uart_reg->int_clr.tx_done = 1;
176182
}
177183

178184
return ret;
@@ -485,6 +491,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(mach_uart_any_obj, mach_uart_any);
485491

486492
STATIC mp_obj_t mach_uart_sendbreak(mp_obj_t self_in, mp_obj_t bits) {
487493
mach_uart_obj_t *self = self_in;
494+
pin_obj_t * pin = (pin_obj_t *)((mp_obj_t *)self->pins)[0];
488495

489496
uint32_t isrmask = MICROPY_BEGIN_ATOMIC_SECTION();
490497

@@ -493,7 +500,6 @@ STATIC mp_obj_t mach_uart_sendbreak(mp_obj_t self_in, mp_obj_t bits) {
493500
uint32_t delay = (((mp_obj_get_int(bits) + 1) * 1000000) / self->config.baud_rate) & 0x7FFF;
494501

495502
if (self->n_pins == 1) {
496-
pin_obj_t * pin = (pin_obj_t *)((mp_obj_t *)self->pins)[0];
497503
// make it UART Tx
498504
pin->value = 1;
499505
pin_deassign(pin);
@@ -507,7 +513,6 @@ STATIC mp_obj_t mach_uart_sendbreak(mp_obj_t self_in, mp_obj_t bits) {
507513
WRITE_PERI_REG(UART_CONF0_REG(self->uart_id), READ_PERI_REG(UART_CONF0_REG(self->uart_id)) & (~UART_TXD_INV));
508514

509515
if (self->n_pins == 1) {
510-
pin_obj_t * pin = (pin_obj_t *)((mp_obj_t *)self->pins)[0];
511516
// make it an input again
512517
pin_deassign(pin);
513518
pin->af_in = mach_uart_pin_af[self->uart_id][1];

esp32/pycom_version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#ifndef VERSION_H_
1111
#define VERSION_H_
1212

13-
#define SW_VERSION_NUMBER "1.10.1.b1"
13+
#define SW_VERSION_NUMBER "1.10.2.b1"
1414

1515
#define LORAWAN_VERSION_NUMBER "1.0.0"
1616

0 commit comments

Comments
 (0)
0