-
Notifications
You must be signed in to change notification settings - Fork 63
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
Options for running on M2 MacOS #139
Comments
We do not officially support running it on Mac, but I have previously run the Exploration Tool on 2 different Macs. Unfortunately, I do not have exact instructions on what to do but as long as you do not use XC120, it should be fairly straight forward to resolve issues you might face. Best regards, |
Hey @vackraetraed, thanks for the quick response, that's awesome. I did experience that issue you mentioned with I think the special escape character may not have made it into your correction, but escaping the I'll try the other things you mentioned and once I've got it working I'll share what I did so other Mac users can enjoy the tool as well :) |
Could you actually expand a little on this? I'm planning to use the XE125 EVK which I believe should be A121, so I should be safe there I hope. On the docs setting up your EVK section, both XC120 and XC121 are grouped together though so just curious. |
Hello @saillingaway Yes sorry, I seem to have missed the"\" in my correction. Running the command "python3 -m pip install --upgrade acconeer-exptool\[app]" as you did should be the correct command. (I noticed now why, I actually had to escape the \ character here with another \ haha) Yes, please let us know if you get it running and if you face any issues which were not solved by my previous suggestions. XE125 uses serial COM port over the USB, I got that working fairly easily with no changes to Python code. Only the additional installation steps. So I would suggest sticking to XE125 since it should work without major complications. |
@vackraetraed Coming back with a question, not sure if you can help. The linux setup involves these three pieces:
Changing permissions on the device file that represents the serial port so that the relevant user can read/write seems straightforward, but I'm less sure how to handle the second and third things here. As far as I've been able to tell there isn't something like udev rules for MacOS. Do you remember how you handled this? |
Hello @saillingaway I did not really do any of those. As for the rest with the udev rules, it is only for XC120 (USB) and XM112 (SPI), but I do not think you will be using either of those hardwares so you should be able to skip that. I have not got XC120 to work myself. |
@vackraetraed I see now that leaving out the dev related steps make sense since they're for the XC120 and XM112 like you said, should have caught that. Just want to double check something. The VCOM drivers I have installed are the silicon labs drivers for Mac, which I believe should work for the USB-UART COM ports on the XE-125. Those are compatible, correct? I'm able to start the Exploration tool up with
This seems like an indication that pyusb can't find a library on my system to interface with USB devices. However, I have libusb version 1.0.27 installed (installed with homebrew), but it could be a permissions problem? |
Also just want to confirm, were either of the machines that you got the exploration tool working on silicon macs? |
Fixed the no backend available error from above, I was on the right track. libusb doesn't know to look where Homebrew puts libusb files on install:
I opted for the second and it solved that problem, however now when I try to connect in the tool, it throws this error:
I found issue #132 where the recv timeout was solved by changing one line in serial_link.py, but I can't locate where the acconeer files on my machine actually are, so I can't change them. Here's a picture of the selections I had if it helps: I also tried to grab the most recent binary to flash and see if it would work but that also threw an error:
I'm pretty sure it was in DFU mode, I followed the instructions that popped up. If you have any ideas on what to try please let me know. |
I found where this file was and tried their fix, unfortunately didn't work for me. |
Hello @saillingaway You have pretty much covered the steps I took to run it now. Have you flashed an Exploration Server binary on XM125 before? The issue you are trying to reference seem connected to users trying to use the Exploration Server/Tool without flow control (i.e. not using CTS/RTS pins, since they did not use the Evaluation kit and did not connect these pins, all of our modules use flow control to achieve higher baudrates) |
Just to clarify, there is no pre-flashed binary on XM125, so if you have not managed to flash the Exploration Server binary on the XM125, we have to solve that before we can do anything else. |
You can try downloading the Exploration Server binary for XM125 from our developer site then run the command: Before running this command, you can hold down the DFU button while connecting the USB. This will trigger the bootloader, but not use the RESET button (in case for some reason the RESET button is broken). |
@vackraetraed Thanks for the reply.
I haven't flashed anything on XM125, this is the first time I'm working with anything from Acconeer in general. I did try both connection types but threw the same double recv timeout error. The options I saw were UART and UART3, although sometimes it's UART and UART4 (pictured in the previous reply). Just confirming, when you say there's no pre-flashed binary that means the hardware didn't come flashed with anything? I'll try downloading the binary, connecting it with the just the DFU button held down and see what happens with that command. Also I want to rule out this problem being a permissions issue. Could the |
I tried downloading the binary and then running the command (ACCONEER XM125 EXPLORATION SERVER A121 from this page) but unfortunately it seems like there's some trouble detecting the device. I tried adding what I think was the port, but it didn't make a difference, same error: |
I'd like to bring the exploration tool up as well on an M1 Mac. I'll post my progress, where I am stuck, and see if it helps. I'm considering a switch to this IC/platform for a current product, but will need help. HW:
SW: SMTCubeProgrammer: UART, cu.usbserial-10, 1115200, E81 off RTS/DTR Low Basic functionality success: Results: I am able to get distance measurements read out via I2C(SDA,SCL) and an external host controller (ESP8266) Notes: It seems I have all I need to commuincate with the device (show by successful connection and flash) Exploration tool attempt
Note: FW on deivce is still i2c_distance_detector.bin
In the app:
Result: same rcv timeout error as seen by saillingaway edited: acconeer-python-exploration/src/acconeer/exptool/_core/communication/links/serial_link.py line 102 Result: no change; same rcv timeout error as seen by saillingaway I'm able to confirm DFU mode by
So, not much more progress than sailingaway, just the "ability to connect" and DFU confirmation. I'll keep trying from here. One thing to confirm: The device should connect from the exptool independent of what FW is loaded? Small update: |
Hi @vackraetraed , As I dig in to debug this, I have some pretty basic questions to ask / items to confirm to make sure I'm not missing something fundamental. If you have a moment for some short answers here I would really appreciate your time.
Thanks so much in advance |
Oh my phone so apologies for any typos.
@mtntrx Can you go into some more detail on how flashed it? Still haven't had any luck.
By scope you mean a oscilloscope, right? |
I've actually been able to flash it two ways.
Yes, so far just one oscilloscope channel on the RX pin to make sure there was activity at the beginning of the hang. The goal was to confirm that python was able to access the driver->usb->UART stuff correctly. I think that's confirmed given the ability to flash and the scope observation. I'm not sure I'll doing any more 'scoping, as those pads are just so dang small, and my dev kit has no breakouts. |
Yes, I am not too surprised auto detection might fail on Mac. But if you select the correct port manually I would expect it too work. Perhaps you can try the STM32CubeProgrammer tool which @mtntrx was successful using. |
Hi @mtntrx
|
Hi y'all, Im working with @saillingaway to try to get this working on Apple Silicon, but coming in fresh. I'm good at finding hacks, but bad at solid solutions. I'm on Sonoma 14.3.1 on an M1 w/ a factory-fkdup HDMI issue |
@tyVandeZande welcome to the fun. I made it a big further then @saillingaway (standing/wobbling on their shoulders) but I'm still stuck. I have flashing working in 2 tools, so I know I have a working serial port via the /dev device. That said, the connection being used for communicating with the exploration firmware just times out. If you have any other ideas of things to try I'll try anything. I'm out of ideas at the moment. I busted out a windows machine and got instantly stuck there with something stupid on my end I'm sure. I just filed an issue for it -- will probably be embarrassed when I figure out what is wrong there. |
@mtntrx Hi, I was able to get it working last night. I had my list of steps, but it got deleted before I posted. Working again on it tonight. Can You please share what type of mac are you using it on? Macbook pro vs macbook air vs imac, etc? We're both on Macbook pro and for both of us, the port on the right never recognized the device. I'm guessing you've tried it with multipe ports, but just want to make sure. Can you please post a screenshot of the GUI on your computer? |
@saillingaway @mtntrx
|
One step I remember having to do to that was not great was using The timeout you're receiving is a symptom @saillingaway had when the firmware was not flashed. You've confirmed the switch on the board is set to
Component missing on hardware? (I will post a picture of my board) |
@mtntrx @vackraetraed wanted to give an update on progress @tyVandeZande and I made this morning. Here's exactly what we did (in order) and the results. Mostly recording all of this information so I can come back to refer to it later if need be, but someone else may find it helpful, who knows. We used a (kind of low quality) usbc-to-usb data cable and an Apple usb-to-usbc adapter to connect the eval kit to the computer. We also are only using the upper left usbc port on the machine next to the charging port because we've had inconsistencies/problems with connecting to/detecting other devices (mainly esp32s) on both of our machines using any other port, like @tyVandeZande mentioned. The kit was already flashed with the binary mentioned above using STM32CubeProgrammer, so thank you for telling us about that.
Machine: 2023 M2 Pro Macbook We think your issue could be the cable. When we picked it up the eval kit at one point the Exploration Tool threw an error that was something like Error: Failed to get next frame. |
Just want to +1 that the behavior in my case is identical to @mtntrx.
I'm on M2 + Sonoma using |
Hey folks, finally success for me. I'm going to say my MAC/M1 issue was some combo of driver and the USBtoUART chip (CH340C on the Spark Fun module) I was able to get the module to work successfully on a Windows machine, but not to full BAUD rate. (success upward of 460,800) and that seem to be good enough. So, it felt like a MAC driver issue. I did not try any other drivers for that CH340C. (maybe that would have been easier) Instead I took the harder road. with some tricky soldering I wired in a CP2102 USBtoUART chip. I was able to flash, but still failed to connect to the explorer tool. The difference in device names was telling (me: cu.usbserial-0001 @saillingaway: /dev/tty.SLAB_USABtoUART) So, I downloaded/installed the SiLab drivers and I'm up with
Software install steps:
Thanks all for the info. Knowing success was possible helped a lot. |
I'm glad things worked out for @mtntrx, but if I understand correctly, they switched the USB to serial chip from CH340C to CP2102 (from Silicon Labs). I don't intend to perform that hardware modification, so I don't think SiLab drivers are relevant for me. Perhaps I'm mistaken? |
@dthakur I think you are correct, a SiLabs driver won't help. maybe something discussed here: https://arduino.stackexchange.com/questions/85822/is-there-an-apple-silicon-m1-driver-for-ch34x-devices Before I just start installing new stuff, I'd like to get a read on what driver is currently in use and make sure I have a return path. |
Solved for me. Solution: Install 340C drivers from here. This pops up a new device, which works just fine. Thanks @mtntrx and @saillingaway. |
@dthakur oops, re-reading and yes I misunderstood what they wrote. Happy to hear you got it working! |
Hey there, I'd really like to use acconeer for a project but I'm on an M2 machine. From the readme it seems like there isn't out of the box support for any MacOS, silicon or not, and I'm not sure what the best way to get it up and running would be.
I'm assuming I could set up a virtual environment/machine with an acconeer-compatible linux/ubuntu os and just follow the install settings, but I don't know how the virtual environment will impact acconeer's performance or what other tradeoffs there may be. Is there a specific set up you recommend? Apologies if the answer is somewhere else already, I'm somewhat new to this kind of development and appreciate your patience and help.
Machine Specs
Chip: M2 Pro
MacOS: Ventura 13.4
Memory: 16 GB
The text was updated successfully, but these errors were encountered: