• Ah, OK, so that won't help you. Softdevice takes over hardware when enabled and breaks precise timing, so after NRF.stop() one can freely poke radio and other registers that are protected when softdevice is enabled and also interrupts go directly to the application and some reserved hardware is free to use. So that is not the reason for you.

    Looks like the issue goes deeper, it seems to be it is not that much supported now. I just tried build for NRF52832DK with bluetooth off and it breaks in one place

    diff --git a/src/jswrap_process.c b/src/jswrap_process.c
    index b25720ff5..60f1e3870 100644
    --- a/src/jswrap_process.c
    +++ b/src/jswrap_process.c
    @@ -155,7 +155,7 @@ JsVar *jswrap_process_env() {
     [#ifndef](https://forum.espruino.com/search/?q=%23ifndef) SAVE_ON_FLASH
       // Pointer to a list of predefined exports - eventually we'll get rid of the array above
       jsvObjectSetChildAndUnLock(obj, "EXPTR", jsvNewFromInteger((JsVarInt)(size_t)exportPtrs));
    -#ifdef NRF5X
    +#if defined(NRF5X) && defined(BLUETOOTH)
       extern uint32_t app_ram_base;
       if (app_ram_base)
         jsvObjectSetChildAndUnLock(obj, "APP_RAM_BASE", jsvNewFromInteger((JsVarInt)app_ram_base));
    

    but then it still links softdevice into binary so no big flash saving happens, that would need different linker script which is not there (and never was?).

    I made such linker script now and yet it needs Makefile tunings as it still tries to merge softdevice in (and fails), anyway I quickly hacked that and produced a hex file, I wonder if it even starts in your board? attached is hex file built with SDK12 but I cannot test it right now. it should run both on 52832 and 52840 (but uses only 64K ram and 512K flash) and takes over whole device - no SoftDevice or bootloader

    if you want, you can try it, if it even starts and you get espruino console on serial it is promising

    I may look into this soon for 52840/SDK15 as I plan to try Enhanced ShockBurst radio protocol in Espruino with 52840 dongle and need USB which is not in SDK12

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


    1 Attachment

About

Avatar for fanoush @fanoush started