Skip to content

Commit

Permalink
update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kiffie committed Jun 9, 2023
1 parent cfe49f2 commit fa8262f
Show file tree
Hide file tree
Showing 22 changed files with 462 additions and 545 deletions.
2 changes: 1 addition & 1 deletion examples/blinky/.cargo/config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

[target.mipsel-unknown-none]
rustflags = ["-C", "link-arg=-T32MX150F128B_procdefs.ld"]
rustflags = ["-C", "link-arg=-T32MX270F256B_procdefs.ld"]

[build]
target = "mipsel-unknown-none"
Expand Down
57 changes: 0 additions & 57 deletions examples/blinky/32MX150F128B_procdefs.ld

This file was deleted.

40 changes: 40 additions & 0 deletions examples/blinky/32MX270F256B_procdefs.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*************************************************************************
* Processor-specific object file for PIC32MX170 and PIC32MX270
*************************************************************************/

/*************************************************************************
* Symbols used for interrupt-vector table generation
*************************************************************************/
PROVIDE(_vector_spacing = 0x0001);
PROVIDE(_ebase_address = 0x9D000000); /* first 4 KiB of program flash */


MEMORY
{
boot_flash (rx) : ORIGIN = 0xBFC00000, LENGTH = 0xc00
program_flash (rx) : ORIGIN = 0x9D000000, LENGTH = 256k
sram (w!x) : ORIGIN = 0x80000000, LENGTH = 64k
configsfrs : ORIGIN = 0xBFC00BF0, LENGTH = 0x10
}

REGION_ALIAS("exception_mem", program_flash)
REGION_ALIAS("program_mem", program_flash)
REGION_ALIAS("data_mem", sram)

/* aliases for direct start without bootloader
* put the reset handler into the boot flash.
*/
REGION_ALIAS(reset_mem, boot_flash)

/* aliases for bootloader support
* put the bootloader into the boot flash section and the reset handler at the
* beginning of the normal program flash memory.
*/
/* REGION_ALIAS(reset_mem, program_flash)
REGION_ALIAS(bootloader_mem, boot_flash) */

/*************************************************************************
* common part for all PIC32 devices
*************************************************************************/
INPUT("device.x") /* interrupt vector symbols from Peripheral Access Crate */
INPUT("pic32_common.ld")
96 changes: 54 additions & 42 deletions examples/blinky/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions examples/blinky/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ edition = "2018"
pic32mx1xxfxxxb = ["pic32-hal/pic32mx1xxfxxxb"]
pic32mx2xxfxxxb = ["pic32-hal/pic32mx2xxfxxxb"]
rx = []
default = ["pic32mx1xxfxxxb"]
default = ["pic32mx2xxfxxxb"]

[dependencies]
mips-mcu = { version = "0.3.0", features = ["critical-section-single-core"] }
mips-rt = "0.3.0"
embedded-hal = "0.2.3"
pic32-hal = "0.6.1"
pic32-config-sector = "0.1.2"
embedded-hal = "0.2.7"
pic32-hal = "0.9.0"
pic32-config-sector = "0.2.0"
[profile.release]
opt-level = 2
lto = true
1 change: 1 addition & 0 deletions examples/blinky/build.sh