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

rp2040 example outdated #40

Open
DASPRiD opened this issue Sep 15, 2024 · 6 comments
Open

rp2040 example outdated #40

DASPRiD opened this issue Sep 15, 2024 · 6 comments

Comments

@DASPRiD
Copy link

DASPRiD commented Sep 15, 2024

I was trying to work from the rp2040 example, but it seems to be outdated. I tried to adjust it to make it work and adjusted the pins to my board layout, see my diff:

diff.txt

I have a fat32 formatted SD card in the reader (done via gparted). When trying to run the example, I get the following error:

❯ cargo run
    Finished `dev` profile [optimized + debuginfo] target(s) in 0.07s
     Running `probe-rs run --chip RP2040 target/thumbv6m-none-eabi/debug/embedded-fatfs-example`
      Erasing ✔ [00:00:00] [###########################################################################################################################] 88.00 KiB/88.00 KiB @ 93.02 KiB/s (eta 0s )
  Programming ✔ [00:00:01] [###########################################################################################################################] 88.00 KiB/88.00 KiB @ 46.90 KiB/s (eta 0s )    Finished in 2.856s
INFO  Hello World!
└─ embedded_fatfs_example::____embassy_main_task::{async_fn#0} @ src/main.rs:27  
DEBUG Found card with size: 7948206080bytes
└─ sdspi::{impl#1}::init::{async_fn#0}::{async_block#0} @ /home/dasprid/dev/embedded-fatfs/sdspi/src/fmt.rs:125 
INFO  Initialization complete!
└─ embedded_fatfs_example::____embassy_main_task::{async_fn#0} @ src/main.rs:72  
WARN  Unknown opcode fa in bootjmp boot sector field
└─ embedded_fatfs::boot_sector::{impl#1}::validate @ /home/dasprid/dev/embedded-fatfs/embedded-fatfs/src/fmt.rs:151 
ERROR invalid bytes_per_sector value in BPB: expected a power of two but got 36352
└─ embedded_fatfs::boot_sector::{impl#0}::validate_bytes_per_sector @ /home/dasprid/dev/embedded-fatfs/embedded-fatfs/src/fmt.rs:164 
ERROR panicked at src/main.rs:105:6:
Filesystem tests failed!: CorruptedFileSystem
└─ panic_probe::print_defmt::print @ /home/dasprid/.cargo/registry/src/index.crates.io-6f17d22bba15001f/panic-probe-0.3.2/src/lib.rs:104
@CBJamo
Copy link
Contributor

CBJamo commented Sep 15, 2024

Sorry about that, I forgot to update the example in #30, They'll be fixed soon.

@DASPRiD
Copy link
Author

DASPRiD commented Sep 15, 2024

Thanks. Looking at examples/rp2040/src/main.rs, it doesn't seem that you changed anything I didn't change in my diff. Is the error message I see not related to this then?

@CBJamo
Copy link
Contributor

CBJamo commented Sep 15, 2024

That is correct, that pr only fixes the compile errors in the examples.

The CorruptedFileSystem error you're seeing is probably unrelated. Can you try flashing the sd card with this known-good fat32 image?

@DASPRiD
Copy link
Author

DASPRiD commented Sep 15, 2024

I assume I can just dd that onto the /dev/sdX1 device?

@DASPRiD
Copy link
Author

DASPRiD commented Sep 15, 2024

Confirmed, that worked. Now the question is why it doesn't work when formatted via gparted…

@DASPRiD
Copy link
Author

DASPRiD commented Sep 15, 2024

Okay, figured it out, gonna open a new issue.

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

No branches or pull requests

2 participants