Fix iram/irom section contents (#1566)
This commit is contained in:
parent
00b356be84
commit
83eec61874
|
@ -180,7 +180,7 @@ pwm_start(void)
|
||||||
// yeah, if all channels' duty is 0 or 255, don't need to start timer, otherwise start...
|
// yeah, if all channels' duty is 0 or 255, don't need to start timer, otherwise start...
|
||||||
if (*local_channel != 1) {
|
if (*local_channel != 1) {
|
||||||
PWM_DBG("Need to setup timer\n");
|
PWM_DBG("Need to setup timer\n");
|
||||||
if (!platform_hw_timer_init(TIMER_OWNER, NMI_SOURCE, FALSE)) {
|
if (!platform_hw_timer_init(TIMER_OWNER, FRC1_SOURCE, FALSE)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
pwm_timer_down = 0;
|
pwm_timer_down = 0;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef _SECTIONS_H_
|
#ifndef _SECTIONS_H_
|
||||||
#define _SECTIONS_H_
|
#define _SECTIONS_H_
|
||||||
|
|
||||||
#define TEXT_SECTION_ATTR __attribute__((section(".text")))
|
#define TEXT_SECTION_ATTR __attribute__((section(".iram0.text")))
|
||||||
#define RAM_CONST_SECTION_ATTR __attribute((section(".data")))
|
#define RAM_CONST_SECTION_ATTR __attribute((section(".rodata.dram")))
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -93,7 +93,7 @@ static int perf_start(lua_State *L)
|
||||||
data = d;
|
data = d;
|
||||||
|
|
||||||
// Start the timer
|
// Start the timer
|
||||||
if (!platform_hw_timer_init(TIMER_OWNER, NMI_SOURCE, TRUE)) {
|
if (!platform_hw_timer_init(TIMER_OWNER, FRC1_SOURCE, TRUE)) {
|
||||||
// Failed to init the timer
|
// Failed to init the timer
|
||||||
data = NULL;
|
data = NULL;
|
||||||
lua_unref(L, d->ref);
|
lua_unref(L, d->ref);
|
||||||
|
|
136
ld/nodemcu.ld
136
ld/nodemcu.ld
|
@ -5,7 +5,7 @@ MEMORY
|
||||||
dport0_0_seg : org = 0x3FF00000, len = 0x10
|
dport0_0_seg : org = 0x3FF00000, len = 0x10
|
||||||
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
|
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
|
||||||
iram1_0_seg : org = 0x40100000, len = 0x8000
|
iram1_0_seg : org = 0x40100000, len = 0x8000
|
||||||
irom0_0_seg : org = 0x40210000, len = 0x80000
|
irom0_0_seg : org = 0x40210000, len = 0xD0000
|
||||||
}
|
}
|
||||||
|
|
||||||
PHDRS
|
PHDRS
|
||||||
|
@ -71,33 +71,50 @@ SECTIONS
|
||||||
_dport0_data_end = ABSOLUTE(.);
|
_dport0_data_end = ABSOLUTE(.);
|
||||||
} >dport0_0_seg :dport0_0_phdr
|
} >dport0_0_seg :dport0_0_phdr
|
||||||
|
|
||||||
.irom0.text : ALIGN(0x1000)
|
.text : ALIGN(4)
|
||||||
{
|
{
|
||||||
_irom0_text_start = ABSOLUTE(.);
|
_stext = .;
|
||||||
*(.servercert.flash)
|
_text_start = ABSOLUTE(.);
|
||||||
*(.clientcert.flash)
|
*(.UserEnter.text)
|
||||||
*(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)
|
. = ALIGN(16);
|
||||||
*(.literal.* .text.*)
|
*(.DebugExceptionVector.text)
|
||||||
*(.rodata*)
|
. = ALIGN(16);
|
||||||
*(.sdk.version)
|
*(.NMIExceptionVector.text)
|
||||||
|
. = ALIGN(16);
|
||||||
|
*(.KernelExceptionVector.text)
|
||||||
|
LONG(0)
|
||||||
|
LONG(0)
|
||||||
|
LONG(0)
|
||||||
|
LONG(0)
|
||||||
|
. = ALIGN(16);
|
||||||
|
*(.UserExceptionVector.text)
|
||||||
|
LONG(0)
|
||||||
|
LONG(0)
|
||||||
|
LONG(0)
|
||||||
|
LONG(0)
|
||||||
|
. = ALIGN(16);
|
||||||
|
*(.DoubleExceptionVector.text)
|
||||||
|
LONG(0)
|
||||||
|
LONG(0)
|
||||||
|
LONG(0)
|
||||||
|
LONG(0)
|
||||||
|
. = ALIGN (16);
|
||||||
|
*(.entry.text)
|
||||||
|
*(.init.literal)
|
||||||
|
*(.init)
|
||||||
|
|
||||||
/* Link-time arrays containing the defs for the included modules */
|
*sdk/esp_iot_sdk_*lib/lib*.a:*(.literal .text)
|
||||||
. = ALIGN(4);
|
|
||||||
lua_libs = ABSOLUTE(.);
|
|
||||||
/* Allow either empty define or defined-to-1 to include the module */
|
|
||||||
KEEP(*(.lua_libs))
|
|
||||||
LONG(0) LONG(0) /* Null-terminate the array */
|
|
||||||
lua_rotable = ABSOLUTE(.);
|
|
||||||
KEEP(*(.lua_rotable))
|
|
||||||
LONG(0) LONG(0) /* Null-terminate the array */
|
|
||||||
|
|
||||||
/* SDK doesn't use libc functions, and are therefore safe to put in flash */
|
*(.iram.text .iram0.text)
|
||||||
*/libc.a:*.o(.text* .literal*)
|
|
||||||
/* end libc functions */
|
|
||||||
|
|
||||||
_irom0_text_end = ABSOLUTE(.);
|
*(.stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
|
||||||
_flash_used_end = ABSOLUTE(.);
|
|
||||||
} >irom0_0_seg :irom0_0_phdr =0xffffffff
|
*(.fini.literal)
|
||||||
|
*(.fini)
|
||||||
|
*(.gnu.version)
|
||||||
|
_text_end = ABSOLUTE(.);
|
||||||
|
_etext = .;
|
||||||
|
} >iram1_0_seg :iram1_0_phdr
|
||||||
|
|
||||||
.data : ALIGN(4)
|
.data : ALIGN(4)
|
||||||
{
|
{
|
||||||
|
@ -119,6 +136,9 @@ SECTIONS
|
||||||
.rodata : ALIGN(4)
|
.rodata : ALIGN(4)
|
||||||
{
|
{
|
||||||
_rodata_start = ABSOLUTE(.);
|
_rodata_start = ABSOLUTE(.);
|
||||||
|
|
||||||
|
*(.rodata.dram .rodata.dram*)
|
||||||
|
|
||||||
*(.gnu.linkonce.r.*)
|
*(.gnu.linkonce.r.*)
|
||||||
__XT_EXCEPTION_TABLE__ = ABSOLUTE(.);
|
__XT_EXCEPTION_TABLE__ = ABSOLUTE(.);
|
||||||
*(.xt_except_table)
|
*(.xt_except_table)
|
||||||
|
@ -175,46 +195,6 @@ SECTIONS
|
||||||
} >dram0_0_seg :dram0_0_bss_phdr
|
} >dram0_0_seg :dram0_0_bss_phdr
|
||||||
/* __stack = 0x3ffc8000; */
|
/* __stack = 0x3ffc8000; */
|
||||||
|
|
||||||
.text : ALIGN(4)
|
|
||||||
{
|
|
||||||
_stext = .;
|
|
||||||
_text_start = ABSOLUTE(.);
|
|
||||||
*(.UserEnter.text)
|
|
||||||
. = ALIGN(16);
|
|
||||||
*(.DebugExceptionVector.text)
|
|
||||||
. = ALIGN(16);
|
|
||||||
*(.NMIExceptionVector.text)
|
|
||||||
. = ALIGN(16);
|
|
||||||
*(.KernelExceptionVector.text)
|
|
||||||
LONG(0)
|
|
||||||
LONG(0)
|
|
||||||
LONG(0)
|
|
||||||
LONG(0)
|
|
||||||
. = ALIGN(16);
|
|
||||||
*(.UserExceptionVector.text)
|
|
||||||
LONG(0)
|
|
||||||
LONG(0)
|
|
||||||
LONG(0)
|
|
||||||
LONG(0)
|
|
||||||
. = ALIGN(16);
|
|
||||||
*(.DoubleExceptionVector.text)
|
|
||||||
LONG(0)
|
|
||||||
LONG(0)
|
|
||||||
LONG(0)
|
|
||||||
LONG(0)
|
|
||||||
. = ALIGN (16);
|
|
||||||
*(.entry.text)
|
|
||||||
*(.init.literal)
|
|
||||||
*(.init)
|
|
||||||
*(.literal .text .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
|
|
||||||
*(.iram0.text)
|
|
||||||
*(.fini.literal)
|
|
||||||
*(.fini)
|
|
||||||
*(.gnu.version)
|
|
||||||
_text_end = ABSOLUTE(.);
|
|
||||||
_etext = .;
|
|
||||||
} >iram1_0_seg :iram1_0_phdr
|
|
||||||
|
|
||||||
.lit4 : ALIGN(4)
|
.lit4 : ALIGN(4)
|
||||||
{
|
{
|
||||||
_lit4_start = ABSOLUTE(.);
|
_lit4_start = ABSOLUTE(.);
|
||||||
|
@ -224,6 +204,34 @@ SECTIONS
|
||||||
_lit4_end = ABSOLUTE(.);
|
_lit4_end = ABSOLUTE(.);
|
||||||
} >iram1_0_seg :iram1_0_phdr
|
} >iram1_0_seg :iram1_0_phdr
|
||||||
|
|
||||||
|
.irom0.text : ALIGN(0x1000)
|
||||||
|
{
|
||||||
|
_irom0_text_start = ABSOLUTE(.);
|
||||||
|
*(.servercert.flash)
|
||||||
|
*(.clientcert.flash)
|
||||||
|
*(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)
|
||||||
|
*(.literal .text .literal.* .text.*)
|
||||||
|
*(.rodata*)
|
||||||
|
*(.sdk.version)
|
||||||
|
|
||||||
|
/* Link-time arrays containing the defs for the included modules */
|
||||||
|
. = ALIGN(4);
|
||||||
|
lua_libs = ABSOLUTE(.);
|
||||||
|
/* Allow either empty define or defined-to-1 to include the module */
|
||||||
|
KEEP(*(.lua_libs))
|
||||||
|
LONG(0) LONG(0) /* Null-terminate the array */
|
||||||
|
lua_rotable = ABSOLUTE(.);
|
||||||
|
KEEP(*(.lua_rotable))
|
||||||
|
LONG(0) LONG(0) /* Null-terminate the array */
|
||||||
|
|
||||||
|
/* SDK doesn't use libc functions, and are therefore safe to put in flash */
|
||||||
|
*/libc.a:*.o(.text* .literal*)
|
||||||
|
/* end libc functions */
|
||||||
|
|
||||||
|
_irom0_text_end = ABSOLUTE(.);
|
||||||
|
_flash_used_end = ABSOLUTE(.);
|
||||||
|
} >irom0_0_seg :irom0_0_phdr =0xffffffff
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get ROM code address */
|
/* get ROM code address */
|
||||||
|
|
Loading…
Reference in New Issue