digispark blink mips - openwrt

39 views
Skip to first unread message

Beto Sanchez

unread,
Oct 11, 2019, 6:37:48 PM10/11/19
to gobotio
Hi, tried to compile for a mips processor running OpenWRT TP-LINK TL-WDR3600

# GOOS=linux GOARCH=mips GOMIPS=softfloat go build -ldflags "-w" -a main.go

Report error


This line is "littleWire lw"

// Adaptor is the Gobot Adaptor for the Digispark
type Adaptor struct {
        name       string
        littleWire lw
        servo      bool
        pwm        bool
        i2c        bool
        connect    func(*Adaptor) (err error)
}

Ron Evans

unread,
Oct 16, 2019, 3:31:34 AM10/16/19
to gobotio
Hi, Beto

The Digispark is an ATTiny85 processor that Gobot can communicate with only when the correct firmware is installed on it.

Regarding MIPS support, at the moment that has not been implemented in Gobot. We would love to receive a PR that added it.

Hope that helps!

Beto Sanchez

unread,
Oct 18, 2019, 7:43:34 AM10/18/19
to gobotio
Thanks Ron for your answer

I'm trying to do a cross compilation

--------------------------------------

export STAGING_DIR="/home/build/git/openwrt/staging_dir"
export TINY="/home/build/git/openwrt/build_dir/target-mips_24kc_musl/openwrt-sdk-ar71xx-tiny_gcc-8.3.0_musl.Linux-x86_64/build_dir/target-mips_24kc_musl/linux-ar71xx_tiny/linux-4.14.148"

export CC="/home/build/git/openwrt/staging_dir/toolchain-mips_24kc_gcc-8.3.0_musl/bin/mips-openwrt-linux-gcc"
export CGO_CFLAGS="--sysroot=$TINY -I$TINY/include -I$TINY/include/linux"
env CGO_ENABLED=1 GOOS=linux GOARCH=mips GOMIPS=softfloat go build -a main.go

-------------------------------------

and the compiler responds

# runtime/cgo
In file included from _cgo_export.c:4:
cgo-builtin-prolog:7:33: error: unknown type name 'ptrdiff_t'


I haven't found why report this error

Ron Evans

unread,
Oct 24, 2019, 3:56:44 AM10/24/19
to gobotio
The Digispark Adaptor uses CGo, and CGo generally speaking does not work with cross-compilation. I think that is your problem.
Reply all
Reply to author
Forward
0 new messages