Skip to content

Commit 7d8edef

Browse files
atxpfalcon
authored andcommitted
esp8266: Update to SDK version 1.1.0 (MIT-licensed).
1. Updated linker script, now user app appears to contain exception vector table and oesn't work (faults) without it. 2. Commened out support for GPIO pulldown, which was removed in this SDK version without clear explanation, but apparently because it was released without proper validation, and now turns out it doesn't work as expected, or there's a different function there.
1 parent 78ccb44 commit 7d8edef

2 files changed

Lines changed: 37 additions & 2 deletions

File tree

esp8266/esp8266.ld

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ PHDRS
2121
}
2222

2323
ENTRY(call_user_start)
24+
EXTERN(_DebugExceptionVector)
25+
EXTERN(_DoubleExceptionVector)
26+
EXTERN(_KernelExceptionVector)
27+
EXTERN(_NMIExceptionVector)
28+
EXTERN(_UserExceptionVector)
2429

2530
PROVIDE(_memmap_vecbase_reset = 0x40000000);
2631

@@ -101,6 +106,30 @@ SECTIONS
101106
{
102107
_stext = .;
103108
_text_start = ABSOLUTE(.);
109+
*(.UserEnter.text)
110+
. = ALIGN(16);
111+
*(.DebugExceptionVector.text)
112+
. = ALIGN(16);
113+
*(.NMIExceptionVector.text)
114+
. = ALIGN(16);
115+
*(.KernelExceptionVector.text)
116+
LONG(0)
117+
LONG(0)
118+
LONG(0)
119+
LONG(0)
120+
. = ALIGN(16);
121+
*(.UserExceptionVector.text)
122+
LONG(0)
123+
LONG(0)
124+
LONG(0)
125+
LONG(0)
126+
. = ALIGN(16);
127+
*(.DoubleExceptionVector.text)
128+
LONG(0)
129+
LONG(0)
130+
LONG(0)
131+
LONG(0)
132+
. = ALIGN (16);
104133
*(.entry.text)
105134
*(.init.literal)
106135
*(.init)

esp8266/modpybpin.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
#define GPIO_MODE_OUTPUT (1)
4141
#define GPIO_PULL_NONE (0)
4242
#define GPIO_PULL_UP (1)
43-
#define GPIO_PULL_DOWN (2)
43+
// Removed in SDK 1.1.0
44+
//#define GPIO_PULL_DOWN (2)
4445

4546
typedef struct _pyb_pin_obj_t {
4647
mp_obj_base_t base;
@@ -91,15 +92,20 @@ STATIC mp_obj_t pyb_pin_obj_init_helper(pyb_pin_obj_t *self, mp_uint_t n_args, c
9192

9293
// configure the GPIO as requested
9394
PIN_FUNC_SELECT(self->periph, self->func);
95+
#if 0
96+
// Removed in SDK 1.1.0
9497
if ((pull & GPIO_PULL_DOWN) == 0) {
9598
PIN_PULLDWN_DIS(self->periph);
9699
}
100+
#endif
97101
if ((pull & GPIO_PULL_UP) == 0) {
98102
PIN_PULLUP_DIS(self->periph);
99103
}
104+
#if 0
100105
if ((pull & GPIO_PULL_DOWN) != 0) {
101106
PIN_PULLDWN_EN(self->periph);
102107
}
108+
#endif
103109
if ((pull & GPIO_PULL_UP) != 0) {
104110
PIN_PULLUP_EN(self->periph);
105111
}
@@ -191,7 +197,7 @@ STATIC const mp_map_elem_t pyb_pin_locals_dict_table[] = {
191197
{ MP_OBJ_NEW_QSTR(MP_QSTR_OUT_PP), MP_OBJ_NEW_SMALL_INT(GPIO_MODE_OUTPUT) },
192198
{ MP_OBJ_NEW_QSTR(MP_QSTR_PULL_NONE), MP_OBJ_NEW_SMALL_INT(GPIO_PULL_NONE) },
193199
{ MP_OBJ_NEW_QSTR(MP_QSTR_PULL_UP), MP_OBJ_NEW_SMALL_INT(GPIO_PULL_UP) },
194-
{ MP_OBJ_NEW_QSTR(MP_QSTR_PULL_DOWN), MP_OBJ_NEW_SMALL_INT(GPIO_PULL_DOWN) },
200+
//{ MP_OBJ_NEW_QSTR(MP_QSTR_PULL_DOWN), MP_OBJ_NEW_SMALL_INT(GPIO_PULL_DOWN) },
195201
};
196202

197203
STATIC MP_DEFINE_CONST_DICT(pyb_pin_locals_dict, pyb_pin_locals_dict_table);

0 commit comments

Comments
 (0)