Daisy Seed Rev5 Rust Example

Hi @chaosprint!

I will try to run this code in the afternoon (Rust starter for Daisy Seed - #26 by chaosprint) and report back!

1 Like

I wrote a little example project. It has some abstractions for the Daisy Pod hardware built in, but don’t let them bother you.

Be careful to clone the example-sine-wave branch!

1 Like

Thanks for the work! The code looks super neat. I tried to compile it but still got no sound.

What I did

  • firstly, I need to remove the "sdmmc", "sdmmc-fatfs" features from libdaisy-rust and all the SD card related code in your template as it causes errors during compiling on my machine.

  • my rustc --version:

    rustc 1.66.0-nightly (a24a020e6 2022-10-18)
  • since I don’t have ST-LINK, I did

    cargo objcopy --release -- -O binary a.bin
  • then:

    dfu-util -a 0 -s 0x08000000 -D a.bin 
  • everything looks fine but just no sound.


ELF Header

  • from cargo readobj --bin daisy-blank -- --file-headers:

    Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
    Class:                             ELF32
    Data:                              2's complement, little endian
    Version:                           1 (current)
    OS/ABI:                            UNIX - System V
    ABI Version:                       0
    Type:                              EXEC (Executable file)
    Machine:                           ARM
    Version:                           0x1
    Entry point address:               0x8000299
    Start of program headers:          52 (bytes into file)
    Start of section headers:          1591664 (bytes into file)
    Flags:                             0x5000400
    Size of this header:               52 (bytes)
    Size of program headers:           32 (bytes)
    Number of program headers:         6
    Size of section headers:           40 (bytes)
    Number of section headers:         24
    Section header string table index: 22

Could you please tell me your Rust version and how you flash the board?

No need to thank! I would have set up such a repo in the future anyway. Your issue gave me the motivation to do it right now. (It’s from a bigger project I’m working on, from which I stripped everything but the skeleton that is the Daisy Pod hardware initialization.)

You mentioned before that the SD card driver caused you issues. Most interesting. Honestly, I have no explanation for it.

When I do cargo readobj --bin daisy-blank -- --file-headers, the output looks identical. The only difference is that the start of the section headers is slightly shifted, which should be of no concerns.

Start of section headers:          1677700 (bytes into file)

For the sake of completeness, my rust version. Also, I use an ST-Link with probe.rs over JTAG to flash the Seed. However, since you can successfully flash your device, I wouldn’t stress too much about not having a ST-Link.

$ rustc --version
rustc 1.64.0 (a55dd71d5 2022-09-19)

For me, everything looks like it should work in your case. I will try to pull out the Seed from the Pod and see if it is related to the Seed not being in there at all. If not, I really don’t have any explanation, other than that you might have an older revision…

Confirmed working with the Seed sitting naked on the table.

Yeah! I get it working now with the same Rust version as yours. But I guess it’s good to also look into why the updated Rust version causes an issue as it may become stable soon anyway.

1 Like

Nice, glad to hear! :slight_smile: