• But anyway, it looks like running without softdevice is not really there and probably never was, without Bluetooth != without softdevice.

    Yes, checked more and when BLUETOOTH library is disabled it does not mean that softdevice is not needed. Some code always expects softdevice to be present - at least the flash erasing/writing code like jshFlashErasePages and jshFlashWrite in jshardware.c calls softdevice methods (that work even if softdevice and bluetooth is not enabled at startup)

    https://github.com/espruino/Espruino/blo­b/52352efac4f8f40976a4d268a0a074ad15251b­29/targets/nrf5x/jshardware.c#L2483
    https://github.com/espruino/Espruino/blo­b/52352efac4f8f40976a4d268a0a074ad15251b­29/targets/nrf5x/jshardware.c#L2673

    So no need to try that hex above, most probably it won't work at all or at least flash storage writing won't work.

    Also here it is hardcoded that softdevice is always present
    https://github.com/espruino/Espruino/blo­b/52352efac4f8f40976a4d268a0a074ad15251b­29/make/family/NRF52.make#L109

    So basically it is doable to remove softdevice dependency but needs some work. What can be done easily is to just remove BLUETOOTH to trim the espruino binary down but softdevice still needs to be there for now.

    TO fix the error you are having with 52840DK/SDK15 you can try this change

    diff --git a/targets/nrf5x/jshardware.c b/targets/nrf5x/jshardware.c
    index 879942b42..8a7299953 100644
    --- a/targets/nrf5x/jshardware.c
    +++ b/targets/nrf5x/jshardware.c
    @@ -93,6 +93,8 @@ void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info) {
     [#if](https://forum.espruino.com/search/­?q=%23if) NRF_SD_BLE_API_VERSION<5
     [#include](https://forum.espruino.com/se­arch/?q=%23include) "softdevice_handler.h"
     [#else](https://forum.espruino.com/searc­h/?q=%23else)
    +#include "nrf_sdh.h"
    +#include "nrf_sdh_soc.h"
     [#include](https://forum.espruino.com/se­arch/?q=%23include) "nrfx_spim.h"
     [#endif](https://forum.espruino.com/sear­ch/?q=%23endif)
    
    @@ -984,7 +986,13 @@ void jshInit() {
     [#else](https://forum.espruino.com/searc­h/?q=%23else) // !BLUETOOTH
       // because the code in bluetooth.c will call jsh_sys_evt_handler for us
       // if we were using bluetooth
    +#ifdef SOFTDEVICE_PRESENT
    +#if NRF_SD_BLE_API_VERSION<5
       softdevice_sys_evt_handler_set(jsh_sys_e­vt_handler);
    +#else
    +     NRF_SDH_SOC_OBSERVER(m_soc_observer, 1, jsh_sys_evt_handler, NULL);
    +#endif
    +#endif
     [#endif](https://forum.espruino.com/sear­ch/?q=%23endif)
    

    It builds for me with that but don't have any device to test around me now.

About

Avatar for fanoush @fanoush started