nrobinson2000 / po

The Future of po-util: Refactored, Modular, and Cross-Compatible
GNU General Public License v3.0
29 stars 5 forks source link

Issues with compiling for & flashing xenon on arch linux #14

Open tve opened 5 years ago

tve commented 5 years ago

(This is a summary of our discussion on gitter.im)

Issue 1

po xenon flash-beta fails for me on arch linux in the linker step:

tve@soumak /h/s/g/p/gps-test> po xenon flash-beta

          ______    ______
         /      \  /      \    Building firmware...
        /██████  |/██████  |
        ██ |  ██ |██ |  ██ |   Build Parameters:
        ██ |__██ |██ \__██ |     xenon
        ██    ██/ ██    ██/      gps-test
        ███████/   ██████/
        ██ |
        ██ |
        ██/  po xenon build gps-test

/home/tve/.po-util/bin/gcc-arm-embedded/gcc-arm-none-eabi-5_3-2016q1/bin/../lib/gcc/arm-none-eabi/5.3.1/../../../../arm-none-eabi/bin/ld: cannot open linker script file module_user_memory.ld: No such
file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [../../../build/module.mk:235: /home/src/goobies/particle/gps-test/target/gps-test.elf] Error 1
make[1]: *** [../build/recurse.mk:12: modules/xenon/user-part] Error 2
make: *** [/home/tve/.po-util/src/particle.mk:46: flash-user] Error 2

This can be most easily fixed by adding the all target to the make invocations in particle.mk https://github.com/nrobinson2000/po/blob/master/share/particle.mk#L44-L54:

# Compile and flash the user part
flash-user: preprocess
        cd "${DEVICE_OS_PATH}/main" && make all program-dfu

# Compile and flash the user and system parts
flash-all: preprocess
        cd "${DEVICE_OS_PATH}/modules" && make all program-dfu

# Compile and flash debug build
flash-debug:
        cd "${DEVICE_OS_PATH}/main" && make all program-dfu MODULAR=n USE_SWD_JTAG=y

Issue 2

po dfu fails to find my xenon because I have another /dev/ttyACM device. This can be improved by changing the default setting of MODEM in https://github.com/nrobinson2000/po/blob/master/share/po-linux#L432-L435 to

for modem in /dev/ttyACM* /dev/serial/by-id/usb-Particle*; do
    if [ -e "$modem" ]; then
        MODEM="$modem"
        MODEM_DUO="$modem"
    fi
done

Thanks for creating po-util!!!

nrobinson2000 commented 4 years ago

I've spent the last month creating neopo, a replacement for po-util written in Python. The issues you faced are now virtually nonexistent: the Particle makefile has been fixed, and neopo uses particle-cli to induce dfu mode with libudev.

Here is the repository: https://github.com/nrobinson2000/neopo


While I currently don't have the Arch dependencies in the installer script yet, I will have them in there soon.