Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation on no_std. #49

Merged
merged 1 commit into from
Jul 25, 2023
Merged

Fix compilation on no_std. #49

merged 1 commit into from
Jul 25, 2023

Conversation

reitermarkus
Copy link
Collaborator

#42 broke compilation without any features, since Vec isn't available for the into_packet_vec function.

@timbod7
Copy link

timbod7 commented Nov 24, 2022

I'm struggling to get this to work on a cortex-m system. I've got this in cargo.toml:

ublox = { version = "0.4.2", features = []}

[patch.crates-io]
ublox = { git = 'https://github.com/reitermarkus/ublox', branch='no-std'}

but I get pages and pages of errors, that start off like this:

~/gps-tracker/firmware$ cargo build --release
   Compiling ublox v0.4.2 (https://github.com/reitermarkus/ublox?branch=no-std#c1a02fb3)
error[E0463]: can't find crate for `std`
  |
  = note: the `thumbv7em-none-eabihf` target may not support the standard library
  = note: `std` is required by `ublox` because it does not declare `#![no_std]`

error: cannot find attribute `derive` in this scope
 --> /home/timd/.cargo/git/checkouts/ublox-a2964f230499e503/c1a02fb/ublox/src/error.rs:3:3
  |
3 | #[derive(Debug)]
  |   ^^^^^^
  |
  = note: consider importing this attribute macro:
          core::prelude::rust_2021::derive

error: cannot find macro `write` in this scope
  --> /home/timd/.cargo/git/checkouts/ublox-a2964f230499e503/c1a02fb/ublox/src/error.rs:13:42
   |
13 |             MemWriterError::Custom(e) => write!(f, "MemWriterError: {}", e),
   |                                          ^^^^^
   |
   = note: consider importing this macro:
           core::write

error: cannot find attribute `derive` in this scope
  --> /home/timd/.cargo/git/checkouts/ublox-a2964f230499e503/c1a02fb/ublox/src/error.rs:22:3
   |
22 | #[derive(Debug, PartialEq, Eq)]
   |   ^^^^^^
   |
   = note: consider importing this attribute macro:
           core::prelude::rust_2021::derive

error: cannot find macro `write` in this scope
  --> /home/timd/.cargo/git/checkouts/ublox-a2964f230499e503/c1a02fb/ublox/src/error.rs:46:61
   |
46 |             ParserError::InvalidChecksum { expect, got } => write!(
   |                                                             ^^^^^
   |
   = note: consider importing this macro:
           core::write
...

Any pointers as to what I'm doing wrong?

@reitermarkus
Copy link
Collaborator Author

reitermarkus commented Nov 24, 2022

@timbod7, you need

ublox = { version = "0.4.2", default-features = false }

@timbod7
Copy link

timbod7 commented Nov 24, 2022

Excellent - thanks so much.

andrei-ng added a commit to andrei-ng/ublox-rs that referenced this pull request May 31, 2023
andrei-ng added a commit to andrei-ng/ublox-rs that referenced this pull request May 31, 2023
@reitermarkus
Copy link
Collaborator Author

@lkolbly, can this be merged and could you please respond in #52 if you get a chance?

@lkolbly lkolbly merged commit f6cbd4c into ublox-rs:master Jul 25, 2023
aholtzma pushed a commit to appliedmind/ublox that referenced this pull request Nov 16, 2023
parser: move test into "mod tests"

CI: make sure that we test with all features "on"

fix parsing of MonVer packet plus regressioni test for that

Fix compilation on `no_std`.

Merge pull request ublox-rs#49 from reitermarkus/no-std

Fix compilation on `no_std`.
Merge branch 'master' into fix-mon-ver-parsing
Merge pull request ublox-rs#47 from Dushistov/fix-mon-ver-parsing

Fix mon ver parsing
Fix enum casing. (ublox-rs#50)

Update minimum required version to 1.65 (ublox-rs#58)

* Update minimum required version to 1.65

---------

Signed-off-by: Guillaume W. Bres <guillaume.bressaix@gmail.com>
add support for UBX-SEC-UNIQID (ublox-rs#48)

Co-authored-by: gwbres <guillaume.bressaix@gmail.com>
introduce cargo fmt and execute it a first time (ublox-rs#59)

Signed-off-by: Guillaume W. Bres <guillaume.bressaix@gmail.com>
Introduce clippy fixes, auto derive default (ublox-rs#60)

* apply clippy fixes, derive Default enum
* Clippy on CI level
* Swap to match statements
* Derive eq
bump rustc and dependencies to newer versions (ublox-rs#61)

* bumps dependencies for ublox library

- bumps all dependencies to more recent versions
- lints Cargo.toml files
- updates ublox_cli example to work with new `clap` and `serialport` APIs
- tested ublox_cli example on M8L device
- update CI and README with rustc version
- fix urls in badges

Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com>

* move cli example to examples

- exclude the examples from the top level workspace
- allow to build examples independently and with newer MVRC
- update CI to build examples separately

Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com>

* fix clippy & fmt errors

Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com>

---------

Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com>
add ci workflow badge to the readme (ublox-rs#62)

Signed-off-by: Guillaume W. Bres <guillaume.bressaix@gmail.com>
add hnr messages (ublox-rs#63)

* rename UBX-NAV-PVT message as per uBlox protocol description

Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com>

* refactor: add more NAV-PVT mapping functions

Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com>

* add HNR-ATT and HNR-INS messages

Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com>

---------

Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com>
use uniform `itow` naming across packets (ublox-rs#64)

Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com>
release v0.4.3 (ublox-rs#65)

Signed-off-by: Guillaume W. Bres <guillaume.bressaix@gmail.com>
clippy changes (ublox-rs#67)

Improve support for embedded targets (ublox-rs#69)

* ci: test building on embedded targets
* Set resolver=2 in the workspace
* ci: test with feature serde but no alloc
* derive: Manually impl Serialize for PacketSerializer
to avoid the serde feature requiring alloc
bump ublox_derive to v0.1.0 (ublox-rs#70)

* bump ublox_derive to v0.1.0
* ublox: use local referencing (latest)
---------

Signed-off-by: Guillaume W. Bres <guillaume.bressaix@gmail.com>
extend basic_cli example with more cmd line arguments (ublox-rs#71)

* refactor: workflow file

Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com>

* refactor: small update in doc & README

Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com>

* expand ublox-cli example with more cli-args

Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com>

---------

Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com>
Add NAV-SIG and CFG-GNSS messages.

Merge remote-tracking branch 'upstream/master' into nav-sig

Fix PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants