fix the allocator example
This commit is contained in:
@@ -15,7 +15,6 @@ cortex-m-semihosting = "0.2.0"
|
|||||||
# Uncomment for the allocator example.
|
# Uncomment for the allocator example.
|
||||||
#alloc-cortex-m = "0.3.2"
|
#alloc-cortex-m = "0.3.2"
|
||||||
|
|
||||||
|
|
||||||
[dependencies.cortex-m-rt]
|
[dependencies.cortex-m-rt]
|
||||||
version = "0.3.12"
|
version = "0.3.12"
|
||||||
# Comment for the panic example.
|
# Comment for the panic example.
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ extern "C" {
|
|||||||
fn main() {
|
fn main() {
|
||||||
// Initialize the allocator
|
// Initialize the allocator
|
||||||
let start = unsafe { &mut _sheap as *mut u32 as usize };
|
let start = unsafe { &mut _sheap as *mut u32 as usize };
|
||||||
let end = unsafe { &mut _sheap as *mut u32 as usize };
|
let end = unsafe { &mut _eheap as *mut u32 as usize };
|
||||||
unsafe { ALLOCATOR.init(start, end - start) }
|
unsafe { ALLOCATOR.init(start, end - start) }
|
||||||
|
|
||||||
// Growable array allocated on the heap
|
// Growable array allocated on the heap
|
||||||
|
|||||||
3
memory.x
3
memory.x
@@ -18,3 +18,6 @@ MEMORY
|
|||||||
/* This is required only on microcontrollers that store some configuration right
|
/* This is required only on microcontrollers that store some configuration right
|
||||||
after the vector table */
|
after the vector table */
|
||||||
/* _stext = ORIGIN(FLASH) + 0x400; */
|
/* _stext = ORIGIN(FLASH) + 0x400; */
|
||||||
|
|
||||||
|
/* Size of the heap (in bytes) */
|
||||||
|
/* _heap_size = 1024; */
|
||||||
|
|||||||
Reference in New Issue
Block a user