Closed LoupVaillant closed 1 year ago
Hi,
Sorry for the slow answer, for some reason we missed the issue..
Anyhow, I copied your exact code and pasted over the blue.c
in tkey-libs/example-app
. Just hit make
, after I had build tkey-libs for tag v0.0.2. I used tkey-runapp
and my TKey goes green and blue. So it is nothing wrong with your C-code. I tried both with clang 15 and 16, both works fine.
You can find my flags to the compiler in the tkey-libs/example-app/Makefile
.
I see that you attach an .elf
file, the Tkey requires a raw binary. So I ran llvm-objcopy --input-target=elf32-liitleriscv --output-target=binary led.elf led.bin
to create bin-file from your attached elf-file and loaded it to my TKey with tkey-runapp
. It works, got a green and blue LED.
What happens if you convert it to a binary and load it? You can also try with tkey-runapp.
Damn. For some reason I missed the call to llvm-objcopy. I just ran it as you said, and got a working blinking led (green/blue), thanks!
Glad it helped!
So by now I have done everything I could, I'm pretty sure the error is not mine: I have a reliable way to find the TKey talk to its firmware so it gives me its name & version, I can load a device application and it answers with the hash of that application. I computed the same hash (using the reference BLAKE2s implementation from the RFC) locally, they compare equal, so I know the TKey sees what I see. I'm also pretty sure I'm hashing and sending the correct data (that is, the entire file): the hash is stable and Valgrind doesn't complain.
And yet, my TKeys goes blinking red instead of going christmas tree. Here's the device program I'm trying to load:
Here's the command I used to compile it:
My system and clang version:
Also, please find attached my compiled device application (compressed tgz because GitHub).
Can you find anything I did wrong?