-
@fanoush The answer was: I fried something. I reflashed original FW and UICR and can see the HR lights activate to verify it's running (the screen was damaged while opening), but still no signal on nrfConnect.
Update: I have a 2nd one.. just flashed that with the Espruino build, and it's perfect. So, issue resolved.
-
i'll fix the linker setting just to make sure, thank you. But yes I've tried working builds from other devices (just differnt BTN1) and they don't work either. I did a mass erase first, and from OpenOCD, everything looks perfect.
I can try it without bootload, just flash app hex too.Thanks for the advice!
-
I have flashed many fitness trackers with an NRF52832 with a generic Espruino build with great success, but my last attempt is not working. I use OpenOCD to flash, and it seems to work just fine, flash, verify, reset, run (which I've done many times with other boards). But when I reset run, it's not advertising on BT. My board file does have that set as default console. I even tried flashing other builds for working devices (with other pins defined for BTN1) but no BT console. I know Espruino is running, as one firmware I flashed had defined D9 as input_pullup, which happens to be this new boards motor pin and it started humming right after reset. This is a fitness tracker from 2020, not available any more, but similar to the F07 and B5 which have working firmware available (thanks to @fanoush).
The only difference I can see is that this seems to have a ceramic antenna, unlike the standard copper wire most others have.
any thoughts or ideas appreciated!
-
Thanks for checking on that. I did untar the file and I'm getting the same build errors. If I get a chance tonight I'll see if #ifdef-ing areas appropriately gets a working build (I'll try it out on a 52832 DK) and report back
-
I'm putting Espruino on an older sports band which uses SDK11. I have a board file which indicates "NRF_SDK11=1" and have done a scripts/provision.sh with the board. The build stops immediately saying
No rule to make target 'targetslib/nrf5x_11/components/toolchain/gcc/gcc_startup_nrf52.o', needed by 'bin/espruino_2v18.69_ID130.elf'. Stop.
Sure enough, there is no targetlibs/nrf5x_11 directory; there is nrf5x, nrf5x_12, nrf5x_14. Is this the Nordic SDK11? Do I need to install that? -
Makes sense, and it does seem like I patched my branch and somehow forgot about it (getting more common these days)... Nice to hear from you @jeffmer! hope all's well...
-
-
I see a lot of @jeffmer 's code which allows sharing of SPI clock and data has made it into lcd_spi_unbuf. However, when I try to compile using SPIFLASH_SHARED_SPI, I get this error:
libs/graphics/lcd_spi_unbuf.c: In function 'set_cs': libs/graphics/lcd_spi_unbuf.c:63:5: error: implicit declaration of function 'jshSPIEnable' [-Werror=implicit-function-declaration] jshSPIEnable(_device,true); ^
and when reading this message from jeffmer it looks like that function is not in targets/nrf5x/jshardware.c in the main branch. I'll try to add it from his repo, but curious if it is actually somewhere else? Has anyone used this feature in the main branch?
-
-
It's hard to read all this and not jump to Bangle's defense. It does seem like your experience is not ideal, and that must be disappointing. But I don't believe the BangleJS line were meant to replace Pebbles at all. It is first and foremost a programmable microcontroller you can wear. The fact that it has evolved an ecosystem that can be compared to Pebble's is quite impressive. To fault it for not achieving Pebble's equal seems unfair to me.
The battery issue is concerning, and maybe others are having similar issues, but mine lasts over a week (admittedly with modest use). As for the button, I've read about a few having issues, yes. Gordon has worked with folks to fix or replace those.
For me it's rekindled a desire to create simple software, experiment with rudimentary UI and learn a ton about microcontrollers and their capabilities (and their limitations).
I believe that is more of its intended use.
-
-
You can never brick a Bangle2. It's an involved process though, you'll need a special USB connector (USB Female on one end, exposed 4 wires on the other) and connect the 4 wires to an SWD-capable dongle or device (like an ST-Link or Raspberry pi).
I would do as fanoush suggests: see if you can use nrfConnect on an android device or from a PC first.
-
and yes, my thought was sunset Bangle 1, and use this as Bangle 3 (only supporting B2 and B3). It's darn impossible to find ONE watch to make everyone happy, with these two you cover a lot of ground.
BTW: the TK78G has a 405mAh battery inside (likely to accommodate for all the sensors) and 64Mb (8MB) SPI flash. I've mapped quite a few pins so far, but I am not an electrical engineer so I am likely missing some step to get SPI Flash working (like setting, resetting or toggling some pin). I've found 10 pins on the LCD/touch panel connector and am running through those permutations when I can.
-
How did you get the firmware on yours? Did you have to crack it open?
Yes. I've opened several watches now, and this one is not too bad. Hair dryer to heat the screen edges, then a plastic spudge to loosen the screen.
I am open to bringing support for more watches into the main Espruino project if it doesn't mess the code around too much
Some of jeffmer's solutions use a modified spi_lcd_unbuf to accommodate shared SPI between LCD and Flash chip, but that looks like it's only a few #ifdefs to make it happen. He also exposes a function that lets you send init commands to the LCD from Espurino, so custom init sequences don't require custom firmware.
...you can still run apps from the main app store
Mostly you can, obviously with some exceptions for watches that don't have barometer, GPS, etc. but he has a "Bangle" object that honours many functions, and that can be embellished.
-
If the plan is to use an existing watch for a base, I'll just toss in the TK78G: https://www.alibaba.com/trade/search?fsb=y&IndexArea=product_en&CatId=&tab=all&SearchText=tk78g It may be on the way out (it's mostly disappeared from AliExpress) but it has some features that make it an interesting blend of B1 and B2: NRF52840, two physical buttons, GPS, Thermometer (external), heart rate sensor, accelerometer, touch screen and a nice 1.6" screen. I have it running Espruino right now (in the process of RE the screen and sensors). It may not replace the B2's always-on display, but it may be a replacement for B1?
-
Thanks, Gordon. I rebuilt with that, and erased the flash (.eraseAll()) and it seems to work better, but it still seems to choke on larger files (5k or so). A file that works when sent to RAM will throw an error like:
Uncaught ReferenceError: "retur" is not defined at line 1 col 1036 ... ^ in function "connect" called from line 1 col 410 ... ^ in function "GC9A01" called from line 1 col 29 GC9A01(D25, D3, D2, D18, D26); ^ >
as if the keyword "return" were incomplete; but as I said, it IS complete, and works when sent to RAM.
After this point, trying to list files shows an empty list; but if I "reset()", the file list is restored.It's like it goes to sleep and can't wake up at some point! Insomniac flash.
-
Hey all, I've put Espruino on a smartwatch (SN80-Y from Yfit) and have figured out most of the pins and components (lcd, accel, touch) but am having trouble getting the XTX XT25F32B (4MB flash) chip to be reliable. Verified the following pins using multimeter: CS=D19, SO=D18, SI=D17, CLK=D20. Doing a wakeup, followed by getting vendor ID and capacity seems fine:
> spif = new SPI(); =SPI: { } > spif.setup({sck: CLK, miso: SO, mosi: SI, mode:0, baud: 8000000}); =undefined > spif.send([0xab], CS); =new Uint8Array([255]) > print(spif.send([0x90,0,0,1,0,0], CS)); new Uint8Array([255, 255, 255, 255, 21, 11]) =undefined > print(spif.send([0x9f,0,0,0], CS)); new Uint8Array([254, 11, 64, 22]) =undefined
That seems fine:22 at the end should mean 2^22 bits, or 4MB. So i've included it in my board file. In the devices section I have:
'SPIFLASH' : { 'pin_sck' : 'D20', 'pin_mosi' : 'D17', 'pin_miso' : 'D18', 'pin_cs' : 'D19', 'size' : 4096*1024, # 4MB 'memmap_base' : 0x60000000 # map into the address space (in software) }
And when flashed I see:
>require("Storage").getFree() =4194304
I then use this test script just to read the first few blocks of 256 bytes:
CS=D19, SO=D18; SI=D17; CLK=D20; setTimeout(()=>{ spif = new SPI(); spif.setup({sck: CLK, miso: SO, mosi: SI, mode:0, baud: 8000000}); spif.send([0xab], CS); print(spif.send([0x90,0,0,1,0,0], CS)); print(spif.send([0x9f,0,0,0], CS)); let hex = (d) => { return ('0'+d.toString(16)).slice(-2);}; let buf = new Uint8Array(256); // 3 byte address: 0x7f 0xff 0xff (0x7f = 8MB, 0x3f = 4MB, 0x1f = 2MB) for(let b1=0; b1 < 1; b1++) { for(let b2=0; b2 < 5; b2++) { let bufstr = ''; for(let b3 = 0; b3 < 256; b3++) { res = spif.send([0x03, b1, b2, b3, 0], CS); buf[b3] = res[4]; bufstr += ("0"+buf[b3].toString(16)).slice(-2)+" "; } print(`${hex(b1)} ${hex(b2)} ${hex(b3)}: ${bufstr}`); //${btoa(buf)}`); } } }, 1000);
The timeout was added because I was running into issues without it. This seems to work if I save it to RAM, as I get data (remnants from previous attempts to write):
new Uint8Array([255, 255, 255, 255, 21, 11]) new Uint8Array([254, 11, 64, 22]) 00 00 00: 04 04 00 00 54 45 53 54 ... 00 01 00: 64 65 65 70 20 73 6c 65 ... 00 02 00: 4c 4b 7d 20 20 41 42 3d ... 00 03 00: 70 69 66 2e 73 65 6e 64 ...
In the first line you can see the ASCII for "TEST" which was the name of the file I attempted to write in the IDE.
So the problem is when I try to save the test code to Storage (or Flash):| __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |____|___| _|_| |___|_|_|_|___| |_| espruino.com 2v12.925 (c) 2021 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate > FW addr 0x00000000 fail Status 0 Uncaught Error: File already written with different data at line 1 col 1106 ...{\n for(let b2=0",0,1349); ^ Uncaught Error: Too much data for file size at line 2 col 380 ... }\n }\n}, 1000);",1024); ^ ____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |____|___| _|_| |___|_|_|_|___| |_| espruino.com 2v12.925 (c) 2021 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate new Uint8Array([112, 105, 102, 46, 115, 101]) new Uint8Array([32, 104, 101, 120]) Uncaught SyntaxError: Unexpected end of Input at line 42 col 18 in TEST for(let b3 = ^ >
The other notable thing is that the CLK and SI lines are shared with the LCD (also SPI) and the accelerometer (I2C). However, I have not initialized either of those. In other tests, LCD works fine as does the accel, but I'm trying to leave out any issues with line sharing.
Any pointers greatly appreciated!
-
-
@fanoush figured out the issue. The display driver uses D9, which is an NFC pin for the nrf52832. Solution was covered in another conversation as a temporary measure, and to compile the firmware with the special tag (
'DEFINES += -DCONFIG_NFCT_PINS_AS_GPIOS',
) to let the NFC tags be treated as normal GPIOs. -
I'm hoping some folks here with more experience can give me some direction here. I have an nrf52832 smartwatch that I have ported Espruino to, and the core runs fine. I used some Espruino tools and a multimeter to figure out what pins are used on the display cable. I verified those by checking the GPIO setup and state while running the original firmware (using openocd to dump 0x50000700 and SPIM2). I believe I have CLK,MOSI,DC,CS,RST correct, and I am 99% sure it's a GC9A01 since my test code lights up both the SN80 and GW32 watches (both GC9A01). But my code does not work on this board. I figured there may be an ENable pin, so i walked through EVERY remaining pin: setting, resetting, pulling up/down before initializing and still get nothing. The backlight is on but I get no other visuals (even on other boards, if you get the pins right you see something: static, blurred pixels...).
My question: is there anything else a GC9A01 (or any small display controller) may need just to fire up? Something like special timings for the RST (right now I'm pulsing it with 50ms in between, then waiting 120ms before initialization).?
Any input or direction would be greatly appreciated... it would be nice to have Espruino fully running on this. Thanks.
-
-
-
-
I've narrowed down a bug to when I use Esprima's Mangle to shorten variable names (other minification options don't generate the error).
I'm seeing an error in the Bangle emulator when I execute this:
// works fine g.clear(); function dothis() { g.clear(); } function test(one, two, three, four, five) { let arrTmp = 0; //new Uint8Array(12); for(let i=0; i<1; i++) {} // fails g.clear(); dothis(); } test();
I'm getting this error:
>Uncaught Error: Function "clear" not found! at line 1 col 23 let a=0;for(let g=0;g<1;g++);g.clear(),dothis() ^ in function "test" called from line 1 col 92 ...(),dothis()}g.clear(),test() ^
You can see that it changed the loop variable to 'g' , which should still be a local variable, but it clearly affects Bangle's 'g'.
However, if you do any one of the following, the error goes away and the Bangle 'g' is fine:
- if you comment out g.clear() and use the "dothis()" function instead
- if you comment out the "let arrTmp" assignment
- if you comment out the empty for loop
- if you reduce the argument list to 4 items
Just thought I'd share; not sure whether this is an Esprima bug, or an interpreter bug (a "let g=" within a for loop should be its own scope and not interfere with global context?)
- if you comment out g.clear() and use the "dothis()" function instead
I'd like to use Web Serial (not Web Bluetooth) for IDE on an NRF52 breakout board.. Here are lines from the board file:
The build works (I still have Bluetooth in the libraries and my test board can connect to the IDE that way). I'm using a CP2102 to connect with TXD going to D7, RXD to D5 (and I've tried it reversed as well). Wiring to D7/D5 is solid. I've set the IDE to use the same baudrate for Serial. When I try to use Web Serial, I get:
Unable to retrieve board information. Connection error?
What am I missing?