Closed patatoid closed 1 year ago
Hi @patatoid,
I just tried this by building Circuits Quickstart using the Beaglebone target and wasn't able to reproduce.
The Linux headers originate with the gcc toolchain used to build the system. In your custom system, did you change this? For example, for a BeagleBone system, I'd expect https://github.com/nerves-project/toolchains/releases/download/v1.6.0/nerves_toolchain_armv7_nerves_linux_gnueabihf-linux_x86_64-1.6.0-DAFF8EF.tar.xz to be used now.
I did not understand that the headers were to be present in the toolchain, I am still young with those concerns.
We were using the toolchain you mentioned but in an older version (the 1.4.3), I overrode the dependency to use the toolchain updated to the version you gave (1.6.0), but the headers to define SER_RS485_TERMINATE_BUS
are still not present. and failing with the same error.
Could you look at line 119 of ~.nerves/artifacts/nerves_toolchain_armv7_nerves_linux_gnueabihf-linux_x86_64-1.6.0/armv7-nerves-linux-gnueabihf/sysroot/usr/include/linux/serial.h
?
I think something else is going on. Could you export V=1
and rebuild? This should print out the commandline options that were passed to gcc
. Could you also show how you're building your project? (i.e., are you running mix firmware
?)
Here is the gcc command output:
/home/pascal/.nerves/artifacts/nerves_toolchain_armv7_nerves_linux_gnueabihf-linux_x86_64-1.6.0/bin/armv7-nerves-linux-gnueabihf-gcc -c -I/home/pascal/.nerves/artifacts/nerves_system_c2-portable-0.3.0/staging/usr/lib/erlang/erts-11.1.7/include -I/home/pascal/.nerves/artifacts/nerves_system_c2-portable-0.3.0/staging/usr/lib/erlang/lib/erl_interface-4.0.2/include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -O2 -I/home/pascal/.nerves/artifacts/nerves_system_c2-portable-0.3.0/staging/usr/include -std=c99 -D_GNU_SOURCE -o /home/pascal/malach.it/zola/aloha/_build/c2_dev/lib/circuits_uart/obj/uart_comm_unix.o src/uart_comm_unix.c
To build the project, I use the command mix firmware
.
Effectively there Is the required constant in the toolchain kernel headers.
@fhunleth I've taken over this task in our organization. fyi, we are using an older kernel (4.19) where SER_RS485_TERMINATE_BUS
constant was missing (maybe due to configuration, because it was introduced in 4.12-rc1).
The issue was solved by upgrading kernel.
I think we can close this, as this was introduced in a 5 years old kernel that may be considered as obsolete for Nerves users.
@patatoid wdyt ?
Ahh. I see. It's certainly ok with me to make RS486 support conditional if you'd like to send a PR.
@jeanparpaillon definitely it is the circuits_uart
update from 1.4.3
to 1.5.0
that introduced RS485
which needed a newer kernel as stated above.
Setup
Expected Behavior
I am looking forward to compiling circuits UART targeting a custom device. We have built a system based on BeagleBone (https://github.com/nerves-project/nerves_system_bbb) but compilation fails.
Actual Behavior
I am facing an issue compiling circuits_uart:
Steps to Reproduce the Problem
Compile circuits_uart with a BeagleBone-based system as a target should trigger the above error.
After some investigation, I saw that there were kernel headers missing in our target system, the whole uapi-related headers that include the required
SER_RS485_TERMINATE_BUS
constant.