Skip to content
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

mipsle compile #59

Closed
dfense opened this issue May 28, 2017 · 4 comments
Closed

mipsle compile #59

dfense opened this issue May 28, 2017 · 4 comments

Comments

@dfense
Copy link

dfense commented May 28, 2017

Hi,

Your library looks solid and can use on linux np. However, I did most recently purchase some new IoT Omega2 processors from onion.io and they could be quite popular.

I have been writing programs in GO and running on it w/no problem. Runs great, small and tight.
I was hoping to get some serial port development going on it, and of course, seem to be quite a few platform specific items breaking.

Your serial lib seems the closest. I try to compile the simple default sample you provide with the library, and get the following error using this compile syntax.

GOOS=linux GOARCH=mipsle go build -compiler gc serial.go

# github.com/tarm/serial
src/github.com/tarm/serial/serial_linux.go:105: unknown field 'Ispeed' in struct literal of type syscall.Termios
src/github.com/tarm/serial/serial_linux.go:106: unknown field 'Ospeed' in struct literal of type syscall.Termios

Anything I can do to help you support this platform ?

@tarm
Copy link
Owner

tarm commented May 29, 2017

Looks the same as this issue:
golang/go#18866

Looks like there are some suggested approaches in that thread.

I would be open to patches that specialize with build constraints based on GOARCH (we have build constraints based on GOOS and CGO right now, but not GOARCH).

@ljubomirb
Copy link

ljubomirb commented Nov 27, 2017

the same issue with GOARCH=mips
(using Go 1.9.2)

EDIT:
after a whole day of try and error, and after trying several other serial port packages for GO, I've found that package: "github.com/jacobsa/go-serial/serial" works for MIPS, however, I needed to cross-compile c++ program (included in comments there) to test it on my MIPS platform (in my case, ar7xxx). After that, I was able to find out that constants to be changed there are:

original LINUX
	kTCSETS2 = 0x402C542B
	kBOTHER  = 0x1000
	kNCCS    = 19

changes for AR7xxx
       TCSETS2 = 0x8030542B
       BOTHER  = 0x00001000
       NCCS    = 23

After that, that package works. However, this is way complicated, time consuming, and not portable (one would have to cross compile c++, and manually change constants... etc etc).
I hope this information will help you fix this package, since otherwise it works fine. I'm guessing it's just a matter of some constants somewhere, but...

@tarm tarm closed this as completed in 48022fa Dec 15, 2017
tarm added a commit that referenced this issue Dec 15, 2017
Use "golang.org/x/sys/unix" instead of "syscall" (fix #59)
e154 pushed a commit to e154/serial that referenced this issue Jan 3, 2018
@nocko
Copy link

nocko commented Jan 12, 2018

This is still broken on mipsle and mips with the same error that OP reported.

After the merged patch, the missing fields are still referenced.

@tarm
Copy link
Owner

tarm commented Jan 14, 2018

@nocko I believe this is compiling as expected on mips. I just pushed a change to the travis.yml file that adds cross compile targets for arm, mips, and mipsle and those at least compile (I have not personally tested mips, but arm and x64 are in production).

TopOneExpert added a commit to TopOneExpert/go_serial-port that referenced this issue Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants