ExpressLRS / ExpressLRS-Configurator

Cross platform configuration & build tool for the ExpressLRS radio link
GNU General Public License v3.0
571 stars 121 forks source link

ST-Link flashing fails on macOS Catalina #8

Closed ae5au closed 3 years ago

ae5au commented 3 years ago

Build & flash for an ST-Link target on macOS...build is successful, but flashing fails even though Configurator reports a "Success!" at the end. Here's the end of the log:

Building in release mode
STM ENV: 'GHOST_ATTO_2400_RX_VIA_STLINK'
Checking size .pio/build/GHOST_ATTO_2400_RX_via_STLINK/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [==        ]  22.4% (used 3668 bytes from 16384 bytes)
Flash: [=====     ]  50.2% (used 32900 bytes from 65536 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, custom, jlink, mbed, stlink
CURRENT: upload_protocol = custom
Uploading .pio/build/GHOST_ATTO_2400_RX_via_STLINK/firmware.bin
Unknown operating system...

========================= [SUCCESS] Took 5.48 seconds =========================

Environment                    Status    Duration
-----------------------------  --------  ------------
GHOST_ATTO_2400_RX_via_STLINK  SUCCESS   00:00:05.476
========================= 1 succeeded in 00:00:05.476 =========================

Same failure happens even if the ST-Link/V2 is disconnected from the computer. The build works fine as I was able to manually flash the bootloader and compiled .bin to the Atto and it works. I also testing building/flashing the Jumper R900 Mini via ST-Link and had the same results.

ae5au commented 3 years ago

I'm running Catalina (10.15.7) and was running configurator v0.3.4. Downloading 0.3.5 now to test. Edit: Same issue on 0.3.5

brandonrc commented 3 years ago

This issue is not related to the configurator but it has something to do with build tools ELRS is using.

ae5au commented 3 years ago

My apologies for opening this issue in the wrong place. I've not setup the toolchain to build manually with PlatformIO yet. Is that already known to not work on macOS?

jurgelenas commented 3 years ago

My apologies for opening this issue in the wrong place. I've not setup the toolchain to build manually with PlatformIO yet. Is that already known to not work on macOS?

Umm I think this is ExpressLRS issue, see: https://github.com/ExpressLRS/ExpressLRS/blob/2637e4d59c5a1472b6cd9c08d9d23b0164f78800/src/python/runpython.py#L24

jurgelenas commented 3 years ago

My apologies for opening this issue in the wrong place. I've not setup the toolchain to build manually with PlatformIO yet. Is that already known to not work on macOS?

What branch / tag / release / firmware target you are trying to flash? runpython.py is removed and not used anymore, I can only find it in the past commits.

brandonrc commented 3 years ago

@ae5au not a big deal, I can look into it more if it still does not work.

brandonrc commented 3 years ago

@ae5au think we found a fix, going to make an update and let you know.

ae5au commented 3 years ago

What branch / tag / release / firmware target you are trying to flash? runpython.py is removed and not used anymore, I can only find it in the past commits.

@jurgelenas I was trying RC2 and then went back to RC1 for Atto/STLink. Also tried at least one of the RCs for R900 Mini. (I don't have that hardware, was just testing to see if it resulted in "Success!" and the same errors even with the ST-Link disconnected.

brandonrc commented 3 years ago

Hey, Are you pretty good with using git and code? @ae5au

Can you checkout my branch?

git clone https://github.com/brandonrc/expresslrs.git
git checkout pr-remove-python-os-check

then try and upload with stlink. This will not work but it will at least give you more information that I can use to debug this problem.

brandonrc commented 3 years ago

Meanwhile, an easy solution would be to run Linux or windows in a VM :)

But it would be nice to see what the issue is and how we can address it for everyone.

ae5au commented 3 years ago

then try and upload with stlink. This will not work but it will at least give you more information that I can use to debug this problem.

OK, got PlatformIO setup and now instead of "Unknown operating system..." when trying to flash, I get "Operating system: darwin is not supported." Here's the same snip from the end as before:

Building in release mode
STM ENV: 'GHOST_ATTO_2400_RX_VIA_STLINK'
Checking size .pio/build/GHOST_ATTO_2400_RX_via_STLINK/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [==        ]  22.4% (used 3668 bytes from 16384 bytes)
Flash: [=====     ]  50.2% (used 32892 bytes from 65536 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, custom, jlink, mbed, stlink
CURRENT: upload_protocol = custom
Uploading .pio/build/GHOST_ATTO_2400_RX_via_STLINK/firmware.bin
Operating system: darwin is not supported.

============================================================= [SUCCESS] Took 5.56 seconds =============================================================

Environment                    Status    Duration
-----------------------------  --------  ------------
GHOST_ATTO_2400_RX_via_STLINK  SUCCESS   00:00:05.564
============================================================= 1 succeeded in 00:00:05.564 =============================================================
ae5au commented 3 years ago

Meanwhile, an easy solution would be to run Linux or windows in a VM :)

I have plenty of other machines and VMs just primarily use Mac in the shop. I flashed last night manually with st-flash after compiling with configurator. This isn't holding me up from getting started with the hardware.