You are reading a single comment by @fanoush and its replies.
Click here to read the full conversation.
-
I see that require("Flash").write(0,0x1000120c) doesn't work.
Yes, there is no nordic api for that https://devzone.nordicsemi.com/f/nordic-q-a/7300/can-sd_flash_write-be-used-to-write-to-the-uicr or https://devzone.nordicsemi.com/f/nordic-q-a/20864/pattern-for-writing-to-uicr-while-soft-device-enabled
With that patch I am doing it by poking NVMC
NRF.onRestart=function(){ poke32(0x4001e504,1);while(!peek32(0x4001e400)); // enable flash writing poke32(0x1000120c,0xfffffffe);while(!peek32(0x4001e400)); // NFC pins as GPIO poke32(0x4001e504, 0);while(!peek32(0x4001e400)); // disable flash writing } NRF.restart();
When a firmware without NFC enabled boots, it clears the UICR registers automatically to enable the GPIO pins.
So actually the easy solution is just to install a firmware with NFC disabled and it'll all magically work - although the official build still has NFC in so we'd have to do a custom build.
@fanoush did you find another way to set UICR register values from Espruino? I see that
require("Flash").write(0,0x1000120c)
doesn't work.Are these modules you've got from the Espruino shop, or are you programming your own? If you'd programmed your own it should be pretty easy to do a build yourself, otherwise I can get one sorted for you.