openshwprojects / OpenBK7231T_App

Open source firmware (Tasmota/Esphome replacement) for BK7231T, BK7231N, BL2028N, T34, XR809, W800/W801, W600/W601, BL602 and LN882H
https://openbekeniot.github.io/webapp/devicesList.html
1.47k stars 274 forks source link

Build on linux (arm-none-eabi-gcc) #647

Open evlo opened 1 year ago

evlo commented 1 year ago

How to build on linux? As tuya-cloudcutter supports primarily ubuntu 20 (22 does have issue with dns and needs modifying one file to run)

I'm following this https://github.com/openshwprojects/OpenBK7231T_App/wiki/Building guide

mkdir -p Debug/bin
build beken378/app/app_bk.o
echo prerequirement2
prerequirement2
/bin/sh: 1: ../toolchain/gcc-arm-none-eabi-4_9-2015q1/bin/arm-none-eabi-gcc: not found
make[2]: *** [[application.mk:1176](http://application.mk:1176/): beken378/app/app_bk.o] Error 127
make[2]: *** Waiting for unfinished jobs....

https://developer.arm.com/downloads/-/gnu-rm does not even have version 4.9

For anyone wanting to build on linux too, here is changes I did so far:

openshwprojects commented 1 year ago

Isn't it here? https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q1-update

valeklubomir commented 1 year ago

I am running building on Debian linux, works fine. Tools were downloaded with SDK for chipset. OpenBL7231N/T. And it was pretty straight forward. Example for BK7231N toolchain should be installed in 'platforms/bk7231N/toolchain/gcc-arm.......' Path is mentioned : /bin/sh: 1: ../toolchain/gcc-arm-none-eabi-4_9-2015q1/bin/arm-none-eabi-gcc: not found Download: wget https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q1-update/+download/gcc-arm-none-eabi-4_9-2015q1-20150306-linux.tar.bz2

Extracted contents of tar.bz2 to 'platforms/bk7231n/toolchain/'

And each time build failed I googled some solution until build was successful.

EDIT: In case of incompatible binaries I mostly try to build apps for linux from source tar.

Dheenhasty commented 1 year ago

Same here, i'll use a Xubuntu ... so debian based distro for compiling .... no issue.

evlo commented 1 year ago

I used ubuntu, issue.

openshwprojects commented 1 year ago

Path to toolchain is wrong? Please check it, directory by directory. Make sure you have linux toolchain.

Xinayder commented 1 year ago

I use Arch Linux and I could build it just fine. All I did was fetch the submodules with git submodule init --recursive, then I executed the same make task present in the GitHub Actions workflow file:

make APP_VERSION=${{ needs.refs.outputs.version }} APP_NAME=${{ matrix.platform }} ${{ matrix.platform }}

replacing the placeholder variables with the MCU I was compiling for (in this case BK7231N).

As far as I'm aware you don't need a custom version of gcc.

What system are you trying to compile on (distro, device)?