-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from rust-embedded/rt-up
bring up to par with cortex-m-rt v0.6.x
- Loading branch information
Showing
12 changed files
with
942 additions
and
446 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
**/*.rs.bk | ||
.#* | ||
Cargo.lock | ||
target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.section .ResetTrampoline, "ax" | ||
.global ResetTrampoline | ||
.type ResetTrampoline,%function | ||
ResetTrampoline: | ||
mov #_stack_start,r1 | ||
br #Reset ; XXX "br Reset" should also work, but doesn't on G2553, | ||
; and I don't know why. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
set -euxo pipefail | ||
|
||
# cflags taken from cc 1.0.22 | ||
|
||
crate=msp430-rt | ||
|
||
# remove existing blobs because otherwise this will append object files to the old blobs | ||
rm -f bin/*.a | ||
|
||
msp430-elf-as -mcpu=msp430 asm.s -o bin/$crate.o | ||
ar crs bin/msp430-none-elf.a bin/$crate.o | ||
|
||
rm bin/$crate.o |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
INCLUDE memory.x | ||
|
||
/* Entry point */ | ||
ENTRY(Reset); | ||
EXTERN(__RESET_VECTOR); | ||
|
||
/* Create an undefined reference to the INTERRUPTS symbol. This is required to | ||
force the linker to *not* drop the INTERRUPTS symbol if it comes from an | ||
object file that's passed to the linker *before* this crate */ | ||
EXTERN(__INTERRUPTS); | ||
|
||
/* # Pre-initialization function */ | ||
/* If the user overrides this using the `pre_init!` macro or by creating a `__pre_init` function, | ||
then the function this points to will be called before the RAM is initialized. */ | ||
PROVIDE(PreInit = PreInit_); | ||
|
||
/* # Default interrupt handler */ | ||
EXTERN(DefaultHandler); /* If this line is not here, all unused interrupt | ||
handlers will be zeroed out instead of doing | ||
to the DefaultHandler! */ | ||
PROVIDE(DefaultHandler = DefaultHandler_); | ||
|
||
/* XXX Are there use cases for making this user overridable? */ | ||
_stack_start = ORIGIN(RAM) + LENGTH(RAM); | ||
|
||
SECTIONS | ||
{ | ||
.vector_table ORIGIN(VECTORS) : ALIGN(2) | ||
{ | ||
KEEP(*(.vector_table.interrupts)); | ||
KEEP(*(.__RESET_VECTOR)); | ||
} > VECTORS | ||
|
||
.text ORIGIN(ROM) : | ||
{ | ||
/* Put the reset handler and its trampoline at the beginning of the .text section */ | ||
KEEP(*(.ResetTrampoline)); | ||
KEEP(*(.Reset)); | ||
|
||
*(.text .text.*); | ||
} > ROM | ||
|
||
.rodata : ALIGN(2) | ||
{ | ||
*(.rodata .rodata.*); | ||
. = ALIGN(2); | ||
} > ROM | ||
|
||
.bss : ALIGN(2) | ||
{ | ||
_sbss = .; | ||
*(.bss .bss.*); | ||
. = ALIGN(2); | ||
_ebss = .; | ||
} > RAM | ||
|
||
.data : ALIGN(2) | ||
{ | ||
_sidata = LOADADDR(.data); | ||
_sdata = .; | ||
*(.data .data.*); | ||
. = ALIGN(2); | ||
_edata = .; | ||
} > RAM AT > ROM | ||
|
||
/* fake output .got section */ | ||
/* Dynamic relocations are unsupported. This section is only used to detect | ||
relocatable code in the input files and raise an error if relocatable code | ||
is found */ | ||
.got : | ||
{ | ||
_sgot = .; | ||
KEEP(*(.got .got.*)); | ||
_egot = .; | ||
} > RAM AT > ROM | ||
|
||
/* The heap starts right after the .bss + .data section ends */ | ||
_sheap = _edata; | ||
} | ||
|
||
/* Do not exceed this mark in the error messages below | */ | ||
ASSERT(ORIGIN(VECTORS) + LENGTH(VECTORS) == 0x10000, " | ||
ERROR(msp430-rt): The VECTORS memory region must end at address 0x10000. Check memory.x"); | ||
|
||
ASSERT(ADDR(.vector_table) + SIZEOF(.vector_table) == 0x10000, " | ||
ERROR(msp430-rt): .vector_table is shorter than expected. | ||
Possible solutions, from most likely to less likely: | ||
- Link to a svd2rust generated pac crate, if you are not | ||
- Fix _sinterrupts in memory.x; it doesn't match the number of interrupts provided by the | ||
pac crate | ||
- Disable the 'device' feature of msp430-rt to build a generic application; a dependency | ||
may be enabling it | ||
"); | ||
|
||
ASSERT(_sgot == _egot, " | ||
ERROR(msp430-rt): .got section detected in the input object files | ||
Dynamic relocations are not supported. If you are linking to C code compiled using | ||
the 'cc' crate then modify your build script to compile the C code _without_ | ||
the -fPIC flag. See the documentation of the `cc::Build.pic` method for details."); | ||
/* Do not exceed this mark in the error messages above | */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[package] | ||
name = "msp430-rt-macros" | ||
version = "0.2.0" | ||
authors = ["Jorge Aparicio <[email protected]>"] | ||
|
||
[lib] | ||
proc-macro = true | ||
|
||
[dependencies] | ||
quote = "0.6.10" | ||
proc-macro2 = "0.4.23" | ||
|
||
[dependencies.rand] | ||
default-features = false | ||
version = "0.6.0" | ||
|
||
[dependencies.syn] | ||
features = ["extra-traits", "full"] | ||
version = "0.15.20" | ||
|
||
[features] | ||
device = [] |
Oops, something went wrong.