Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
76a6335b
Commit
76a6335b
authored
11 years ago
by
mux
Browse files
Options
Downloads
Patches
Plain Diff
Move HEAP_END and RAM_END to linker script
* Issue #232
parent
217814cc
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
stm/gccollect.c
+3
-3
3 additions, 3 deletions
stm/gccollect.c
stm/gccollect.h
+2
-3
2 additions, 3 deletions
stm/gccollect.h
stm/main.c
+1
-1
1 addition, 1 deletion
stm/main.c
stm/stm32f405.ld
+3
-0
3 additions, 0 deletions
stm/stm32f405.ld
with
9 additions
and
7 deletions
stm/gccollect.c
+
3
−
3
View file @
76a6335b
...
@@ -13,10 +13,10 @@ void gc_helper_get_regs_and_clean_stack(machine_uint_t *regs, machine_uint_t hea
...
@@ -13,10 +13,10 @@ void gc_helper_get_regs_and_clean_stack(machine_uint_t *regs, machine_uint_t hea
void
gc_collect
(
void
)
{
void
gc_collect
(
void
)
{
uint32_t
start
=
sys_tick_counter
;
uint32_t
start
=
sys_tick_counter
;
gc_collect_start
();
gc_collect_start
();
gc_collect_root
((
void
**
)
&
_ram_start
,
(
(
uint32_t
)
&
_heap_start
-
(
uint32_t
)
&
_ram_start
)
/
4
);
gc_collect_root
((
void
**
)
&
_ram_start
,
(
&
_heap_start
-
&
_ram_start
)
/
4
);
machine_uint_t
regs
[
10
];
machine_uint_t
regs
[
10
];
gc_helper_get_regs_and_clean_stack
(
regs
,
HEAP_END
);
gc_helper_get_regs_and_clean_stack
(
regs
,
(
machine_uint_t
)
&
_heap_end
);
gc_collect_root
((
void
**
)
HEAP_END
,
(
RAM_END
-
HEAP_END
)
/
4
);
// will trace regs since they now live in this function on the stack
gc_collect_root
((
void
**
)
&
_heap_end
,
(
&
_ram_end
-
&
_heap_end
)
/
4
);
// will trace regs since they now live in this function on the stack
gc_collect_end
();
gc_collect_end
();
uint32_t
ticks
=
sys_tick_counter
-
start
;
// TODO implement a function that does this properly
uint32_t
ticks
=
sys_tick_counter
-
start
;
// TODO implement a function that does this properly
...
...
This diff is collapsed.
Click to expand it.
stm/gccollect.h
+
2
−
3
View file @
76a6335b
#define HEAP_END (0x2001c000) // tunable
#define RAM_END (0x20020000) // fixed for chip
extern
uint32_t
_ram_start
;
extern
uint32_t
_ram_start
;
extern
uint32_t
_heap_start
;
extern
uint32_t
_heap_start
;
extern
uint32_t
_ram_end
;
extern
uint32_t
_heap_end
;
void
gc_collect
(
void
);
void
gc_collect
(
void
);
...
...
This diff is collapsed.
Click to expand it.
stm/main.c
+
1
−
1
View file @
76a6335b
...
@@ -594,7 +594,7 @@ int main(void) {
...
@@ -594,7 +594,7 @@ int main(void) {
soft_reset:
soft_reset:
// GC init
// GC init
gc_init
(
&
_heap_start
,
(
void
*
)
HEAP_END
);
gc_init
(
&
_heap_start
,
&
_heap_end
);
// Micro Python init
// Micro Python init
qstr_init
();
qstr_init
();
...
...
This diff is collapsed.
Click to expand it.
stm/stm32f405.ld
+
3
−
0
View file @
76a6335b
...
@@ -19,6 +19,9 @@ _minimum_heap_size = 16K;
...
@@ -19,6 +19,9 @@ _minimum_heap_size = 16K;
/* top end of the stack */
/* top end of the stack */
_estack = ORIGIN(RAM) + LENGTH(RAM);
_estack = ORIGIN(RAM) + LENGTH(RAM);
_ram_end = 0x20020000;
_heap_end = 0x2001c000;
/* define output sections */
/* define output sections */
SECTIONS
SECTIONS
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment