Skip to content

Commit 6fe4c4a

Browse files
authored
Merge branch 'master' into ArduinoOTA_watchdog_fix
2 parents d963a60 + 49b7664 commit 6fe4c4a

File tree

6 files changed

+137
-25
lines changed

6 files changed

+137
-25
lines changed

boards.txt

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2491,6 +2491,67 @@ m5stick-c.menu.DebugLevel.debug.build.code_debug=4
24912491
m5stick-c.menu.DebugLevel.verbose=Verbose
24922492
m5stick-c.menu.DebugLevel.verbose.build.code_debug=5
24932493

2494+
##############################################################
2495+
2496+
m5stack-atom.name=M5Stack-ATOM
2497+
2498+
m5stack-atom.upload.tool=esptool_py
2499+
m5stack-atom.upload.maximum_size=1310720
2500+
m5stack-atom.upload.maximum_data_size=327680
2501+
m5stack-atom.upload.wait_for_upload_port=true
2502+
2503+
m5stack-atom.serial.disableDTR=true
2504+
m5stack-atom.serial.disableRTS=true
2505+
2506+
m5stack-atom.build.mcu=esp32
2507+
m5stack-atom.build.core=esp32
2508+
m5stack-atom.build.variant=m5stack_atom
2509+
m5stack-atom.build.board=M5Stack_ATOM
2510+
2511+
m5stack-atom.build.f_cpu=240000000L
2512+
m5stack-atom.build.flash_size=4MB
2513+
m5stack-atom.build.flash_freq=80m
2514+
m5stack-atom.build.flash_mode=dio
2515+
m5stack-atom.build.boot=dio
2516+
m5stack-atom.build.partitions=default
2517+
m5stack-atom.build.defines=
2518+
2519+
m5stack-atom.menu.PartitionScheme.default=Default
2520+
m5stack-atom.menu.PartitionScheme.default.build.partitions=default
2521+
m5stack-atom.menu.PartitionScheme.no_ota=No OTA (Large APP)
2522+
m5stack-atom.menu.PartitionScheme.no_ota.build.partitions=no_ota
2523+
m5stack-atom.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
2524+
m5stack-atom.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA)
2525+
m5stack-atom.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
2526+
m5stack-atom.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080
2527+
2528+
2529+
m5stack-atom.menu.UploadSpeed.1500000=1500000
2530+
m5stack-atom.menu.UploadSpeed.1500000.upload.speed=1500000
2531+
m5stack-atom.menu.UploadSpeed.750000=750000
2532+
m5stack-atom.menu.UploadSpeed.750000.upload.speed=750000
2533+
m5stack-atom.menu.UploadSpeed.500000=500000
2534+
m5stack-atom.menu.UploadSpeed.500000.upload.speed=500000
2535+
m5stack-atom.menu.UploadSpeed.250000=250000
2536+
m5stack-atom.menu.UploadSpeed.250000.upload.speed=250000
2537+
m5stack-atom.menu.UploadSpeed.115200=115200
2538+
m5stack-atom.menu.UploadSpeed.115200.upload.speed=115200
2539+
2540+
2541+
2542+
m5stack-atom.menu.DebugLevel.none=None
2543+
m5stack-atom.menu.DebugLevel.none.build.code_debug=0
2544+
m5stack-atom.menu.DebugLevel.error=Error
2545+
m5stack-atom.menu.DebugLevel.error.build.code_debug=1
2546+
m5stack-atom.menu.DebugLevel.warn=Warn
2547+
m5stack-atom.menu.DebugLevel.warn.build.code_debug=2
2548+
m5stack-atom.menu.DebugLevel.info=Info
2549+
m5stack-atom.menu.DebugLevel.info.build.code_debug=3
2550+
m5stack-atom.menu.DebugLevel.debug=Debug
2551+
m5stack-atom.menu.DebugLevel.debug.build.code_debug=4
2552+
m5stack-atom.menu.DebugLevel.verbose=Verbose
2553+
m5stack-atom.menu.DebugLevel.verbose.build.code_debug=5
2554+
24942555

24952556
##############################################################
24962557

cores/esp32/esp32-hal-uart.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static void IRAM_ATTR _uart_isr(void *arg)
8585
uart->dev->int_clr.rxfifo_tout = 1;
8686
while(uart->dev->status.rxfifo_cnt || (uart->dev->mem_rx_status.wr_addr != uart->dev->mem_rx_status.rd_addr)) {
8787
c = uart->dev->fifo.rw_byte;
88-
if(uart->queue != NULL && !xQueueIsQueueFullFromISR(uart->queue)) {
88+
if(uart->queue != NULL) {
8989
xQueueSendFromISR(uart->queue, &c, &xHigherPriorityTaskWoken);
9090
}
9191
}
@@ -285,10 +285,18 @@ void uartRxFifoToQueue(uart_t* uart)
285285
{
286286
uint8_t c;
287287
UART_MUTEX_LOCK();
288-
while(uart->dev->status.rxfifo_cnt || (uart->dev->mem_rx_status.wr_addr != uart->dev->mem_rx_status.rd_addr)) {
289-
c = uart->dev->fifo.rw_byte;
290-
xQueueSend(uart->queue, &c, 0);
291-
}
288+
//disable interrupts
289+
uart->dev->int_ena.val = 0;
290+
uart->dev->int_clr.val = 0xffffffff;
291+
while (uart->dev->status.rxfifo_cnt || (uart->dev->mem_rx_status.wr_addr != uart->dev->mem_rx_status.rd_addr)) {
292+
c = uart->dev->fifo.rw_byte;
293+
xQueueSend(uart->queue, &c, 0);
294+
}
295+
//enable interrupts
296+
uart->dev->int_ena.rxfifo_full = 1;
297+
uart->dev->int_ena.frm_err = 1;
298+
uart->dev->int_ena.rxfifo_tout = 1;
299+
uart->dev->int_clr.val = 0xffffffff;
292300
UART_MUTEX_UNLOCK();
293301
}
294302

libraries/WiFi/examples/WiFiProv/README.md

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ This sketch implements provisioning using various IDF components
66

77
This example allows Arduino user to choose either BLE or SOFTAP as a mode of transport, over which the provisioning related communication is to take place, between the device (to be provisioned) and the client (owner of the device).
88

9-
## API's introduced for provisioning
9+
# APIs introduced for provisioning
1010

1111
## WiFi.onEvent()
1212

13-
Using this API user can register to recieve WIFI Events and Provisioning Events
13+
Using this API user can register to receive WiFi Events and Provisioning Events
1414

1515
#### Parameters passed
1616

@@ -22,11 +22,11 @@ A function with following signature
2222
* wifi_prov_cb_event_t event;
2323
* void * event_data;
2424

25-
### WiFi.beginProvision()
25+
## WiFi.beginProvision()
2626

2727
WiFi.beginProvision(scheme prov_scheme, wifi_prov_scheme_event_handler_t scheme_event_handler, wifi_prov_security_t security, char * pop, char * service_name, char * service_key, uint8_t * uuid);
2828

29-
#### Parameters
29+
#### Parameters passed
3030

3131
* prov_scheme : choose the mode of transfer
3232
* WIFI_PROV_SCHEME_BLE - Using BLE
@@ -46,11 +46,11 @@ WiFi.beginProvision(scheme prov_scheme, wifi_prov_scheme_event_handler_t scheme_
4646
* SoftAp :
4747
- WIFI_PROV_EVENT_HANDLER_NONE
4848

49-
* pop : It is the string that is used to provide the authentication while provisioning
49+
* pop : It is the string that is used to provide the authentication.
5050

51-
* service_name : Specify service name for the device while provisioning, if it is not specified then default chosen name via SoftAP is WIFI_XXX and for BLE service it is BLE_XXX where XXX is the last 3 bytes of the MAC address.
51+
* service_name : Specify service name for the device, if it is not specified then default chosen name via SoftAP is WIFI_XXX and via BLE is BLE_XXX where XXX are the last 3 bytes of the MAC address.
5252

53-
* service_key : Specify service key while provisioning, if chosen mode of provisioning is BLE then service_key is always NULL
53+
* service_key : Specify service key, if chosen mode of provisioning is BLE then service_key is always NULL
5454

5555
* uuid : user can specify there own 128 bit UUID while provisioning using BLE, if not specified then default value taken is
5656
- { 0xb4, 0xdf, 0x5a, 0x1c, 0x3f, 0x6b, 0xf4, 0xbf,
@@ -63,24 +63,15 @@ WiFi.beginProvision(scheme prov_scheme, wifi_prov_scheme_event_handler_t scheme_
6363
* scheme_event_handler = WIFI_PROV_EVENT_HANDLER_NONE
6464
* security = WIFI_PROV_SECURITY_1
6565
* pop = "abcd1234"
66-
* service_name = "WiFi_XXX"
66+
* service_name = "WiFi_XXX"
6767
* service_key = NULL
6868
* uuid = NULL
6969

7070
# Log Output
7171
* Enable debuger : [ Tools -> Core Debug Level -> Info ]
7272

73-
# App required for provisioning
74-
75-
##Gihub link
76-
77-
* Android : (https://github.com/espressif/esp-idf-provisioning-android)
78-
* iOS : (https://github.com/espressif/esp-idf-provisioning-ios)
79-
80-
## These apps are available on playstore
81-
82-
* For SoftAP : ESP SoftAP Prov
83-
* For BLE : ESP BLE Prov
73+
# Provisioning Tools
74+
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/provisioning/wifi_provisioning.html#provisioning-tools
8475

8576
# Example output
8677

libraries/WiFi/src/WiFiProv.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,11 @@ void WiFiProvClass :: beginProvision(scheme prov_scheme, wifi_prov_event_handler
151151
WiFi.mode(WIFI_MODE_STA);
152152
log_i("Aleardy Provisioned, starting Wi-Fi STA");
153153
log_i("CONNECTING ACCESS POINT CREDENTIALS : ");
154-
log_i("SSID : %s\n",WiFi.SSID().c_str());
154+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
155+
wifi_config_t conf;
156+
esp_wifi_get_config(WIFI_IF_STA,&conf);
157+
log_i("SSID : %s\n",conf.sta.ssid);
158+
#endif
155159
}
156160
}
157161

tools/platformio-build.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@
184184
]
185185
)
186186

187+
if not env.BoardConfig().get("build.ldscript", ""):
188+
env.Replace(LDSCRIPT_PATH=env.BoardConfig().get("build.arduino.ldscript", ""))
189+
187190
#
188191
# Target: Build Core Library
189192
#

variants/m5stack_atom/pins_arduino.h

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#ifndef Pins_Arduino_h
2+
#define Pins_Arduino_h
3+
4+
#include <stdint.h>
5+
6+
#define EXTERNAL_NUM_INTERRUPTS 16
7+
#define NUM_DIGITAL_PINS 40
8+
#define NUM_ANALOG_INPUTS 16
9+
10+
#define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1)
11+
#define digitalPinToInterrupt(p) (((p)<40)?(p):-1)
12+
#define digitalPinHasPWM(p) (p < 34)
13+
14+
static const uint8_t TX = 1;
15+
static const uint8_t RX = 3;
16+
17+
static const uint8_t SDA = 26;
18+
static const uint8_t SCL = 32;
19+
20+
21+
static const uint8_t G12 = 12;
22+
static const uint8_t G19 = 19;
23+
static const uint8_t G22 = 21;
24+
static const uint8_t G22 = 22;
25+
static const uint8_t G23 = 23;
26+
static const uint8_t G25 = 25;
27+
static const uint8_t G26 = 26;
28+
static const uint8_t G27 = 27;
29+
static const uint8_t G32 = 32;
30+
static const uint8_t G33 = 33;
31+
static const uint8_t G39 = 39;
32+
33+
static const uint8_t G9 = 9;
34+
static const uint8_t G10 = 10;
35+
static const uint8_t G37 = 37;
36+
static const uint8_t G36 = 36;
37+
static const uint8_t G0 = 0;
38+
39+
static const uint8_t DAC1 = 25;
40+
static const uint8_t DAC2 = 26;
41+
42+
static const uint8_t ADC1 = 35;
43+
static const uint8_t ADC2 = 36;
44+
45+
#endif /* Pins_Arduino_h */

0 commit comments

Comments
 (0)