Merge pull request #157 from 42-technology-ltd/add-cargo-config-helptext

Add some help text to cargo/config
This commit is contained in:
9names 2021-10-07 09:59:29 +11:00 committed by GitHub
commit 02cb4b8b06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,13 +1,42 @@
#
# Cargo Configuration for the https://github.com/rp-rs/rp-hal.git repository.
#
# Copyright (c) The RP-RS Developers, 2021
#
# You might want to make a similar file in your own repository if you are
# writing programs for Raspberry Silicon microcontrollers.
#
# This file is MIT or Apache-2.0 as per the repository README.md file
#
[build] [build]
# Instruction set of Cortex-M0+ # Set the default target to match the Cortex-M0+ in the RP2040
target = "thumbv6m-none-eabi" target = "thumbv6m-none-eabi"
[target.'cfg(all(target_arch = "arm", target_os = "none"))'] # Target specific options
[target.thumbv6m-none-eabi]
# Pass some extra options to rustc, some of which get passed on to the linker.
#
# * linker argument --nmagic turns off page alignment of sections (which saves
# flash space)
# * linker argument -Tlink.x tells the linker to use link.x as the linker
# script. This is usually provided by the cortex-m-rt crate, and by default
# the version in that crate will include a file called `memory.x` which
# describes the particular memory layout for your specific chip.
# * inline-threshold=5 makes the compiler more aggressive and inlining functions
# * no-vectorize-loops turns off the loop vectorizer (seeing as the M0+ doesn't
# have SIMD)
rustflags = [ rustflags = [
"-C", "link-arg=--nmagic", "-C", "link-arg=--nmagic",
"-C", "link-arg=-Tlink.x", "-C", "link-arg=-Tlink.x",
"-C", "inline-threshold=5", "-C", "inline-threshold=5",
"-C", "no-vectorize-loops", "-C", "no-vectorize-loops",
] ]
# This runner will make a UF2 file and then copy it to a mounted RP2040 in USB
# Bootloader mode:
runner = "elf2uf2-rs -d" runner = "elf2uf2-rs -d"
# This runner will find a supported SWD debug probe and flash your RP2040 over
# SWD:
# runner = "probe-run-rp --chip RP2040" # runner = "probe-run-rp --chip RP2040"