Adding I2C slave support broke SDK11 too. SDK11 version of drivers throws error when i2c slave is not enabled targetlibs/nrf5x_11/components/drivers_nrf/twis_slave/nrf_drv_twis.c:19:2: error: # error "TWIS driver included but none of TWIS devices is activated in the configuration file"
Can be patched out in the driver file by changing #error into #warning and adding #else/#endif around all the code definitions that follow
Quick workaround for me was adding DEFINES+=-DTWI_ENABLED=1' to board file but maybe those ifdef SPI/I2C/USART _COUNT>0 parts can be moved out of SDK12=only ifdef. I think I tried to configure out some of those on some 52840/SDK15 watches, not sure how it worked, will check.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Just tried and there is some minor breakage but with some tweaking it works.
One issue is that
nrf_gpio_pin_port_decode
is mostly ifdef-ed forNRF_SD_BLE_API_VERSION>5
https://github.com/search?q=repo%3Aespruino/Espruino%20nrf_gpio_pin_port_decode&type=codeexcept for one place
https://github.com/espruino/Espruino/blob/e5617094e3480ada254d7771ad70f73b923a951a/targets/nrf5x/jshardware.c#L1680
Since this method appears to be defined in Espruino version of SDK12, it works. So not sure if the ifdef could be removed elsewhere or added in this one new place.
Adding I2C slave support broke SDK11 too. SDK11 version of drivers throws error when i2c slave is not enabled
targetlibs/nrf5x_11/components/drivers_nrf/twis_slave/nrf_drv_twis.c:19:2: error: # error "TWIS driver included but none of TWIS devices is activated in the configuration file"
Can be patched out in the driver file by changing #error into #warning and adding #else/#endif around all the code definitions that follow
Also the change of including i2c/spi/serial code only if their count in board file is >0 broke SDK11. However I wonder why it works even for other SDKs than 12 as the code handling SPI/I2C/USART _COUNT here https://github.com/espruino/Espruino/blob/e5617094e3480ada254d7771ad70f73b923a951a/targets/nrf5x/app_config.h#L126 is inside a big block of other definitions all used only for SDK12 https://github.com/espruino/Espruino/blob/e5617094e3480ada254d7771ad70f73b923a951a/targets/nrf5x/app_config.h#L65 (??) so for 532840/SDK15 this is not evaluated(?)
Quick workaround for me was adding
DEFINES+=-DTWI_ENABLED=1'
to board file but maybe those ifdef SPI/I2C/USART _COUNT>0 parts can be moved out of SDK12=only ifdef. I think I tried to configure out some of those on some 52840/SDK15 watches, not sure how it worked, will check.