• Hi,
    if i do peek32(0x40000000+0x418) i get STATE = running and SRC = RC, so thats not the problem. However if i execute poke32(0x4000B000,1) the setInterval() works so i assume that the RTC0 has not been started.

    So i made your suggested changes:

    diff --git a/targets/nrf5x/jshardware.c b/targets/nrf5x/jshardware.c
    index 879942b..de94214 100644
    --- a/targets/nrf5x/jshardware.c
    +++ b/targets/nrf5x/jshardware.c
    
    @@ -984,7 +987,14 @@ 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
    +NRF_RTC0->TASKS_START = 1;
     [#endif](https://forum.espruino.com/sear­ch/?q=%23endif)
    

    It looks like the PRESCALER configuration works like this. At least the setInterval() calls execute with the right interval.
    For now everything works so far i think. You helped me a lot! Thanks.

    I've attached the complete changes. If anyone needs this too it can be found here.


    1 Attachment

  • I've attached the complete changes. If anyone needs this too it can be found here.

    For calling the sd_softdevice_is_enabled you have ifndef BLUETOOTH there, it should be ifdef to skip this call in your case when bluetooth ( => and softdevice) is not enabled. The extra call won't hurt of course, just mentioning this in case anyone needs this too.

    In fact if BLUETOOTH is enabled it can be set to 1. It is only my case, where I can turn it off and on via NFC.stop()/start(), that needs this call.

About

Avatar for Chris3006 @Chris3006 started