veecle / tricore-probe

Just like probe-run but targeting the Tricore-Architecture
Apache License 2.0
21 stars 7 forks source link

Make it work on MacOS - Apple Silicon #15

Open mc-cat-tty opened 7 months ago

arctic-alpaca commented 7 months ago

Hi @mc-cat-tty,

I cannot reproduce the issue. Could you provide some more information like your system configuration, error messages you are seeing, etc?

mc-cat-tty commented 7 months ago

Sure! I should also edit the title, since it is no longer self-explanatory.

The issue arose while building the Xwin container on M1 OS X. However, I later realized that the issue concerned the arm64 platform and didn't impact builds on Linux/x86_64 platforms - as you said, on the right platform, everything works fine.

I am now wondering if tricore-probe might work on MacOS/arm64. As of now, I have been able to build artifacts on Xwin and run flash-tricore container, building them with ... buildx --platform linux/amd64 ....

I am now tinkering with the build of tricore-probe. RUSTFLAGS="-C link-args=-L/opt/homebrew/Cellar/libusb-compat/0.1.8/lib -lusb" cargo build --no-default-features --features "docker" makes compilation exit successfully, but trying to run it leads to a crash:

./target/debug/tricore-probe ~/.../Blinky_LED_1_KIT_TC397_TFT/build/Blinky --no-flash --list-devices
[...]
thread '<unnamed>' panicked at tricore-docker/win-ftd2xx-dll/src/exports.rs:16:1:
Patched DLL function "_FT_CreateDeviceInfoList" aborted: Error processing response to command

Caused by:
    Io(Error { kind: UnexpectedEof, message: "failed to fill whole buffer" })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
wine: Unhandled page fault on read access to FFFFFFFFFFFFFFFF at address 0000000140030F85 (thread 00e8), starting debugger...

If you have any suggestion, let me know.

daniel-veecle commented 7 months ago

As a fellow Mac user I feel your pain :)

I will investigate and let you know. What I fear is that certain dependencies (MEMTOOL, DAS or the compiler) will simply refuse to run on a Mac, docker or not (at least this is what I experienced ~1 year ago)...

I will let you know!

EDIT: By Mac I mean aarch64

mc-cat-tty commented 7 months ago

Thanks @daniel-veecle!

I will also keep you up to date with my work, if I make any progress.