DuncanCragg
Member since Nov 2019 • Last active Mar 2020Most recent activity
-
Hi @billsalt,
I'm afraid I ended up using direct wired flashing to the SWD pads rather than the much nicer built-in UF2 system ("dropping a file on a disk"), but I don't know if that would've worked had I not been so impatient! The
uf2conv.py
tool is needed to convert hex to uf2.I had to unlock the chip anyway, I think, with a CMSIS-DAP flasher on the SWD pads. I say "I think" because I do this kind of thing a lot and may have got mixed up with another device :-) I can give you those steps if you like.
I went with the above config file, modified according to the bit where I said it worked.
I'm not sure how much you know about all this building/flashing business, to know how to pitch my response! Let me know if I'm talking gobbledegook or baby talk so I know where I am!
-
We've done it!! I used a mixture of values again, yours and the one from the Nordic dongle:
'saved_code' : { 'address' : ((223 - 10) * 4096), 'page_size' : 4096, 'pages' : 10, 'flash_available' : 1024 - ((38 + 8 + 2 + 10)*4) },
Thanks for all that info, not that I really understand what we did or how it worked, mind you!
-
Oh I didn't see that response; I was typing mine!
So the numbers still have to be set right even when you SWD it I presume.
My
address
andflash_available
numbers were just grabbed from elsewhere, not calculated, plus I put a random extra bit on for luck (!), so I could use some help calculating them correctly! :-D -
-
Wow thanks fanoush, that's all really helpful .. although I don't fully understand all of it! Hopefully I haven't wiped the existing softdevice! Let me try just with the app hex then.. I don't know which SD they're on, but I guess 140.
make sure the binary and saved_code espruino configuration section fits below 0xF4000
not sure how I'd ensure that, what do I put in the board config and how do I work that out?
-
-
-
Hi, just got an Adafruit Clue a couple of weeks ago (first batch I think) and I'm trying to port Espruino to it (obvs).
But I'm running out of ideas how to get it going - all I want to get running at first is a Bluetooth connection to the web IDE to test that JS works OK, I don't care about pins and peripherals yet.
Hence here's my super-cut-down board file:
import pinutils; info = { 'name' : "Adafruit Clue", 'link' : [ "https://www.adafruit.com/clue" ], 'default_console' : "EV_BLUETOOTH", 'variables' : 2100, 'bootloader' : 1, 'binary_name' : 'espruino_%v_cluejs.hex', 'build' : { 'optimizeflags' : '-Os', 'libraries' : [ 'BLUETOOTH', ], 'makefile' : [ 'DEFINES+=-DCONFIG_GPIO_AS_PINRESET', 'DEFINES+=-DBLUETOOTH_NAME_PREFIX=\'"CluÂe"\'', 'NRF_SDK15=1' ] } }; chip = { 'part' : "NRF52840", 'family' : "NRF52", 'package' : "QFN48", 'ram' : 256, 'flash' : 1024, 'speed' : 64, 'usart' : 2, 'spi' : 3, 'i2c' : 2, 'adc' : 1, 'dac' : 0, 'saved_code' : { 'address' : ((270 - 10) * 4096), 'page_size' : 4096, 'pages' : 10, 'flash_available' : 1024 - ((31 + 30 + 2 + 10)*4) }, }; devices = { 'BTN1' : { 'pin' : 'D5', 'pinstate' : 'IN_PULLDOWN' }, }; board = { 'left' : [], 'right' : [], '_notes' : { } }; board["_css"] = """ """; def get_pins(): pins = [ { "name":"PD5", "sortingname":"D05", "port":"D", "num":"17", "functions":{}, "csv":{} }, ]; return pins
I nicked bits of it from the Nordic dongle suggestions on this forum (I did get the dongle working OK, so the SDK 15 stuff is fine for me). I set the JS code address up a bit in case that needs to be clear of stuff below, but I have to admit I don't know what to put there!
I build with:
make clean; rm *hex *.elf BOARD=CLUEJS RELEASE=1 make
..not DFU I don't think, cos they use uf2 for the Clue - so I flash with:
[..]/uf2/utils/uf2conv.py -f 0xada52840 --convert espruino_2v04.399_cluejs.hex cp flash.uf2 /media/duncan/FTHR840BOOT/
which is getting set into the device OK, but I can't see the Clue Bluetooth device in the IDE.
Any ideas?
Hoping to build on and/or learn from the amazing Espruino software and hardware for my own programming language project. :-)