• I'm trying to build Espruino for a nRF52840 device (Particle Xenon) and started with the following:

    //1st try with defaults
    git clone https://github.com/espruino/Espruino.git­
    cd Espruino/
    source scripts/provision.sh NRF52840DK
    make clean && BOARD=NRF52840DK RELEASE=1 make
    

    and found out that the current source uses nRF SDK15 but "FIXME - SDK15 NFC patches don't apply cleanly" and some other fails appear. Building hex file works but executing NFC methods fail:

    NRF.nfcURL("http://espruino.com"); 
    Uncaught Error: Function "nfcURL" not found!
    

    I checked the source and found out that there is a USE_NFC option but seems that the build fails:

    BOARD=NRF52840DK RELEASE=1 USE_NFC=1 make
    ...
    targetlibs/nrf5x_15/components/nfc/t2t_l­ib/hal_t2t/hal_nfc_t2t.c: In function 'hal_nfc_send':
    targetlibs/nrf5x_15/components/nfc/t2t_l­ib/hal_t2t/hal_nfc_t2t.c:742:12: warning: passing argument 1 of 'memcpy' discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers]
         memcpy(m_nfc_buffer, p_data, NFC_BUFFER_SIZE);
                ^~~~~~~~~~~~
    In file included from targetlibs/nrf5x_15/components/nfc/t2t_l­ib/hal_t2t/hal_nfc_t2t.h:56,
                     from targetlibs/nrf5x_15/components/nfc/t2t_l­ib/hal_t2t/hal_nfc_t2t.c:44:
    ~/Espruino/gcc-arm-none-eabi-8-2018-q4-m­ajor/arm-none-eabi/include/string.h:31:9­: note: expected 'void * restrict' but argument is of type 'volatile uint8_t *' {aka 'volatile unsigned char *'}
     void *  memcpy (void *__restrict, const void *__restrict, size_t);
             ^~~~~~
    targetlibs/nrf5x_15/components/nfc/t2t_l­ib/hal_t2t/hal_nfc_t2t.c: In function 'NFCT_IRQHandler':
    targetlibs/nrf5x_15/components/nfc/t2t_l­ib/hal_t2t/hal_nfc_t2t.c:874:17: error: 'm_nfc_rx_buffer' undeclared (first use in this function); did you mean 'm_nfc_buffer'?
                 if (m_nfc_rx_buffer[0] == T2T_READ_CMD)
                     ^~~~~~~~~~~~~~~
                     m_nfc_buffer
    targetlibs/nrf5x_15/components/nfc/t2t_l­ib/hal_t2t/hal_nfc_t2t.c:874:17: note: each undeclared identifier is reported only once for each function it appears in
    targetlibs/nrf5x_15/components/nfc/t2t_l­ib/hal_t2t/hal_nfc_t2t.c:874:39: error: 'T2T_READ_CMD' undeclared (first use in this function)
                 if (m_nfc_rx_buffer[0] == T2T_READ_CMD)
                                           ^~~~~~~~~~~~
    make: *** [Makefile:799: ~/Espruino/targetlibs/nrf5x_15/component­s/nfc/t2t_lib/hal_t2t/hal_nfc_t2t.o] Error 1
    make: *** Waiting for unfinished jobs....
    

    There are 4 SDK folders under Espruino/targetlibs

    nrf5x_12
    nrf5x_14
    nrf5x_15
    nrf5x_17
    

    but provision.sh only supports SDK15 and SDK17.
    What is the best SDK version for building?

About

Avatar for rena2019 @rena2019 started