Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
83eec618
Commit
83eec618
authored
Dec 02, 2016
by
Yury Popov
Committed by
Marcel Stör
Dec 01, 2016
Browse files
Fix iram/irom section contents (#1566)
parent
00b356be
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/driver/pwm.c
View file @
83eec618
...
...
@@ -180,7 +180,7 @@ pwm_start(void)
// yeah, if all channels' duty is 0 or 255, don't need to start timer, otherwise start...
if
(
*
local_channel
!=
1
)
{
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
;
}
pwm_timer_down
=
0
;
...
...
app/include/sections.h
View file @
83eec618
#ifndef _SECTIONS_H_
#define _SECTIONS_H_
#define TEXT_SECTION_ATTR __attribute__((section(".text")))
#define RAM_CONST_SECTION_ATTR __attribute((section(".data")))
#define TEXT_SECTION_ATTR __attribute__((section(".
iram0.
text")))
#define RAM_CONST_SECTION_ATTR __attribute((section(".
ro
data
.dram
")))
#endif
app/modules/perf.c
View file @
83eec618
...
...
@@ -93,7 +93,7 @@ static int perf_start(lua_State *L)
data
=
d
;
// 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
data
=
NULL
;
lua_unref
(
L
,
d
->
ref
);
...
...
ld/nodemcu.ld
View file @
83eec618
...
...
@@ -5,7 +5,7 @@ MEMORY
dport0_0_seg : org = 0x3FF00000, len = 0x10
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
iram1_0_seg : org = 0x40100000, len = 0x8000
irom0_0_seg : org = 0x40210000, len = 0x
8
0000
irom0_0_seg : org = 0x40210000, len = 0x
D
0000
}
PHDRS
...
...
@@ -71,33 +71,50 @@ SECTIONS
_dport0_data_end = ABSOLUTE(.);
} >dport0_0_seg :dport0_0_phdr
.irom0
.text : ALIGN(
0x1000
)
.text : ALIGN(
4
)
{
_irom0_text_start = ABSOLUTE(.);
*(.servercert.flash)
*(.clientcert.flash)
*(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.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 */
_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)
*sdk/esp_iot_sdk_*lib/lib*.a:*(.literal .text)
/* SDK doesn't use libc functions, and are therefore safe to put in flash */
*/libc.a:*.o(.text* .literal*)
/* end libc functions */
*(.iram.text .iram0.text)
_irom0_text_end = ABSOLUTE(.);
_flash_used_end = ABSOLUTE(.);
} >irom0_0_seg :irom0_0_phdr =0xffffffff
*(.stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
*(.fini.literal)
*(.fini)
*(.gnu.version)
_text_end = ABSOLUTE(.);
_etext = .;
} >iram1_0_seg :iram1_0_phdr
.data : ALIGN(4)
{
...
...
@@ -119,6 +136,9 @@ SECTIONS
.rodata : ALIGN(4)
{
_rodata_start = ABSOLUTE(.);
*(.rodata.dram .rodata.dram*)
*(.gnu.linkonce.r.*)
__XT_EXCEPTION_TABLE__ = ABSOLUTE(.);
*(.xt_except_table)
...
...
@@ -175,46 +195,6 @@ SECTIONS
} >dram0_0_seg :dram0_0_bss_phdr
/* __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_start = ABSOLUTE(.);
...
...
@@ -224,6 +204,34 @@ SECTIONS
_lit4_end = ABSOLUTE(.);
} >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 */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment