SPI on mangOH Green

Hi,

I have a few questions regarding SPI on mangOH.

  1. SPI2:
    Figure 2-13 on page 26 of the Developer’s Guide shows IoT#2 having a direct connection to SPI1. Is this true?
    I checked the schematic and it would seem that the SPI lines on IoT#2 are connected to pins 92, 93, 94, 95 on the CF3 socket, which are not dedicated SPI pins on the WP8548 module. Does SPI2 work? or is it intended to be used with different CF3 modules?

  2. SPI (in general)
    I’m trying to use SPI in user space (for the moment), but I cannot find the platform device at /dev/spidev_B_.C
    There’s /dev/sierra_spi but I get an error (Inappropriate ioctl for device) when trying to set the mode via ioctl.
    Is it instead mapped to some ‘tty#’ device?

Device: WP8548
Firmware: SWI9X15Y_07.11.09.00 r32989 CARMD-EV-FRMWR1 2016/08/11 18:03:20
Legato version: 16.07.0_cd4985660a55cc9a6f9a2ed28bcc757e_modified

Can anybody help me get the SPI device to show up in /dev/?
Are there any mangOH SPI examples I can follow? I couldn’t find one in the sample apps…a very short basic example on how to use each peripheral on the development platform would be most helpful.

Here’s my output after running modprobe -l if that helps

root@swi-mdm9x15:~# modprobe -l
kernel/fs/quota/quota_v1.ko
kernel/fs/quota/quota_v2.ko
kernel/fs/quota/quota_tree.ko
kernel/fs/nls/nls_cp737.ko
kernel/fs/nls/nls_cp775.ko
kernel/fs/nls/nls_cp850.ko
kernel/fs/nls/nls_cp852.ko
kernel/fs/nls/nls_cp855.ko
kernel/fs/nls/nls_cp857.ko
kernel/fs/nls/nls_cp860.ko
kernel/fs/nls/nls_cp861.ko
kernel/fs/nls/nls_cp862.ko
kernel/fs/nls/nls_cp863.ko
kernel/fs/nls/nls_cp864.ko
kernel/fs/nls/nls_cp865.ko
kernel/fs/nls/nls_cp866.ko
kernel/fs/nls/nls_cp869.ko
kernel/fs/nls/nls_cp874.ko
kernel/fs/nls/nls_cp932.ko
kernel/fs/nls/nls_euc-jp.ko
kernel/fs/nls/nls_cp936.ko
kernel/fs/nls/nls_cp949.ko
kernel/fs/nls/nls_cp950.ko
kernel/fs/nls/nls_cp1250.ko
kernel/fs/nls/nls_cp1251.ko
kernel/fs/nls/nls_iso8859-2.ko
kernel/fs/nls/nls_iso8859-3.ko
kernel/fs/nls/nls_iso8859-4.ko
kernel/fs/nls/nls_iso8859-5.ko
kernel/fs/nls/nls_iso8859-6.ko
kernel/fs/nls/nls_iso8859-7.ko
kernel/fs/nls/nls_cp1255.ko
kernel/fs/nls/nls_iso8859-9.ko
kernel/fs/nls/nls_iso8859-13.ko
kernel/fs/nls/nls_iso8859-14.ko
kernel/fs/nls/nls_koi8-r.ko
kernel/fs/nls/nls_koi8-u.ko
kernel/fs/nls/nls_koi8-ru.ko
kernel/fs/binfmt_misc.ko
kernel/fs/reiserfs/reiserfs.ko
kernel/fs/minix/minix.ko
kernel/fs/nfs/nfs.ko
kernel/fs/nfs/nfsv2.ko
kernel/fs/nfs/nfsv3.ko
kernel/fs/nfs/nfsv4.ko
kernel/fs/lockd/lockd.ko
kernel/fs/cifs/cifs.ko
kernel/fs/romfs/romfs.ko
kernel/fs/autofs4/autofs4.ko
kernel/fs/fuse/fuse.ko
kernel/fs/fuse/cuse.ko
kernel/crypto/cmac.ko
kernel/crypto/xcbc.ko
kernel/crypto/crypto_null.ko
kernel/crypto/md4.ko
kernel/crypto/sha256_generic.ko
kernel/crypto/sha512_generic.ko
kernel/crypto/wp512.ko
kernel/crypto/blowfish_generic.ko
kernel/crypto/blowfish_common.ko
kernel/crypto/twofish_generic.ko
kernel/crypto/twofish_common.ko
kernel/crypto/serpent_generic.ko
kernel/crypto/camellia_generic.ko
kernel/crypto/cast_common.ko
kernel/crypto/cast5_generic.ko
kernel/crypto/cast6_generic.ko
kernel/crypto/tea.ko
kernel/crypto/khazad.ko
kernel/crypto/anubis.ko
kernel/crypto/ansi_cprng.ko
kernel/crypto/tcrypt.ko
kernel/drivers/block/loop.ko
kernel/drivers/block/nbd.ko
kernel/drivers/block/cryptoloop.ko
kernel/drivers/net/wireless/ti/wl1251/wl1251.ko
kernel/drivers/net/usb/r8152.ko
kernel/drivers/net/usb/ax88179_178a.ko
kernel/drivers/net/bonding/bonding.ko
kernel/drivers/net/dummy.ko
kernel/drivers/net/tun.ko
kernel/drivers/net/ppp/ppp_generic.ko
kernel/drivers/net/ppp/ppp_async.ko
kernel/drivers/net/ppp/bsd_comp.ko
kernel/drivers/net/ppp/ppp_deflate.ko
kernel/drivers/net/ppp/ppp_synctty.ko
kernel/drivers/net/ppp/pppox.ko
kernel/drivers/net/ppp/pppoe.ko
kernel/drivers/net/slip/slip.ko
kernel/drivers/net/slip/slhc.ko
kernel/drivers/usb/storage/usb-storage.ko
kernel/drivers/usb/storage/ums-alauda.ko
kernel/drivers/usb/storage/ums-cypress.ko
kernel/drivers/usb/storage/ums-datafab.ko
kernel/drivers/usb/storage/ums-freecom.ko
kernel/drivers/usb/storage/ums-isd200.ko
kernel/drivers/usb/storage/ums-jumpshot.ko
kernel/drivers/usb/storage/ums-karma.ko
kernel/drivers/usb/storage/ums-onetouch.ko
kernel/drivers/usb/storage/ums-sddr09.ko
kernel/drivers/usb/storage/ums-sddr55.ko
kernel/drivers/usb/storage/ums-usbat.ko
kernel/drivers/input/keyboard/atkbd.ko
kernel/drivers/input/mouse/psmouse.ko
kernel/drivers/input/mousedev.ko
kernel/drivers/watchdog/softdog.ko
kernel/drivers/mmc/host/msm_sdcc.ko
kernel/drivers/scsi/scsi_mod.ko
kernel/drivers/scsi/scsi_tgt.ko
kernel/drivers/scsi/sd_mod.ko
kernel/drivers/scsi/sg.ko
kernel/drivers/input/serio/serio.ko
kernel/drivers/input/serio/serport.ko
kernel/drivers/input/serio/libps2.ko
kernel/net/core/pktgen.ko
kernel/net/802/p8022.ko
kernel/net/802/psnap.ko
kernel/net/802/stp.ko
kernel/net/sched/sch_cbq.ko
kernel/net/sched/sch_htb.ko
kernel/net/sched/sch_hfsc.ko
kernel/net/sched/sch_red.ko
kernel/net/sched/sch_gred.ko
kernel/net/sched/sch_ingress.ko
kernel/net/sched/sch_dsmark.ko
kernel/net/sched/sch_sfq.ko
kernel/net/sched/sch_tbf.ko
kernel/net/sched/sch_teql.ko
kernel/net/sched/sch_prio.ko
kernel/net/sched/sch_netem.ko
kernel/net/sched/sch_codel.ko
kernel/net/sched/cls_fw.ko
kernel/net/sched/cls_basic.ko
kernel/net/sched/cls_cgroup.ko
kernel/net/netfilter/nfnetlink.ko
kernel/net/netfilter/nfnetlink_queue.ko
kernel/net/netfilter/nfnetlink_log.ko
kernel/net/netfilter/nf_conntrack.ko
kernel/net/netfilter/nf_conntrack_proto_gre.ko
kernel/net/netfilter/nf_conntrack_proto_sctp.ko
kernel/net/netfilter/nf_conntrack_proto_udplite.ko
kernel/net/netfilter/nf_conntrack_netlink.ko
kernel/net/netfilter/nf_conntrack_amanda.ko
kernel/net/netfilter/nf_conntrack_ftp.ko
kernel/net/netfilter/nf_conntrack_h323.ko
kernel/net/netfilter/nf_conntrack_irc.ko
kernel/net/netfilter/nf_conntrack_broadcast.ko
kernel/net/netfilter/nf_conntrack_netbios_ns.ko
kernel/net/netfilter/nf_conntrack_pptp.ko
kernel/net/netfilter/nf_conntrack_sane.ko
kernel/net/netfilter/nf_conntrack_sip.ko
kernel/net/netfilter/nf_conntrack_tftp.ko
kernel/net/netfilter/nf_nat.ko
kernel/net/netfilter/nf_nat_proto_udplite.ko
kernel/net/netfilter/nf_nat_proto_sctp.ko
kernel/net/netfilter/nf_nat_amanda.ko
kernel/net/netfilter/nf_nat_ftp.ko
kernel/net/netfilter/nf_nat_irc.ko
kernel/net/netfilter/nf_nat_sip.ko
kernel/net/netfilter/nf_nat_tftp.ko
kernel/net/netfilter/x_tables.ko
kernel/net/netfilter/xt_tcpudp.ko
kernel/net/netfilter/xt_mark.ko
kernel/net/netfilter/xt_connmark.ko
kernel/net/netfilter/xt_nat.ko
kernel/net/netfilter/xt_CLASSIFY.ko
kernel/net/netfilter/xt_CT.ko
kernel/net/netfilter/xt_DSCP.ko
kernel/net/netfilter/xt_HL.ko
kernel/net/netfilter/xt_NETMAP.ko
kernel/net/netfilter/xt_NFLOG.ko
kernel/net/netfilter/xt_NFQUEUE.ko
kernel/net/netfilter/xt_REDIRECT.ko
kernel/net/netfilter/xt_TCPMSS.ko
kernel/net/netfilter/xt_TRACE.ko
kernel/net/netfilter/xt_comment.ko
kernel/net/netfilter/xt_connbytes.ko
kernel/net/netfilter/xt_connlimit.ko
kernel/net/netfilter/xt_conntrack.ko
kernel/net/netfilter/xt_dccp.ko
kernel/net/netfilter/xt_dscp.ko
kernel/net/netfilter/xt_ecn.ko
kernel/net/netfilter/xt_esp.ko
kernel/net/netfilter/xt_hashlimit.ko
kernel/net/netfilter/xt_helper.ko
kernel/net/netfilter/xt_hl.ko
kernel/net/netfilter/xt_length.ko
kernel/net/netfilter/xt_limit.ko
kernel/net/netfilter/xt_mac.ko
kernel/net/netfilter/xt_multiport.ko
kernel/net/netfilter/xt_cgroup.ko
kernel/net/netfilter/xt_pkttype.ko
kernel/net/netfilter/xt_policy.ko
kernel/net/netfilter/xt_quota.ko
kernel/net/netfilter/xt_realm.ko
kernel/net/netfilter/xt_sctp.ko
kernel/net/netfilter/xt_state.ko
kernel/net/netfilter/xt_statistic.ko
kernel/net/netfilter/xt_string.ko
kernel/net/netfilter/xt_tcpmss.ko
kernel/net/netfilter/xt_u32.ko
kernel/net/netfilter/ipset/ip_set.ko
kernel/net/ipv4/netfilter/nf_conntrack_ipv4.ko
kernel/net/ipv4/netfilter/nf_nat_ipv4.ko
kernel/net/ipv4/netfilter/nf_defrag_ipv4.ko
kernel/net/ipv4/netfilter/nf_nat_h323.ko
kernel/net/ipv4/netfilter/nf_nat_pptp.ko
kernel/net/ipv4/netfilter/nf_nat_proto_gre.ko
kernel/net/ipv4/netfilter/ip_tables.ko
kernel/net/ipv4/netfilter/iptable_filter.ko
kernel/net/ipv4/netfilter/iptable_mangle.ko
kernel/net/ipv4/netfilter/iptable_nat.ko
kernel/net/ipv4/netfilter/iptable_raw.ko
kernel/net/ipv4/netfilter/ipt_ah.ko
kernel/net/ipv4/netfilter/ipt_CLUSTERIP.ko
kernel/net/ipv4/netfilter/ipt_ECN.ko
kernel/net/ipv4/netfilter/ipt_MASQUERADE.ko
kernel/net/ipv4/netfilter/ipt_REJECT.ko
kernel/net/ipv4/netfilter/ipt_ULOG.ko
kernel/net/ipv4/netfilter/arp_tables.ko
kernel/net/ipv4/netfilter/arpt_mangle.ko
kernel/net/ipv4/netfilter/arptable_filter.ko
kernel/net/ipv4/ip_tunnel.ko
kernel/net/ipv4/ipip.ko
kernel/net/ipv4/ah4.ko
kernel/net/ipv4/esp4.ko
kernel/net/ipv4/ipcomp.ko
kernel/net/ipv4/xfrm4_tunnel.ko
kernel/net/ipv4/xfrm4_mode_beet.ko
kernel/net/ipv4/inet_lro.ko
kernel/net/ipv4/tunnel4.ko
kernel/net/ipv4/xfrm4_mode_transport.ko
kernel/net/ipv4/xfrm4_mode_tunnel.ko
kernel/net/ipv4/inet_diag.ko
kernel/net/ipv4/tcp_diag.ko
kernel/net/xfrm/xfrm_algo.ko
kernel/net/xfrm/xfrm_user.ko
kernel/net/xfrm/xfrm_ipcomp.ko
kernel/net/ipv6/netfilter/ip6_tables.ko
kernel/net/ipv6/netfilter/ip6table_filter.ko
kernel/net/ipv6/netfilter/ip6table_mangle.ko
kernel/net/ipv6/netfilter/ip6table_raw.ko
kernel/net/ipv6/netfilter/ip6t_eui64.ko
kernel/net/ipv6/netfilter/ip6t_frag.ko
kernel/net/ipv6/netfilter/ip6t_ipv6header.ko
kernel/net/ipv6/netfilter/ip6t_hbh.ko
kernel/net/ipv6/netfilter/ip6t_rt.ko
kernel/net/ipv6/ipv6.ko
kernel/net/ipv6/ah6.ko
kernel/net/ipv6/esp6.ko
kernel/net/ipv6/ipcomp6.ko
kernel/net/ipv6/xfrm6_tunnel.ko
kernel/net/ipv6/tunnel6.ko
kernel/net/ipv6/xfrm6_mode_transport.ko
kernel/net/ipv6/xfrm6_mode_tunnel.ko
kernel/net/ipv6/xfrm6_mode_beet.ko
kernel/net/ipv6/sit.ko
kernel/net/ipv6/ip6_tunnel.ko
kernel/net/8021q/8021q.ko
kernel/net/llc/llc.ko
kernel/net/unix/unix.ko
kernel/net/key/af_key.ko
kernel/net/bridge/bridge.ko
kernel/net/sunrpc/sunrpc.ko
kernel/net/sunrpc/auth_gss/auth_rpcgss.ko
kernel/net/sctp/sctp.ko
kernel/net/tipc/tipc.ko
kernel/net/dns_resolver/dns_resolver.ko
kernel/lib/ts_kmp.ko
kernel/lib/ts_bm.ko
kernel/lib/ts_fsm.ko
kernel/lib/oid_registry.ko
kernel/lttng-modules/probes/lttng-probe-sock.ko
kernel/lttng-modules/probes/lttng-probe-asoc.ko
kernel/lttng-modules/lttng-ring-buffer-metadata-client.ko
kernel/lttng-modules/probes/lttng-probe-printk.ko
updates/drivers/net/wireless/ti/wlcore/wlcore_sdio.ko
kernel/lttng-modules/probes/lttng-probe-napi.ko
kernel/lttng-modules/lttng-statedump.ko
kernel/lttng-modules/lttng-ring-buffer-client-mmap-discard.ko
kernel/lttng-modules/probes/lttng-probe-kmem.ko
kernel/lttng-modules/probes/lttng-probe-compaction.ko
updates/drivers/net/wireless/ti/wl18xx/wl18xx.ko
kernel/lttng-modules/lttng-ring-buffer-client-overwrite.ko
kernel/lttng-modules/lttng-ring-buffer-client-mmap-overwrite.ko
kernel/lttng-modules/probes/lttng-probe-sunrpc.ko
updates/drivers/net/wireless/ti/wlcore/wlcore.ko
kernel/lttng-modules/probes/lttng-ftrace.ko
kernel/lttng-modules/probes/lttng-probe-signal.ko
kernel/lttng-modules/probes/lttng-probe-module.ko
kernel/lttng-modules/lttng-ring-buffer-client-discard.ko
kernel/lttng-modules/probes/lttng-probe-timer.ko
kernel/lttng-modules/probes/lttng-types.ko
updates/drivers/net/wireless/ti/wl12xx/wl12xx.ko
kernel/lttng-modules/probes/lttng-probe-net.ko
kernel/lttng-modules/probes/lttng-probe-gpio.ko
kernel/lttng-modules/probes/lttng-probe-udp.ko
kernel/lttng-modules/probes/lttng-kretprobes.ko
kernel/lttng-modules/lttng-ring-buffer-metadata-mmap-client.ko
kernel/lttng-modules/lib/lttng-lib-ring-buffer.ko
kernel/lttng-modules/probes/lttng-probe-jbd2.ko
kernel/lttng-modules/probes/lttng-probe-statedump.ko
kernel/lttng-modules/probes/lttng-probe-ext4.ko
kernel/lttng-modules/probes/lttng-probe-rpm.ko
kernel/lttng-modules/probes/lttng-probe-rcu.ko
updates/net/wireless/cfg80211.ko
kernel/lttng-modules/lttng-tracer.ko
kernel/lttng-modules/probes/lttng-probe-power.ko
kernel/lttng-modules/probes/lttng-probe-sched.ko
kernel/lttng-modules/probes/lttng-probe-block.ko
kernel/lttng-modules/probes/lttng-probe-jbd.ko
kernel/lttng-modules/probes/lttng-probe-vmscan.ko
kernel/lttng-modules/probes/lttng-kprobes.ko
kernel/lttng-modules/probes/lttng-probe-scsi.ko
kernel/lttng-modules/probes/lttng-probe-regmap.ko
kernel/lttng-modules/probes/lttng-probe-skb.ko
kernel/lttng-modules/probes/lttng-probe-ext3.ko
kernel/lttng-modules/probes/lttng-probe-regulator.ko
kernel/lttng-modules/probes/lttng-probe-random.ko
kernel/lttng-modules/probes/lttng-probe-workqueue.ko
updates/net/mac80211/mac80211.ko
updates/compat/compat.ko
kernel/lttng-modules/probes/lttng-probe-irq.ko

Thanks,
Raf

Hi Raf,

For your questions:

SPI2: 
Figure 2-13 on page 26 of the Developer's Guide shows IoT#2 having a direct connection to SPI1. Is this true? 
I checked the schematic and it would seem that the SPI lines on IoT#2 are connected to pins 92, 93, 94, 95 on the CF3 socket, which are not dedicated SPI pins on the WP8548 module. Does SPI2 work? or is it intended to be used with different CF3 modules?

--> Yes, SPI2 is meant for different CF3 modules and is not supported on WP8548 module.

SPI (in general)
I'm trying to use SPI in user space (for the moment), but I cannot find the platform device at /dev/spidev_B_.C
There's /dev/sierra_spi but I get an error (Inappropriate ioctl for device) when trying to set the mode via ioctl.
Is it instead mapped to some 'tty#' device?


Can you try adding the following line of code in your user space code:
#ifdef SPI_IOC_MAGIC
#undef SPI_IOC_MAGIC
#define SPI_IOC_MAGIC 'l'
#endif

cheers,
Ashish

Hi Ashish,

Thanks for your assistance.

I’ve added the code to my main application file (after the #include of spidev.h) and the error message has now changed to ‘Invalid argument’.

Is SPI_IOC_MAGIC a unique number used with sierra_spi?

Legato Logger output
Sep 20 05:07:33 | Legato | iot[22141]/iot_exe T=main | _main.c main() 55 | == Starting Event Processing Loop ==
Sep 20 05:07:33 | Legato | iot[22141]/IoT_SPI_TestComponent T=main | IoT_SPI_Test.c _IoT_SPI_TestComponent_COMPONENT_INIT() 81 | SPI Test.
Sep 20 05:07:33 | Legato | =ERR= | iot[22141] | can’t set spi WR mode: Invalid argument

Application strace capture

open("/dev/sierra_spi", O_RDWR) = 7
ioctl(7, 0x40016c01, 0xb6f8e305) = -1 EINVAL (Invalid argument)
dup(2) = 8
fcntl64(8, F_GETFL) = 0x2 (flags O_RDWR)
fstat64(8, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), …}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f29000
write(8, “can’t set spi WR mode: Invalid a”…, 40can’t set spi WR mode: Invalid argument
) = 40
close(8)

Here’s my code. It’s basically just the standard ‘spidev_test.c’ program with minor changes. Sorry for bloating this reply with it. I was unable to attach the files. It fails at setting the spi mode. Note that I’ve tried all 4 modes and each gives the same result - invalid argument.

Thanks again


IoT_SPI_Test.c

#include “legato.h”
#include “stdint.h”
#include “unistd.h”
#include "stdio.h’
#include “stdlib.h”
#include “getopt.h”
#include “fcntl.h”
#include “sys/ioctl.h”
#include “linux/types.h”
#include “linux/spi/spidev.h”

/**************************************************/

#ifdef SPI_IOC_MAGIC
#undef SPI_IOC_MAGIC
#define SPI_IOC_MAGIC ‘l’
#endif

#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))

/**************************************************/

static const char *device = “/dev/sierra_spi”;

static uint8_t mode = SPI_MODE_0;
static uint8_t bits = 8;
static uint32_t speed = 1000000;
static uint16_t delay = 100;

/**************************************************/
static void pabort(const char *s)
{
perror(s);
abort();
}

static void transfer(int fd)
{

int ret;

uint8_t tx[] = {
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0x40, 0x00, 0x00, 0x00, 0x00, 0x95,
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xDE, 0xAD, 0xBE, 0xEF, 0xBA, 0xAD,
    0xF0, 0x0D,
};

uint8_t rx[ARRAY_SIZE(tx)] = {0, };

struct spi_ioc_transfer tr = {
    .tx_buf = (unsigned long)tx,
    .rx_buf = (unsigned long)rx,
    .len = ARRAY_SIZE(tx),
    .delay_usecs = delay,
    .speed_hz = speed,
    .bits_per_word = bits,
};

ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr);
if (ret < 1)
    pabort("can't send spi message");

for (ret = 0; ret < ARRAY_SIZE(tx); ret++) {
    if (!(ret % 6))
        puts("");
    printf("%.2X ", rx[ret]);
}
puts("");

}

COMPONENT_INIT
{
LE_INFO(“SPI Test.”);

int ret = 0;
int fd;

fd = open(device, O_RDWR);
if (fd < 0)
    pabort("can't open device");

// spi mode
ret = ioctl(fd, SPI_IOC_WR_MODE, &mode);
if (ret == -1)
    pabort("can't set spi WR mode");

ret = ioctl(fd, SPI_IOC_RD_MODE, &mode);
if (ret == -1)
    pabort("can't get spi RD mode");

// bits per word
ret = ioctl(fd, SPI_IOC_WR_BITS_PER_WORD, &bits);
if (ret == -1)
    pabort("can't set bits per word");

ret = ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &bits);
if (ret == -1)
    pabort("can't get bits per word");

// max speed hz
ret = ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed);
if (ret == -1)
    pabort("can't set max speed hz");

ret = ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed);
if (ret == -1)
    pabort("can't get max speed hz");

printf("spi mode: %d\n", mode);
printf("bits per word: %d\n", bits);
printf("max speed: %d Hz (%d KHz)\n", speed, speed/1000);

transfer(fd);

close(fd);

}


And the .adef file, IoT_SPI_Test.adef

sandboxed: false
version: 1.0.0
maxFileSystemBytes: 512K
executables:
{
iot = ( IoT_SPI_TestComponent )
}
processes:
{
envVars:
{
LE_LOG_LEVEL = DEBUG
}
run:
{
( iot )
}
maxCoreDumpFileBytes: 512K maxFileBytes: 512K
}
requires:
{
device:
{
// I get read and write access to the SPI port.
[rw] /dev/sierra_spi /dev/sierra_spi
}
}

I don’t know if it matters, but you have a requires/device section in your adef file, but your adef also has sandboxed:false. It shouldn’t be necessary to map the device file into the sandbox if there is no sandbox.

for mode set it as an int:
static int mode = SPI_MODE_0;

let me know how it goes. We plan to release an API for SPI functionality in the next 2-3 weeks.

cheers,
Ashish

@dfrey Thanks for the tip - It makes sense.

@asyal That did it, Ashish! Loop-back tests are working now. Thanks again.
Great news. An API would be very handy. I look forward to its release.

Cheers,
Raf

Rafi,

We will release our SPI API mid next week. Look forward to feedback.

cheers,
Ashish

Hi Ashish,

Just checking how the SPI API release is going and where might I be able to find it.

Cheers,
Raf

Raf,
After internal discussions, we plan to integrate the SPI code in the next Legato release.
However, if you want , we can release it to you as an alpha user. This means that you are aware that it is not fully tested.
From our side, I would like to get feedback from you on the SPI APIs so we can improve it further.
Let me know if that is you are ok with this and we can provide the code to you.
cheers,
Ashish

Ashish,
That works for me. I’d be happy to try it out and provide feedback.

Cheers,
Raf

Hello Asyal,
I plan to work with SPI and I’m also waiting for the SPI APIs.
I’d like to help if it’s possible.

cheers,
Reunan

Raf/Reunan,

You can get the SpiService and SpiTest from https://github.com/mangoh.
Note this beta code and will certainly change in the next few weeks.

cheers,
Ashish

Ashish,

Thanks for providing the code.

I’m just having a little difficulty understanding what to do after after following the steps from https://github.com/mangOH/SpiService. Are you able to assist?

I have acquired the mangOH source code from the repository and made the necessary changes to both files.
Note that I’m using Developer Studio 4.1.1 and my installation did not have a ‘mangOH’ folder before.
How do I integrate the mangOH folder/files with DS? As far as I can tell, my current setup did not make use of the ‘targetDefs.mangoh’ and ‘mangoh.sdef’ files.

I could just clone both spi components and run them but would prefer to do it properly.

Cheers,
Raf

Raf,
I built this using command line. Dev Studio integration will happen once this code is part of Legato main line (currently it is under review).
Why dont you use it using command line?
Ashish

Hi Ashish,

Here’s what I get when trying to build from the command line:

legato@legato-VirtualBox:~/mangOH/apps/SpiService$ mkapp -v -t wp85 spiService.adef
Parsing file: ‘/home/legato/mangOH/apps/SpiService/spiService.adef’.
Modelling application: 'spiService’
defined in: '/home/legato/mangOH/apps/SpiService/spiService.adef’
Application ‘spiService’ contains executable ‘spiService’.
Parsing file: ‘/home/legato/mangOH/apps/SpiService/spiServiceComponent/Component.cdef’.
Modelling component: 'spiServiceComponent’
found at: ‘/home/legato/mangOH/apps/SpiService/spiServiceComponent’
** ERROR:
/home/legato/mangOH/apps/SpiService/spiServiceComponent/Component.cdef:5:8: error: Couldn’t find file ‘$MANGOH_ROOT/apps/SpiService/spi.api’.

I receive the same error when attempting to build ‘spiTest’.

The file it’s after is definitely there:
legato@legato-VirtualBox:~/mangOH/apps/SpiService$ ls
_build_spiService spi.api spiService.adef
README.md spiLibraryComponent spiServiceComponent

I’m thinking it’s caused by my environment being configured for DS, thus it’s not aware of mangoh.sdef, targetDefs.mangoh, nor $MANGOH_ROOT for that matter.

Modules: wp85, wp750x
SDK Path: /home/legato/legato/packages/legato.sdk.16.7.0.wp85-wp75-native-x86_64-201609301633
Framework Path: /home/legato/legato/packages/legato.framework.16.7.0.201609081601 - $LEGATO_ROOT
Toolchain Path: /home/legato/legato/packages/legato.toolchain.1.7.3.fw_SWI9X15Y_07110900-wp85-wp750x-native-x86_64-201608171142 - $WP85_TOOLCHAIN_DIR $WP750X_TOOLCHAIN_DIR
Device Image Path: /home/legato/legato/packages/legato.device.image.7.11.9.00.wpX5-201609121138 - $WPX5_DEVICE_IMAGE
Recovery tools Path: /home/legato/legato/packages/legato.recovery.4.0.0.linux-201607191626 - $WPX5_RECOVERY
No toolchain found for target ‘ar7’.
Unable to find compatible cross-build toolchain for target ‘ar7’.
No toolchain found for target ‘ar86’.
Unable to find compatible cross-build toolchain for target ‘ar86’.
/home/legato
legato@legato-VirtualBox:~$

How can I reconfigure the legato environment to make this work?
Sorry if this is not the correct forum to be discussing this.

Thanks again,
Raf

Can you change the path in cdef from: $MANGOH_ROOT/apps/SpiService/spi.api to: /home/legato/mangOH/apps/SpiService/spi.api

Thanks Ashish - that did the trick.

There’s a bunch of cdef files from other services dependent on $MANGOH_ROOT so I just added these two lines to /home/legato/legato/packages/legato.sdk.latest/resources/configlegatoenv to make things easier.

sourceMangOHPath=/home/legato/mangOH/
export MANGOH_ROOT=${sourceMangOHPath}

All up and running now.

Raf

Thanks for the update.
Cheers,
Ashish

1 Like

using Legato 16.10.1 you need to add
..le_spi -> spiService.le_spi
as binding in adef

and
le_spi.api

to requires api in Component.cdef

This is missing from the documentation and should be added for completeness.

Hi everyone.
I am trying to enable SPI on my WP8548 and have some troubles with it
First of all i have legato 16.10on my target & i’m using this tutorial to enable SPI -> http://legato.io/legato-docs/latest/howToSPI.html I did all till step “Next, you’ll need to create a kernel module .ko file.” and went to -> http://legato.io/legato-docs/latest/yoctoOutofTreeKernelModule.html#howToAddKernelDriver_makeKernel there i did all till step “Build Kernel” and tryed to compile my spisvc.c module with “make” like in tutorial and it failed with error. Then i tryed to compile module with “sudo make” and it started to ask me about a hundred config questions, that i don’t even realize how to answer, and finaly it failed with error.
Can someone help me solving this issues? Or just say what am i doing wrong
Makefile

# Kernel module build command for ARM targets is:
# make PATH=$PATH:~opt/swiy17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi-
#
# List of object file(s) to be built
obj-m+=spisvc.o
#
# Point to the directory containing sources for the kernel running on target
# system. The kernel directory must have the configuration build step executed,
# i.e. it must contain the target system's .config file.
#
# Legato tools contain such a directory, point to it.
KBUILD_DIR=/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel
#
# Kernel module build dependency
all: 
	make -C $(KBUILD_DIR) M=$(PWD) modules
#
# Kernel module clean dependency
clean: 
	make -C $(KBUILD_DIR) M=$(PWD) clean   

spisvc.c

[spoiler]/ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the version 2 of the GNU General Public License
* as published by the Free Software Foundation
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see http://www.gnu.org/licenses/.
*
* Copyright © 2016 Sierra Wireless Inc.
*/

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/spi/spi.h>

#define MOD_DESC "Spidev creation module"

MODULE_DESCRIPTION(MOD_DESC);
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Sierra Wireless, Inc.");

static struct spi_device *spidev;

static __init int spisvc_init(void)
{
	struct spi_master *master;
	struct spi_board_info board = {
		.modalias = "spidev",
		.max_speed_hz = 15058800,
		.mode = SPI_MODE_3,
		.platform_data = NULL,
		.bus_num = 0,
		.chip_select = 0,
		.irq = 0,
	};

	master = spi_busnum_to_master(0);
	if (!master) {
		pr_err("No master for SPI bus 0.\n");
		return -ENODEV;
	}

	spidev = spi_new_device(master, &board);
	if (!spidev) {
		pr_err("Error creating device '%s'\n", board.modalias);
		return -ENODEV;
	}
	return 0;
}
module_init(spisvc_init);

static __exit void spisvc_exit(void)
{
	if (spidev)
		spi_unregister_device(spidev);
}
module_exit(spisvc_exit);

[/spoiler]

spisvc.mdef

//-------------------------------------------------------------------------------------------------
// Definition file for spisvc kernel module.
//
// Inserting this kernel module results in the creation of a spidev-type device /dev/spidev0.0.
// Removing this module removes the device. The device uses CS0 so any other SPI driver attempting
// to use the same chip-select would report a conflict.
//
// For use with a MangOH reference design, SPI device has to be plugged into IoT slot 0.
//
// Copyright (C) Sierra Wireless Inc.
//-------------------------------------------------------------------------------------------------

sources:
{
    spisvc.c
}

error.txt

shpp-admin@Aspire-V5-573G:~/kmodule$ make
make -C /opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel M=/home/shpp-admin/kmodule modules
make[1]: Entering directory ‘/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel’
CC [M] /home/shpp-admin/kmodule/spisvc.o
In file included from /opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/bitops.h:16:0,
from include/linux/bitops.h:36,
from include/linux/kernel.h:10,
from /opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/percpu.h:44,
from /opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/preempt.h:5,
from include/linux/preempt.h:20,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/linux/stat.h:18,
from include/linux/module.h:10,
from /home/shpp-admin/kmodule/spisvc.c:17:
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/arch_hweight.h: In function ‘__arch_hweight64’:
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/arch_hweight.h:53:42: error: expected ‘:’ or ‘)’ before ‘POPCNT64’
asm (ALTERNATIVE(“call __sw_hweight64”, POPCNT64, X86_FEATURE_POPCNT)
^
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/alternative.h:98:31: note: in definition of macro ‘ALTINSTR_REPLACEMENT’
b_replacement(number)":\n\t" newinstr “\n” e_replacement(number) “:\n\t”
^
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/arch_hweight.h:53:7: note: in expansion of macro ‘ALTERNATIVE’
asm (ALTERNATIVE(“call __sw_hweight64”, POPCNT64, X86_FEATURE_POPCNT)
^
In file included from include/linux/cache.h:5:0,
from include/linux/time.h:4,
from include/linux/stat.h:18,
from include/linux/module.h:10,
from /home/shpp-admin/kmodule/spisvc.c:17:
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/processor.h: At top level:
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/cache.h:7:25: error: ‘CONFIG_X86_L1_CACHE_SHIFT’ undeclared here (not in a function)
#define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT)
^
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/cache.h:8:30: note: in expansion of macro ‘L1_CACHE_SHIFT’
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
^
include/linux/cache.h:12:25: note: in expansion of macro ‘L1_CACHE_BYTES’
#define SMP_CACHE_BYTES L1_CACHE_BYTES
^
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/processor.h:131:30: note: in expansion of macro ‘SMP_CACHE_BYTES’
} attribute((aligned(SMP_CACHE_BYTES)));
^
In file included from /opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/thread_info.h:22:0,
from include/linux/thread_info.h:54,
from /opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:20,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/linux/stat.h:18,
from include/linux/module.h:10,
from /home/shpp-admin/kmodule/spisvc.c:17:
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/processor.h:164:0: warning: “cache_line_size” redefined
#define cache_line_size() (boot_cpu_data.x86_cache_alignment)
^
In file included from include/linux/time.h:4:0,
from include/linux/stat.h:18,
from include/linux/module.h:10,
from /home/shpp-admin/kmodule/spisvc.c:17:
include/linux/cache.h:64:0: note: this is the location of the previous definition
#define cache_line_size() L1_CACHE_BYTES
^
In file included from /opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/atomic.h:255:0,
from include/linux/atomic.h:4,
from /opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/thread_info.h:23,
from include/linux/thread_info.h:54,
from /opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:20,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/linux/stat.h:18,
from include/linux/module.h:10,
from /home/shpp-admin/kmodule/spisvc.c:17:
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/atomic64_64.h:19:40: error: unknown type name ‘atomic64_t’
static inline long atomic64_read(const atomic64_t v)
^
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/atomic64_64.h: In function ‘atomic64_read’:
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/atomic64_64.h:21:32: error: request for member ‘counter’ in something not a structure or union
return (
(volatile long *)&(v)->counter);
^
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/atomic64_64.h: At top level:
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/atomic64_64.h:31:33: error: unknown type name ‘atomic64_t’
static inline void atomic64_set(atomic64_t *v, long i)
^
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/atomic64_64.h:43:41: error: unknown type name ‘atomic64_t’
static inline void atomic64_add(long i, atomic64_t *v)
^
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/atomic64_64.h:57:41: error: unknown type name ‘atomic64_t’
static inline void atomic64_sub(long i, atomic64_t *v)
^
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/atomic64_64.h:73:49: error: unknown type name ‘atomic64_t’
static inline int atomic64_sub_and_test(long i, atomic64_t *v)
^
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/atomic64_64.h:84:33: error: unknown type name ‘atomic64_t’
static inline void atomic64_inc(atomic64_t *v)
^
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/atomic64_64.h:97:33: error: unknown type name ‘atomic64_t’
static inline void atomic64_dec(atomic64_t *v)
^
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/atomic64_64.h:112:41: error: unknown type name ‘atomic64_t’
static inline int atomic64_dec_and_test(atomic64_t *v)
^
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/atomic64_64.h:125:41: error: unknown type name ‘atomic64_t’
static inline int atomic64_inc_and_test(atomic64_t *v)
^
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/atomic64_64.h:139:49: error: unknown type name ‘atomic64_t’
static inline int atomic64_add_negative(long i, atomic64_t *v)
^
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/atomic64_64.h:151:48: error: unknown type name ‘atomic64_t’
static inline long atomic64_add_return(long i, atomic64_t *v)
^
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/atomic64_64.h:156:48: error: unknown type name ‘atomic64_t’
static inline long atomic64_sub_return(long i, atomic64_t *v)
^
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/atomic64_64.h:164:37: error: unknown type name ‘atomic64_t’
static inline long atomic64_cmpxchg(atomic64_t *v, long old, long new)
^
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/atomic64_64.h:169:34: error: unknown type name ‘atomic64_t’
static inline long atomic64_xchg(atomic64_t *v, long new)
^
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/atomic64_64.h:183:39: error: unknown type name ‘atomic64_t’
static inline int atomic64_add_unless(atomic64_t *v, long a, long u)
^
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/atomic64_64.h:207:45: error: unknown type name ‘atomic64_t’
static inline long atomic64_dec_if_positive(atomic64_t *v)
^
In file included from include/linux/elf.h:4:0,
from include/linux/module.h:14,
from /home/shpp-admin/kmodule/spisvc.c:17:
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/elf.h: In function ‘elf_common_init’:
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/elf.h:173:3: error: ‘struct thread_struct’ has no member named ‘fs’
t->fs = t->gs = 0;
^
In file included from include/linux/module.h:22:0,
from /home/shpp-admin/kmodule/spisvc.c:17:
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/module.h: At top level:
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/include/asm/module.h:57:2: error: #error unknown processor family
#error unknown processor family
^
In file included from /home/shpp-admin/kmodule/spisvc.c:17:0:
include/linux/module.h:305:27: error: field ‘arch’ has incomplete type
struct mod_arch_specific arch;
^
In file included from include/linux/sched.h:30:0,
from include/linux/kthread.h:5,
from include/linux/spi/spi.h:25,
from /home/shpp-admin/kmodule/spisvc.c:19:
include/linux/cputime.h:4:25: fatal error: asm/cputime.h: No such file or directory
compilation terminated.
scripts/Makefile.build:314: recipe for target ‘/home/shpp-admin/kmodule/spisvc.o’ failed
make[2]: *** [/home/shpp-admin/kmodule/spisvc.o] Error 1
Makefile:1276: recipe for target ‘module/home/shpp-admin/kmodule’ failed
make[1]: *** [module/home/shpp-admin/kmodule] Error 2
make[1]: Leaving directory ‘/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel’
Makefile:16: recipe for target ‘all’ failed
make: *** [all] Error 2

sudo error.txt

[spoiler]shpp-admin@Aspire-V5-573G:~/kmodule$ sudo make
[sudo] password for shpp-admin:
make -C /opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel M= modules
make[1]: Entering directory ‘/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel’

make[2]: *** No rule to make target ‘arch/x86/tools/relocs_32.c’, needed by ‘arch/x86/tools/relocs_32.o’. Stop.
/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/arch/x86/Makefile:179: recipe for target ‘archscripts’ failed
make[1]: *** [archscripts] Error 2
make[1]: Leaving directory ‘/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel’
Makefile:16: recipe for target ‘all’ failed
make: *** [all] Error 2

[/spoiler]
error.txt (11.8 KB)
sudo error.txt (85.3 KB)