diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..7ee8e8f --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,20 @@ +NOTE: The below DOES NOT apply to software in the `vendor/` directory. + +Copyright (c) 2019 David Goodlad + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..9bdca68 --- /dev/null +++ b/README.md @@ -0,0 +1,56 @@ +# rtl8710-sdk + +Work-in-progress Rust wrapper for the RTL8710 single-chip wifi module [standard +SDK](https://www.amebaiot.com/en/ameba-sdk-intro/). + +The SDK is `v4.0b`, slimmed down to only the parts required to compile. The +build is, for now, based on +`project/realtek_ameba1_va0_example/GCC-RELEASE/application.mk` from the SDK, +implemented as a call out to the `cc` crate in `build.rs`. + +## Prerequisites + +Requires rust nightly and a couple of `rustup` components: + +``` sh +# Install the nightly toolchain, required for some experimental features +rustup override set nightly + +# Install the rust target for the ARM Cortex-M3 microcontroller +rustup target add thumbv7m-none-eabi + +# Install some required components for the build +rustup component add llvm-tools-preview +rustup component add rust-src +rustup component add rustfmt +``` + +## Usage + +This is very much WIP, so not easy to describe. The gist looks like this: + +1. Make a new binary crate for your project +2. Add `rtl8710-sdk` as a dependency +3. Configure cargo to link properly in `.cargo/config`: + + [target.thumbv7m-none-eabi] + runner = 'gdb-multiarch' + rustflags = [ + "-C", "linker=arm-none-eabi-ld", + "-C", "link-arg=-Tlink.x", + "-C", "link-arg=-nostartfiles", + ] + + [build] + target = "thumbv7m-none-eabi" + +You'll need a linker script (`link.x`) derived from the +`rlx8195A-symbol-v02-img2.ld` script in the SDK. That's up to you for now. + +The resulting binary should be set to load via a debugger (e.g. `gdb` with +`openocd`). Nothing here prepares it to flash to the device, though! + +## License + +This work is license under the MIT license. The original SDK software included +in the `vendor` directory is provided under its respective license(s).