From 2699faea264a7d2f1ebd6fa1c73b636ba41b7e81 Mon Sep 17 00:00:00 2001 From: "Jonathan Pallant (42 Technology)" Date: Mon, 17 May 2021 14:35:33 +0100 Subject: [PATCH 1/5] Fixes to support NCS 1.5.1. libbsd is now lib_modem (aka nrf_modem). We also now stick to the hard-float ABI. --- .cargo/config.toml | 2 +- Cargo.toml | 3 ++- build.rs | 8 ++++---- third_party/nordic/nrfxlib | 2 +- wrapper.h | 13 +++++++------ 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 05c9063..601f8d6 100755 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -6,4 +6,4 @@ rustflags = [ ] [build] -target = "thumbv8m.main-none-eabi" # Cortex-M33 +target = "thumbv8m.main-none-eabihf" # Cortex-M33 Hard Float diff --git a/Cargo.toml b/Cargo.toml index d7598ea..48942fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nrfxlib-sys" -version = "1.4.2" +version = "1.5.1" authors = [ "Jonathan 'theJPster' Pallant ", "42 Technology Ltd ", @@ -10,6 +10,7 @@ description = "Rust bindings to the Nordic nRF9160 Socket Library." readme = "README.md" license-file = "LICENCE.md" repository = "https://github.com/thejpster/nrfxlib-sys" +resolver = "2" # The nrfxlib folder is quite large, so only include the pieces we need include = [ "src/**", diff --git a/build.rs b/build.rs index e4d7197..dfed089 100644 --- a/build.rs +++ b/build.rs @@ -81,15 +81,15 @@ fn main() { println!( "cargo:rustc-link-search={}", Path::new(&nrfxlib_path) - .join("bsdlib/lib/cortex-m33/soft-float") + .join("nrf_modem/lib/cortex-m33/hard-float") .display() ); println!( "cargo:rustc-link-search={}", Path::new(&nrfxlib_path) - .join("crypto/nrf_oberon/lib/cortex-m33/soft-float") + .join("crypto/nrf_oberon/lib/cortex-m33/hard-float") .display() ); - println!("cargo:rustc-link-lib=static=bsd_nrf9160_xxaa"); - println!("cargo:rustc-link-lib=static=oberon_3.0.7"); + println!("cargo:rustc-link-lib=static=modem"); + println!("cargo:rustc-link-lib=static=oberon_3.0.8"); } diff --git a/third_party/nordic/nrfxlib b/third_party/nordic/nrfxlib index 65562a9..3cff48e 160000 --- a/third_party/nordic/nrfxlib +++ b/third_party/nordic/nrfxlib @@ -1 +1 @@ -Subproject commit 65562a97094f74d578d1c76744b92571e7938d53 +Subproject commit 3cff48e890b037a0fe2964091702cb1c1bb59926 diff --git a/wrapper.h b/wrapper.h index ca3ad8e..4b95e32 100644 --- a/wrapper.h +++ b/wrapper.h @@ -5,12 +5,13 @@ /* * libbsd headers */ -#include "bsdlib/include/bsd.h" -#include "bsdlib/include/bsd_limits.h" -#include "bsdlib/include/bsd_os.h" -#include "bsdlib/include/bsd_platform.h" -#include "bsdlib/include/nrf_errno.h" -#include "bsdlib/include/nrf_socket.h" +#include "nrf_modem/include/nrf_modem.h" +#include "nrf_modem/include/nrf_modem_limits.h" +#include "nrf_modem/include/nrf_modem_full_dfu.h" +#include "nrf_modem/include/nrf_modem_os.h" +#include "nrf_modem/include/nrf_modem_platform.h" +#include "nrf_modem/include/nrf_errno.h" +#include "nrf_modem/include/nrf_socket.h" /* * Crypto Cell 310 (CC310) platform headers From 8f31062bdea40301bb2f324cc7655ed921fac90c Mon Sep 17 00:00:00 2001 From: Jonathan Pallant Date: Mon, 17 May 2021 18:53:52 +0100 Subject: [PATCH 2/5] Update Cargo.toml Pick HF libs. Note new repo location. --- Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 48942fd..64e9bc5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" description = "Rust bindings to the Nordic nRF9160 Socket Library." readme = "README.md" license-file = "LICENCE.md" -repository = "https://github.com/thejpster/nrfxlib-sys" +repository = "https://github.com/42-technology-ltd/nrfxlib-sys" resolver = "2" # The nrfxlib folder is quite large, so only include the pieces we need include = [ @@ -18,7 +18,7 @@ include = [ "build.rs", "wrapper.h", "*.md", - "third_party/nordic/nrfxlib/bsdlib/lib/cortex-m33/soft-float/**", + "third_party/nordic/nrfxlib/bsdlib/lib/cortex-m33/hard-float/**", "third_party/nordic/nrfxlib/bsdlib/include/**", "third_party/nordic/nrfxlib/bsdlib/license.txt", "third_party/nordic/nrfxlib/bsdlib/README.rst", @@ -26,7 +26,7 @@ include = [ "third_party/nordic/nrfxlib/crypto/nrf_cc310_platform/license.txt", "third_party/nordic/nrfxlib/crypto/nrf_cc310_mbedcrypto/include/**", "third_party/nordic/nrfxlib/crypto/nrf_cc310_mbedcrypto/license.txt", - "third_party/nordic/nrfxlib/crypto/nrf_oberon/lib/cortex-m33/soft-float/**", + "third_party/nordic/nrfxlib/crypto/nrf_oberon/lib/cortex-m33/hard-float/**", "third_party/nordic/nrfxlib/crypto/nrf_oberon/include/**", "third_party/nordic/nrfxlib/crypto/nrf_oberon/license.txt", ] From 875cdf01ea4c504b67767cfbbdd4acc53899cb78 Mon Sep 17 00:00:00 2001 From: Jonathan Pallant Date: Mon, 17 May 2021 18:55:17 +0100 Subject: [PATCH 3/5] libs are in nrf_modem now --- Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 64e9bc5..f7d77d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,10 +18,10 @@ include = [ "build.rs", "wrapper.h", "*.md", - "third_party/nordic/nrfxlib/bsdlib/lib/cortex-m33/hard-float/**", - "third_party/nordic/nrfxlib/bsdlib/include/**", - "third_party/nordic/nrfxlib/bsdlib/license.txt", - "third_party/nordic/nrfxlib/bsdlib/README.rst", + "third_party/nordic/nrfxlib/nrf_modem/lib/cortex-m33/hard-float/**", + "third_party/nordic/nrfxlib/nrf_modem/include/**", + "third_party/nordic/nrfxlib/nrf_modem/license.txt", + "third_party/nordic/nrfxlib/nrf_modem/README.rst", "third_party/nordic/nrfxlib/crypto/nrf_cc310_platform/include/**", "third_party/nordic/nrfxlib/crypto/nrf_cc310_platform/license.txt", "third_party/nordic/nrfxlib/crypto/nrf_cc310_mbedcrypto/include/**", From f6669e888a3e91996bf0f6ca047516bb8d8327ae Mon Sep 17 00:00:00 2001 From: "Jonathan Pallant (42 Technology)" Date: Tue, 18 May 2021 09:58:01 +0100 Subject: [PATCH 4/5] Release as RC1 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index f7d77d8..4179121 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nrfxlib-sys" -version = "1.5.1" +version = "1.5.1-rc1" authors = [ "Jonathan 'theJPster' Pallant ", "42 Technology Ltd ", From f2e353f7478c0a2b9c23664c249db861786d1843 Mon Sep 17 00:00:00 2001 From: "Jonathan Pallant (42 Technology)" Date: Wed, 19 May 2021 17:13:39 +0100 Subject: [PATCH 5/5] Update to 1.5.1 final --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 4179121..f7d77d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nrfxlib-sys" -version = "1.5.1-rc1" +version = "1.5.1" authors = [ "Jonathan 'theJPster' Pallant ", "42 Technology Ltd ",