-
-
-
I think you can just define it and it will work but I'm not sure (will need to read the sources that expand the json into def configuration). I might be able to get some time to experiment with this later this week (but not with the amiibo since it's a bit difficult to flash that one, the xiao ble has a usb bootloader that makes flashing. abit easier since I can just drag the hex file into the pseudo-filesystem).
-
Sure, here you go.
There's this grey thick sticker (maybe insulation rf shield?) behind the battery which could be where the nfc antenna are?).
Not sure about the LEDs; I've looped through all the 32 pins and they are the only ones that light up. It's possible it's RGB but the LED module itself (near the top of the first picture) has four traces; two beside each other (which are likely the D17 and D20 pins) one going to a via and one going to what are probably resistors.
-
What I did find work well is this one: http://www.radioland-china.com/1730323-1730323_2575611.html
Bought a few of these on AliExpress a couple of years ago (before the chip shortage): https://www.aliexpress.com/item/32965114958.html
Someone wrote custom firmware for this beacon (not Espruino): https://github.com/an-erd/ble_beacon
-
-
Found some interesting links while looking for amiibo related stuff :P
https://www.omniibo.com/
https://dantheman827.github.io/ntag215-puck.js/Nice work!
-
I just got myself one of these. Cute litlle things :P
I've initially flashed the nrf52832DK image and have been trying to get the pin assignments.
It's been only a few minutes and I've only so far found that D17 is the green LED, and D20 is the red LED. The button is at D13. and the buzzer is at D14
For board definitions I think just pasting them in the forum is fine (at least that's what I do, and where I look for others' board defs as well).
-
As fanoush mentioned, you definitely can. Being able to reprogram the watch was one of the reasons I bacled the kickstarter, because the watch is opened up to all kinds of firmware without having to sacrifice waterproofness. I've tried it as well (had a female usb connector soldered onto some protoboard and broke out the pins to a j-link adapter)
@fanoush I wonder if the usb/swd cable can be used for installing the DFU and maybe factory reset the watch? Or maybe even run a small diagnostic that gathers data on the watch as well as some data on the responsiveness of the peripherals. Might help with troubleshooting in the future.
-
For what it's worth, I just flashed the AT firmware to a Wemos D1 Mini (esp 8266) and used the example program at https://www.espruino.com/arduino-esp8266 to a Pixl.js
The example GET request works. I like the Pixl.js because it's quite fast to prototype and experiment with, so if I need a quick test that's usually what I first reach out to.
I've attached a quick pic of my Pixl.js with a diy breadboard + li-ion battery/charger with the Wemos D1 Mini in the breadboard and some jumper wires.
Do you know which temp sensor you're planning to wire up?
-
I'm guessing you can use the Pixl.js with this shield: https://www.espruino.com/arduino-w5100
I personally use a DS18b20 for monitoring the temperature of a water heater.
Maybe https://www.espruino.com/WiFi+Enabled+Thermometer might give you an idea? (You'll need to mix an match peripherals though; I think the CC3000 module mentioned there is depcrecated in favor of an esp8266 with AT firmware if using wifi, or no need for wifi if you're using the ethernet shield)
There's a shield for the esp8266 as well https://www.espruino.com/arduino-esp8266
-
I've had mine for a couple of years now and I've never had it freeze. Then again I'm only really using simple apps, like the simple v-clock https://banglejs.com/apps/?id=svclock
-
-
I got this sometime ago when I was checking out the nRF52840, and since I was already doing a board def for the xiao ble I though I might as well do this one too :P
https://www.waveshare.com/wiki/NRF52840_Eval_Kit
I've started using the adafruit bootloaders https://github.com/adafruit/Adafruit_nRF52_Bootloader for the nrf52840 boards that have usb on them, so I only ever have to use SWD once and then just use usb upload to flash new firmware updates.
(attaching the board def and the uf2 since the board def is quite long)
-
I've experimented a bit more and yeah, the extra H port is messing up some of the pins that Espruino expects are contiguous.
I"ve since made a board def that's a lot simpler.
#!/bin/false # This file is part of Espruino, a JavaScript interpreter for Microcontrollers # # Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk> # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # ---------------------------------------------------------------------------------------- # This file contains information for a specific board - the available pins, and where LEDs, # Buttons, and other in-built peripherals are. It is used to build documentation as well # as various source and header files for Espruino. # ---------------------------------------------------------------------------------------- """ source ./scripts/provision.sh ALL rm bin/*.hex make clean && BOARD=XIAOBLE RELEASE=1 make uf2conv.py ./bin/*.hex -c -f 0xADA52840 mv flash.uf2 ~/Desktop/ """ import pinutils info = { "name": "Seeed Xiao BLE", "link": ["https://www.seeedstudio.com/Seeed-XIAO-BLE-nRF52840-p-5201.html"], "default_console": "EV_USBSERIAL", # 'default_console' : "EV_SERIAL1", # 'default_console_tx' : "D6", # 'default_console_rx' : "D7", # 'default_console_baudrate' : "9600", "variables": 14000, # How many variables are allocated for Espruino to use. RAM will be overflowed if this number is too high and code won't compile. # 'bootloader' : 1, "binary_name": "espruino_%v_xiaoble.hex", "build": { "optimizeflags": "-Os", "libraries": [ "BLUETOOTH", # 'NET', "GRAPHICS", # 'NFC', "NEOPIXEL", "JIT", ], "makefile": [ "DEFINES += -DESPR_LSE_ENABLE", # Ensure low speed external osc enabled "DEFINES += -DCONFIG_GPIO_AS_PINRESET", # Allow the reset pin to work "DEFINES += -DNRF_USB=1 -DUSB", "DEFINES += -DNEOPIXEL_SCK_PIN=33 -DNEOPIXEL_LRCK_PIN=34", # nRF52840 needs LRCK pin defined for neopixel "DEFINES += -DBLUETOOTH_NAME_PREFIX='\"XIAOBLE\"'", "DEFINES += -DSPIFLASH_READ2X", # Read SPI flash at 2x speed using MISO and MOSI for IO "DEFINES += -DESPR_UNICODE_SUPPORT=1", "DEFINES += -DNRF_SDH_BLE_GATT_MAX_MTU_SIZE=131", # 23+x*27 rule as per https://devzone.nordicsemi.com/f/nordic-q-a/44825/ios-mtu-size-why-only-185-bytes # 'DEFINES += -DPIN_NAMES_DIRECT=1', # Package skips out some pins, so we can't assume each port starts from 0 "LDFLAGS += -Xlinker --defsym=LD_APP_RAM_BASE=0x2ec0", # set RAM base to match MTU "NRF_SDK15=1", ], }, } chip = { "part": "NRF52840", "family": "NRF52", "package": "AQFN73", "ram": 256, "flash": 1024, "speed": 64, "usart": 1, "spi": 1, "i2c": 2, "adc": 1, "dac": 0, "saved_code": { "address": ((0xF4 - 2 - 96) * 4096), # Bootloader at 0xF4000 "page_size": 4096, "pages": 96, "flash_available": 1024 - ( (0x26 + 0x20 + 2 + 96) * 4 ), # Softdevice 140 uses 38 pages of flash, bootloader 8, FS 2, code 10. Each page is 4 kb. }, } devices = { "LED1": {"pin": "D26"}, # Pin negated in software "LED2": {"pin": "D30"}, # Pin negated in software "LED3": {"pin": "D6"}, # Pin negated in software # Pin D33 and D34 are used for clock when driving neopixels - as not specifying a pin seems to break things "BAT": { "pin_charging": "D17", # active low "pin_voltage": "D31", }, "NFC": {"pin_a": "D9", "pin_b": "D10"}, "SPIFLASH": { "pin_cs": "D25", "pin_sck": "D21", "pin_mosi": "D20", "pin_miso": "D24", "pin_wp": "D22", "pin_rst": "D23", "size": 4096 * 512, # 2MB "memmap_base": 0x60000000, # map into the address space (in software) }, } # left-right, or top-bottom order board = {} # schematic at https://files.seeedstudio.com/wiki/XIAO-BLE/Seeed-Studio-XIAO-nRF52840-Sense-v1.1.pdf # pinout sheet https://files.seeedstudio.com/wiki/XIAO-BLE/XIAO-nRF52840-pinout_sheet.xlsx # see also https://github.com/Seeed-Studio/Adafruit_nRF52_Arduino/blob/master/variants/Seeed_XIAO_nRF52840/variant.h def get_pins(): pins = pinutils.generate_pins(0, 47) # 48 General Purpose I/O Pins. pinutils.findpin(pins, "PD2", True)["functions"]["ADC1_IN0"] = 0 pinutils.findpin(pins, "PD3", True)["functions"]["ADC1_IN1"] = 0 pinutils.findpin(pins, "PD4", True)["functions"]["ADC1_IN2"] = 0 pinutils.findpin(pins, "PD5", True)["functions"]["ADC1_IN3"] = 0 pinutils.findpin(pins, "PD9", True)["functions"]["NFC1"] = 0 pinutils.findpin(pins, "PD10", True)["functions"]["NFC2"] = 0 pinutils.findpin(pins, "PD17", True)["functions"]["NEGATED"] = 0 pinutils.findpin(pins, "PD26", True)["functions"]["NEGATED"]=0; pinutils.findpin(pins, "PD28", True)["functions"]["ADC1_IN4"] = 0 pinutils.findpin(pins, "PD29", True)["functions"]["ADC1_IN5"] = 0 pinutils.findpin(pins, "PD31", True)["functions"]["ADC1_IN7"] = 0 # D13 PIN_CHARGING_CURRENT # battery charging current see https://wiki.seeedstudio.com/XIAO_BLE/#battery-charging-current # HIGH: 100mA, LOW: 50mA # D14 VBAT_ENABLE # enable battery voltage reading by digitalWrite(D14, false) # D17 CHG # get charge state via digitalRead(D17) # HIGHT: not charging, LOW: charging # D31 PIN_VBAT # everything is non-5v tolerant for pin in pins: pin["functions"]["3.3"] = 0 return pins
-
Ah that's an idea.
Flashing the Pixl.js over SWD is relatively easier (I can just make a jig with pogo pins). It's the MDBT42Q that's a bit of a problem since I prototype code and hw on the Pixl.js and then deploy it on the MDBT42Q :(
I'll let you know anyway if I'm able to make progress on the SDK15 for the Pixl.js :)
-
I've only tried out USB; there's an OTA option which requires doing some button gymnastics but I haven't tried that out (the xiao ble only has the reset button).
Yeah, they are using that adafruit bootloader (their instructions for flashing the bootloader in case you "brick" the device mention it).
For me though, I would rather have fw updates over BLE rather than over USB because I don't need to be plugging in a USB cable in order to do fw updates (just need a way to hold down BTN1 which I can easily solder some external switch to).
Many of my Espruinos are already connected to circuits that are quite inconvenient to reach with a USB cable (not to mention a computer) so having fw updates only through USB is a nogo.
I'm only appreciating the speed of fw updates over USB because I'm compiling and recompiling fw many times; but once I have a fw I'm happy with, the next fw update would be weeks from then.
If we can do both BLE and USB that would be great :P
In any case, I just tried with another nRF52840 I have (the Waveshare Eval Kit) and I can again connect without issues to the custom Espruino build there, so that's 3 for the 52840. I don't know if I can use SDK12 on the 52840's (the docs mention experimental support) but if I have time I'll try it out.
-
Yeah, I just updated this banglejs2 using the App Loader. It's running Simple Clock and the vectorized Simple Clock.
update: I've recompiled the custom firmware for the xiao ble (uf2 builds are really convenient since I don't nede to hunt for my jlink, just a USB and double tap the reset button; if ever we get a pixl.js 2 with the nrf52840 I hope there would be something similar :P) with the lines you've mentioned
'DEFINES += -DNRF_SDH_BLE_GATT_MAX_MTU_SIZE=131', # 23+x*27 rule as per https://devzone.nordicsemi.com/f/nordic-q-a/44825/ios-mtu-size-why-only-185-bytes 'LDFLAGS += -Xlinker --defsym=LD_APP_RAM_BASE=0x2ec0', # set RAM base to match MTU
and I'm still able to paste in long char sequences. Checking again with the pixl/mdbt42q i get disconnected as soon as I try to paste the same sequence.
-
-
Yep, confirmed with the banglejs2 (running 2v18) that copy and pasting long seuqences of characters don't disconnect me.
This is what I was copying and pasting:
const state = { led: true, curTemp: 0, prevTemp: 0, setTemp: 0, offset: 53, isRelayOn: false, isRunning: false, dirty: false, };
doing the same for the mdbt42q (running 2v18) disconnects (and doesn't even show anything on the screen.
-
Do you not manage to get any output at all when using your transmitter?
No, none at all unfortunately :( With all the buttons and trying to press it over and over.
I only ever get one message though, and I'm not able to get another response from the remote. Yeah it's still running; If I'm connected via ble terminal I can still inspect some variables (like the count example above) -
What's the Xiao BLE running?
It's running a custom compilied Espruino here: https://forum.espruino.com/comments/17034513/
it's on the nrf52840
I've found my charger and charging up the banglejs 2 and will confirm with you if my Mediatek performs properly without having to throttle.
-
Quick update: I was able to connect with the Mediatek BT on the Seeed Xiao BLE (and possible the Bangle.js 2 which I'll have to hunt for) without having to throttle send.
I thought something got fixed since there was a windows update and I had to reboot, but unfortunately the Pixl.js still had the same issues (disconnecting when sending code).
So it seems my BT adapter is fine with nrf52840 but not with nrf52832? I'll try again when I find my Bangle.js 2 charger :P
-
Ah I didn't know that was the case :D I thought H was just a way to differentiate unexposed pins (vs D which are exposed).
They do work though, and I guess it's somewhat an advantage that a user doesn't get to accidentally configure a pin that they're not supposed to change (like those for QSPI for example). Or would there be any issues with using non-existent ports?
Ah! No wonder I thought the battery went flat so fast. Thanks for the piezo hint (I tried playing a beep when the button was pressed but I reset the pin after the button is depressed).