Access NXP SC16IS752 from Raspberry Pi 3

We are trying to get an Andino-X1 with an RS-485 extension working, but the serial port doesn’t show up.

The Andino is a Raspberry Pi 3 Model B+
We use Resin OS 2.12.6+rev1
Their Github page explains what to do:

https://github.com/andino-systems/Andino-X1/tree/master/doc/RS485#installation-on-the-raspberry-pi

I’ve added the necessary dtoverlay configuration in the resin io dashboard:

RESIN_HOST_CONFIG_dtoverlay    "spi0-cs,cs0_pin=8,cs1_pin=12","sc16is752-spi0,int_pin=7"

I also checked the /boot/config.txt on the microSD card on my PC and the values are set as required:

...
dtoverlay=spi0-cs,cs0_pin=8,cs1_pin=12
dtoverlay=sc16is752-spi0,int_pin=7
dtparam=spi=on
...

But unfortunately I can’t see the /dev/ttySC0 and /dev/ttySC1 neither on the host nor in my container (using docker-compose).

I’m not familiar with device tree overlays, but I can find the sc16is752 in the layer configuration, but it seems as if it was for spi1 (the spi0-cs is available, so that shouldn’t be the problem). What does that mean? The Raspberry Pi 3 only has SPI0 connected to the header (see here). Where can I see if a device overlay was successfully loaded?

BTW: it worked just fine using Raspbian on the same hardware. So this must be related to Resin.

Hi. Can you confirm you also copied the required .dtbo in the correct directory?
When you mount the SD card on your computer, it should be in the first partition, in the overlays directory.
Can you paste the listing of that directory please?

Some files are already there from the default Raspberry Pi image:

Listing of overlays

