daniestevez / galileo-osnma

Galileo OSNMA (Open Service Navigation Message Authentication)
Apache License 2.0
54 stars 9 forks source link

Update error? #23

Closed N6RFM closed 9 months ago

N6RFM commented 9 months ago

Hi Dani,

While attempting to update to the latest version, my practice has been to perform cargo clean, then cargo build --release, in the following folders - /galileo-osnma /galileo-osnma/galmon-osnma /galileo-osnma/osnma-longan-nano /galileo-osnma/osnma-longan-nano-client

all goes well except in the /galileo-osnma/osnma-longan-nano folder where I get an error near the end of the build.

Compiling riscv-rt-macros v0.2.1 error: instruction requires the following: 'M' (Integer Multiplication and Division) or 'Zmmul' (Integer Multiplication) mul t0, t2, t0 ^ error: instruction requires the following: 'M' (Integer Multiplication and Division) or 'Zmmul' (Integer Multiplication) mul t0, t2, t0 ^ error: instruction requires the following: 'M' (Integer Multiplication and Division) or 'Zmmul' (Integer Multiplication) mul t0, t2, t0 ^ Finished release [optimized] target(s) in 13.01s

Despite this, I am able to build the firmware using the command from with the /galileo-osnma/osnma-longan-nano folder

~/riscv-binutils-gdb/binutils/objcopy -O binary target/riscv32imac-unknown-none-elf/release/osnma-longan-nano firmware.bin

Any suggestions as to why this may be happening?

Thanks, Bob

daniestevez commented 9 months ago

I'm also getting that error, even in CI. It seems that it is a problem with riscv-rt, a dependency. The problem seems harmless though. The firmware image builds and works just fine. I will try to replicate this problem in a minimal case and report upstream.

N6RFM commented 9 months ago

Thanks Dani. In the meantime, I'll flash the update.

N6RFM commented 9 months ago

Hi Dani, Realized that I had to update the public key. Done.

There is also a file in the /galileo-osnma/osnma-longan-nano folder called merkle_tree_root.txt. Is this where the new string copied from the Merkl_tree XML file is to be placed or should the entire line 40256... be placed somewhere else?

I am now seeing a different error when doing a cargo clean then cargo build from the /galileo-osnma/osnma-longan-nano folder. This occurs near the end of the build process. Is Rust looking for a file that's missing perhaps? Thanks. Bob

Compiling log v0.4.20 error: failed to run custom build command for osnma-longan-nano v0.1.0 (/home/bob/galileo-osnma/osnma-longan-nano)

Caused by: process didn't exit successfully: /home/bob/galileo-osnma/osnma-longan-nano/target/release/build/osnma-longan-nano-701dfc9cb301faee/build-script-build (exit status: 101) --- stdout cargo:rustc-link-search=/home/bob/galileo-osnma/osnma-longan-nano/target/riscv32imac-unknown-none-elf/release/build/osnma-longan-nano-ff52b1e4d79b3421/out cargo:rerun-if-changed=memory-cb.x

--- stderr thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', build.rs:53:74 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... bob@bob:~/galileo-osnma/osnma-longan-nano$

daniestevez commented 9 months ago

There is also a file in the /galileo-osnma/osnma-longan-nano folder called merkle_tree_root.txt. Is this where the new string copied from the Merkl_tree XML file is to be placed or should the entire line 40256... be placed somewhere else?

You should only put the hexadecimal number in merkle_tree_root.txt. Today I added a Python script that extracts the required hexadecimal number from the XML file. So this is now the easiest way to obtain the appropriate data for merkle_tree_root.txt. You run the script as extract_merkle_tree_root.py InputFile.xml > merkle_tree_root.txt . When I have merged this branch and added some error handling to the script I'll update the main README to describe this method.

thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', build.rs:53:74

That is this line. It seems that pubkey.pem or pubkey_id.txt is missing. Both files are in the repository but have dummy values (their contents must be replaced with the real cryptographic data). Maybe you've removed one of these files accidentally?

N6RFM commented 9 months ago

Thank you Dani! Now working. :-)

daniestevez commented 9 months ago

Closing, since this is working now.