Skip to content

Commit 1ad6deb

Browse files
author
Jonathan Pallant (42 Technology)
committed
Merge branch 'release/v0.6.0' into main
2 parents f3aa3e2 + c2bfcd1 commit 1ad6deb

File tree

12 files changed

+394
-101
lines changed

12 files changed

+394
-101
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ jobs:
1111
strategy:
1212
matrix:
1313
target:
14-
- thumbv8m.main-none-eabi
14+
- thumbv8m.main-none-eabihf
1515
steps:
1616
- uses: actions/checkout@v1
1717
- uses: actions-rs/toolchain@v1
1818
with:
19-
toolchain: nightly
19+
toolchain: stable
2020
target: ${{ matrix.target }}
2121
override: true
2222
- uses: actions-rs/cargo@v1

Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "nrfxlib"
3-
version = "0.5.0"
3+
version = "0.6.0"
44
authors = ["Jonathan Pallant (42 Technology) <[email protected]>"]
55
edition = "2018"
66
license = "MIT OR Apache-2.0"
@@ -12,6 +12,7 @@ resolver = "2"
1212
[dependencies]
1313
nrf9160-pac = "0.2.1"
1414
cortex-m = "0.6"
15-
heapless = "0.5"
15+
heapless = "0.7"
16+
linked_list_allocator = { version="0.9.0", default-features=false, features=["use_spin"] }
1617
log = "0.4"
17-
nrfxlib-sys = "1.4.2"
18+
nrfxlib-sys = "=1.5.1"

README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@ baseband, and a GNSS socket so you can read GPS data.
2323

2424
## Getting the static library
2525

26-
We use a crate called `nrfxlib-sys` to link to the library. This crate
27-
includes Nordic's header files and static library as a git sub-module (from
28-
their [Github page](https://github.com/NordicPlayground/nrfxlib)) and runs
29-
[`bindgen`] to generate Rust 'headers' which correspond to the functions and
30-
constants in the relevant header files. You will need bindgen and LLVM to
31-
be installed for [`bindgen`] to work, so please do see their
32-
[documentation](https://github.com/rust-lang/rust-bindgen).
26+
We use a crate called `nrfxlib-sys` to link to the library. This crate includes
27+
Nordic's header files and static library as a git sub-module (from their [Github
28+
page](https://github.com/NordicPlayground/nrfxlib)) and runs [`bindgen`] to
29+
generate Rust 'headers' which correspond to the functions and constants in the
30+
relevant header files. You no longer need to install `bindgen` - it gets pulled
31+
in as a crate - but you do need to use Rust 1.51 or higher.
3332

3433
[`bindgen`]: https://crates.io/crates/bindgen
3534

@@ -74,9 +73,19 @@ See [nrf9160-demo](https://github.com/42-technology-ltd/nrf9160-demo) for a demo
7473

7574
## Changelog
7675

77-
### Unreleased Changes ([Source](https://github.com/42-technology-ltd/nrfxlib/tree/master) | [Changes](https://github.com/42-technology-ltd/nrfxlib/compare/v0.5.0...master))
76+
### Unreleased Changes ([Source](https://github.com/42-technology-ltd/nrfxlib/tree/develop) | [Changes](https://github.com/42-technology-ltd/nrfxlib/compare/v0.6.0...develop))
7877

79-
* Updated to nrfxlib version 1.4.2. This requires Rust v1.51 as we use the new resolver to allow bindgen as a build-dep.
78+
* None
79+
80+
### v0.6.0 ([Source](https://github.com/42-technology-ltd/nrfxlib/tree/v0.6.0) | [Changes](https://github.com/42-technology-ltd/nrfxlib/compare/v0.5.0...v0.6.0))
81+
82+
* Updated to nrfxlib-sys v1.5.1.
83+
* Requires Rust v1.51 as we use the new resolver to allow bindgen as a build-dep
84+
* Rename FFI exports from `bsd_X` to `nrf_modem_X`
85+
* Implement IPC functionality
86+
* Implement library and transmit heaps
87+
* Supply hard-float libraries by default. The nRF9160 has an FPU so we might as well use the VFP registers.
88+
* Update to latest heapless - no more `heapless::consts::Uxx`
8089

8190
### v0.5.0 ([Source](https://github.com/42-technology-ltd/nrfxlib/tree/v0.5.0) | [Changes](https://github.com/42-technology-ltd/nrfxlib/compare/v0.4.0...v0.5.0))
8291

src/api.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,22 @@ use nrfxlib_sys as sys;
5151
/// You must call this when an EGU1 interrupt occurs.
5252
pub fn application_irq_handler() {
5353
unsafe {
54-
sys::bsd_os_application_irq_handler();
54+
sys::nrf_modem_os_application_irq_handler();
5555
}
5656
}
5757

5858
/// Trampoline into the BSD library function `bsd_os_trace_irq_handler`. You
5959
/// must call this when an EGU2 interrupt occurs.
6060
pub fn trace_irq_handler() {
6161
unsafe {
62-
sys::bsd_os_trace_irq_handler();
62+
sys::nrf_modem_os_trace_irq_handler();
6363
}
6464
}
6565

66-
/// Trampoline into the BSD library function `IPC_IRQHandler`. You must call
67-
/// this when an IPC interrupt occurs.
66+
/// IPC code now lives outside `lib_modem`, so call our IPC handler function.
6867
pub fn ipc_irq_handler() {
6968
unsafe {
70-
crate::ffi::IPC_IRQHandler();
69+
crate::ffi::ipc_irq_handler();
7170
}
7271
}
7372

src/dtls.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ impl DtlsSocket {
121121

122122
let mut result;
123123
// Now, make a null-terminated hostname
124-
let mut hostname_smallstring: heapless::String<heapless::consts::U64> =
125-
heapless::String::new();
124+
let mut hostname_smallstring: heapless::String<64> = heapless::String::new();
126125
write!(hostname_smallstring, "{}\0", hostname).map_err(|_| Error::HostnameTooLong)?;
127126
// Now call getaddrinfo with some hints
128127
let hints = sys::nrf_addrinfo {
@@ -161,7 +160,7 @@ impl DtlsSocket {
161160
sin_len: core::mem::size_of::<sys::nrf_sockaddr_in>() as u8,
162161
sin_family: sys::NRF_AF_INET as i32,
163162
sin_port: htons(port),
164-
sin_addr: dns_addr.sin_addr.clone(),
163+
sin_addr: dns_addr.sin_addr,
165164
};
166165

167166
debug!("Trying IP address {}", &crate::NrfSockAddrIn(connect_addr));

0 commit comments

Comments
 (0)