• You really did mean an app (not going down that route)

    You mean you never install any apps on your phone? Honestly the NRF Connect app is harmless, ad-free, and very useful when developing with Bluetooth LE.

    why do we need to restart the "softdevice" to be able to use the poke32

    poke32 works totally fine with the softdevice running on most addresses, but there's a certain level of memory protection added while the softdevice (bluetooth stack) is running - it doesn't want you to be able to modify internal registers like UICR.

    So what we do is disable the Bluetooth stack, write them, and restart it. You also have to fully reset the device after setting the registers in order for the pins to work.

    But you only ever have to do this once for each device.

  • Many thanks for that. Will look at the app then. Its probably more the downloading firmware files from a remote location...

  • Will look at the app then. Its probably more the downloading files from a remote location...

    It is an app for Android or iPhone in builtin Google or Apple app store so no downloading of random files. NRF Connect app is made directly by Nordic Semiconductor for testing BLE and flashing Nordic chips. https://www.nordicsemi.com/Software-and-­tools/Development-Tools/nRF-Connect-for-­mobile

    As for poke32 - those 0x4001exxx addresses used are accessing low level NVMC hardware to directly write/erase flash memory. Doing this is protected because it would interrupt bluetooth timing - when writing to flash the CPU is completely halted until write is done which can take relatively long. So the softdevice manages flash access while it is running and writes to flash are carefully timed to not to break bluetooth traffic.

    If you run that code while bluetooth is on it will immediately reboot.


Avatar for natman1970 @natman1970 started