F:\overlays
λ ls -la
total 304
drwxr-xr-x 1 swei 1052166 0 May 5 08:10 ./
drwxr-xr-x 1 swei 1052166 0 Dec 31 1979 …/
-rw-r–r-- 1 swei 1052166 1027 May 5 08:10 adau1977-adc.dtbo
-rw-r–r-- 1 swei 1052166 1587 May 5 08:10 adau7002-simple.dtbo
-rw-r–r-- 1 swei 1052166 2425 May 5 08:10 ads1015.dtbo
-rw-r–r-- 1 swei 1052166 2425 May 5 08:10 ads1115.dtbo
-rw-r–r-- 1 swei 1052166 2426 May 5 08:10 ads7846.dtbo
-rw-r–r-- 1 swei 1052166 1387 May 5 08:10 akkordion-iqdacplus.dtbo
-rw-r–r-- 1 swei 1052166 1473 May 5 08:10 allo-boss-dac-pcm512x-audio.dtbo
-rw-r–r-- 1 swei 1052166 1208 May 5 08:10 allo-digione.dtbo
-rw-r–r-- 1 swei 1052166 1011 May 5 08:10 allo-piano-dac-pcm512x-audio.dtbo
-rw-r–r-- 1 swei 1052166 1585 May 5 08:10 allo-piano-dac-plus-pcm512x-audio.dtbo
-rw-r–r-- 1 swei 1052166 1668 May 5 08:10 at86rf233.dtbo
-rw-r–r-- 1 swei 1052166 1972 May 5 08:10 audioinjector-addons.dtbo
-rw-r–r-- 1 swei 1052166 787 May 5 08:10 audioinjector-wm8731-audio.dtbo
-rw-r–r-- 1 swei 1052166 575 May 5 08:10 audremap.dtbo
-rw-r–r-- 1 swei 1052166 1629 May 5 08:10 balena-fin.dtbo
-rw-r–r-- 1 swei 1052166 449 May 5 08:10 bmp085_i2c-sensor.dtbo
-rw-r–r-- 1 swei 1052166 983 May 5 08:10 dht11.dtbo
-rw-r–r-- 1 swei 1052166 1027 May 5 08:10 dionaudio-loco-v2.dtbo
-rw-r–r-- 1 swei 1052166 663 May 5 08:10 dionaudio-loco.dtbo
-rw-r–r-- 1 swei 1052166 765 May 5 08:10 dpi18.dtbo
-rw-r–r-- 1 swei 1052166 789 May 5 08:10 dpi24.dtbo
-rw-r–r-- 1 swei 1052166 423 May 5 08:10 dwc-otg.dtbo
-rw-r–r-- 1 swei 1052166 852 May 5 08:10 dwc2.dtbo
-rw-r–r-- 1 swei 1052166 1279 May 5 08:10 enc28j60-spi2.dtbo
-rw-r–r-- 1 swei 1052166 1403 May 5 08:10 enc28j60.dtbo
-rw-r–r-- 1 swei 1052166 1932 May 5 08:10 fe-pi-audio.dtbo
-rw-r–r-- 1 swei 1052166 1437 May 5 08:10 goodix.dtbo
-rw-r–r-- 1 swei 1052166 1259 May 5 08:10 googlevoicehat-soundcard.dtbo
-rw-r–r-- 1 swei 1052166 1036 May 5 08:10 gpio-ir.dtbo
-rw-r–r-- 1 swei 1052166 901 May 5 08:10 gpio-poweroff.dtbo
-rw-r–r-- 1 swei 1052166 1250 May 5 08:10 gpio-shutdown.dtbo
-rw-r–r-- 1 swei 1052166 779 May 5 08:10 hifiberry-amp.dtbo
-rw-r–r-- 1 swei 1052166 655 May 5 08:10 hifiberry-dac.dtbo
-rw-r–r-- 1 swei 1052166 1693 May 5 08:10 hifiberry-dacplus.dtbo
-rw-r–r-- 1 swei 1052166 1125 May 5 08:10 hifiberry-digi-pro.dtbo
-rw-r–r-- 1 swei 1052166 959 May 5 08:10 hifiberry-digi.dtbo
-rw-r–r-- 1 swei 1052166 2468 May 5 08:10 hy28a.dtbo
-rw-r–r-- 1 swei 1052166 2939 May 5 08:10 hy28b.dtbo
-rw-r–r-- 1 swei 1052166 270 May 5 08:10 i2c-bcm2708.dtbo
-rw-r–r-- 1 swei 1052166 991 May 5 08:10 i2c-gpio.dtbo
-rw-r–r-- 1 swei 1052166 2185 May 5 08:10 i2c-mux.dtbo
-rw-r–r-- 1 swei 1052166 644 May 5 08:10 i2c-pwm-pca9685a.dtbo
-rw-r–r-- 1 swei 1052166 4143 May 5 08:10 i2c-rtc-gpio.dtbo
-rw-r–r-- 1 swei 1052166 3765 May 5 08:10 i2c-rtc.dtbo
-rw-r–r-- 1 swei 1052166 3781 May 5 08:10 i2c-sensor.dtbo
-rw-r–r-- 1 swei 1052166 1182 May 5 08:10 i2c0-bcm2708.dtbo
-rw-r–r-- 1 swei 1052166 805 May 5 08:10 i2c1-bcm2708.dtbo
-rw-r–r-- 1 swei 1052166 343 May 5 08:10 i2s-gpio28-31.dtbo
-rw-r–r-- 1 swei 1052166 1272 May 5 08:10 iqaudio-dac.dtbo
-rw-r–r-- 1 swei 1052166 1511 May 5 08:10 iqaudio-dacplus.dtbo
-rw-r–r-- 1 swei 1052166 1326 May 5 08:10 iqaudio-digi-wm8804-audio.dtbo
-rw-r–r-- 1 swei 1052166 1276 May 5 08:10 justboom-dac.dtbo
-rw-r–r-- 1 swei 1052166 955 May 5 08:10 justboom-digi.dtbo
-rw-r–r-- 1 swei 1052166 1348 May 5 08:10 lirc-rpi.dtbo
-rw-r–r-- 1 swei 1052166 1329 May 5 08:10 mcp23017.dtbo
-rw-r–r-- 1 swei 1052166 15229 May 5 08:10 mcp23s17.dtbo
-rw-r–r-- 1 swei 1052166 1833 May 5 08:10 mcp2515-can0.dtbo
-rw-r–r-- 1 swei 1052166 1833 May 5 08:10 mcp2515-can1.dtbo
-rw-r–r-- 1 swei 1052166 4237 May 5 08:10 mcp3008.dtbo
-rw-r–r-- 1 swei 1052166 720 May 5 08:10 midi-uart0.dtbo
-rw-r–r-- 1 swei 1052166 857 May 5 08:10 midi-uart1.dtbo
-rw-r–r-- 1 swei 1052166 1099 May 5 08:10 mmc.dtbo
-rw-r–r-- 1 swei 1052166 796 May 5 08:10 mpu6050.dtbo
-rw-r–r-- 1 swei 1052166 2850 May 5 08:10 mz61581.dtbo
-rw-r–r-- 1 swei 1052166 2356 May 5 08:10 papirus.dtbo
-rw-r–r-- 1 swei 1052166 569 May 5 08:10 pi3-act-led.dtbo
-rw-r–r-- 1 swei 1052166 818 May 5 08:10 pi3-disable-bt.dtbo
-rw-r–r-- 1 swei 1052166 265 May 5 08:10 pi3-disable-wifi.dtbo
-rw-r–r-- 1 swei 1052166 1105 May 5 08:10 pi3-miniuart-bt.dtbo
-rw-r–r-- 1 swei 1052166 2713 May 5 08:10 piscreen.dtbo
-rw-r–r-- 1 swei 1052166 2617 May 5 08:10 piscreen2r.dtbo
-rw-r–r-- 1 swei 1052166 2454 May 5 08:10 pisound.dtbo
-rw-r–r-- 1 swei 1052166 1544 May 5 08:10 pitft22.dtbo
-rw-r–r-- 1 swei 1052166 2385 May 5 08:10 pitft28-capacitive.dtbo
-rw-r–r-- 1 swei 1052166 2802 May 5 08:10 pitft28-resistive.dtbo
-rw-r–r-- 1 swei 1052166 2802 May 5 08:10 pitft35-resistive.dtbo
-rw-r–r-- 1 swei 1052166 1043 May 5 08:10 pps-gpio.dtbo
-rw-r–r-- 1 swei 1052166 1057 May 5 08:10 pwm-2chan.dtbo
-rw-r–r-- 1 swei 1052166 946 May 5 08:10 pwm.dtbo
-rw-r–r-- 1 swei 1052166 1315 May 5 08:10 qca7000.dtbo
-rw-r–r-- 1 swei 1052166 1301 May 5 08:10 raspidac3.dtbo
-rw-r–r-- 1 swei 1052166 1275 May 5 08:10 rotary-encoder.dtbo
-rw-r–r-- 1 swei 1052166 489 May 5 08:10 rpi-backlight.dtbo
-rw-r–r-- 1 swei 1052166 3406 May 5 08:10 rpi-cirrus-wm5102.dtbo
-rw-r–r-- 1 swei 1052166 643 May 5 08:10 rpi-dac.dtbo
-rw-r–r-- 1 swei 1052166 2524 May 5 08:10 rpi-display.dtbo
-rw-r–r-- 1 swei 1052166 462 May 5 08:10 rpi-ft5406.dtbo
-rw-r–r-- 1 swei 1052166 771 May 5 08:10 rpi-proto.dtbo
-rw-r–r-- 1 swei 1052166 893 May 5 08:10 rpi-sense.dtbo
-rw-r–r-- 1 swei 1052166 499 May 5 08:10 rpi-tv.dtbo
-rw-r–r-- 1 swei 1052166 1298 May 5 08:10 rra-digidac1-wm8741-audio.dtbo
-rw-r–r-- 1 swei 1052166 1174 May 5 08:10 sc16is750-i2c.dtbo
-rw-r–r-- 1 swei 1052166 1875 May 5 08:10 sc16is752-spi1.dtbo
-rw-r–r-- 1 swei 1052166 846 May 5 08:10 sdhost.dtbo
-rw-r–r-- 1 swei 1052166 1078 May 5 08:10 sdio-1bit.dtbo
-rw-r–r-- 1 swei 1052166 1116 May 5 08:10 sdio.dtbo
-rw-r–r-- 1 swei 1052166 699 May 5 08:10 sdtweak.dtbo
-rw-r–r-- 1 swei 1052166 376 May 5 08:10 smi-dev.dtbo
-rw-r–r-- 1 swei 1052166 1508 May 5 08:10 smi-nand.dtbo
-rw-r–r-- 1 swei 1052166 981 May 5 08:10 smi.dtbo
-rw-r–r-- 1 swei 1052166 666 May 5 08:10 spi-gpio35-39.dtbo
-rw-r–r-- 1 swei 1052166 635 May 5 08:10 spi-rtc.dtbo
-rw-r–r-- 1 swei 1052166 919 May 5 08:10 spi0-cs.dtbo
-rw-r–r-- 1 swei 1052166 492 May 5 08:10 spi0-hw-cs.dtbo
-rw-r–r-- 1 swei 1052166 1547 May 5 08:10 spi1-1cs.dtbo
-rw-r–r-- 1 swei 1052166 1920 May 5 08:10 spi1-2cs.dtbo
-rw-r–r-- 1 swei 1052166 2293 May 5 08:10 spi1-3cs.dtbo
-rw-r–r-- 1 swei 1052166 1547 May 5 08:10 spi2-1cs.dtbo
-rw-r–r-- 1 swei 1052166 1920 May 5 08:10 spi2-2cs.dtbo
-rw-r–r-- 1 swei 1052166 2293 May 5 08:10 spi2-3cs.dtbo
-rw-r–r-- 1 swei 1052166 4878 May 5 08:10 tinylcd35.dtbo
-rw-r–r-- 1 swei 1052166 980 May 5 08:10 uart1.dtbo
-rw-r–r-- 1 swei 1052166 1412 May 5 08:10 vc4-fkms-v3d.dtbo
-rw-r–r-- 1 swei 1052166 3108 May 5 08:10 vc4-kms-v3d.dtbo
-rw-r–r-- 1 swei 1052166 758 May 5 08:10 vga666.dtbo
-rw-r–r-- 1 swei 1052166 1251 May 5 08:10 w1-gpio-pullup.dtbo
-rw-r–r-- 1 swei 1052166 1116 May 5 08:10 w1-gpio.dtbo
-rw-r–r-- 1 swei 1052166 1080 May 5 08:10 wittypi.dtbo

But as I mentioned in the last paragraph, they seem to be for the “wrong” SPI bus (sc16is752-spi1 instead of sc16is752-spi0). Can I simply take the sc16is752-spi0 overlay for Raspbian and paste it into this folder? Or do I need to “build” Resin.io to include this overlay?

You should copy the file that they reference on their guide “sc16is752-spi0.dtbo” and copy it in the overlays directory, alongside the other files there.
Can you try that and let us know if that works?

Eureka, it works! Thanks a lot.

I guess, there is no easy way to integrate this into an image (besides generating the image on your server, unpack the ZIP, mount, modify and unmount the *.img file). Or is there a way to add files to the generated file on the server (similar to the way we can modify the config.txt)?

Hi, currently this is the only way to do that.
Let me ask if there is something planned to help with this.
@shaunmulligan are you aware of any discussions for easing the addition of files (such as device tree overlays) to the dashboard images?

@floion yes we plan to make this easier, but it will probably only come with the addition of hostApps (this roadmap item) which will most likely happen end of 2018 or early 2019.