-
-
Yep, It build quite fine for every Espruino board, and yes I always use make clean first. I think I found the problem, basically in the board file i was using the function:
def get_pins():
contained the pin array as
pins = []
I changed it as i found in the nrf52840dk.py
pins = pinutils.generate_pins(0,47)
Now everything builds correctly but I'm not sure what I did is correct
-
Well I only would like to have the usb as a serial device and the standard espruino bootloader to use nrf connect on my smartphone. I tried to compile with the latest espruino repo and I got this error:
Generating platform configs Generating pin info Generating JS wrappers WRAPPERSOURCES = src/jswrap_array.c src/jswrap_arraybuffer.c src/jswrap_dataview.c src/jswrap_date.c src/jswrap_error.c src/jswrap_espruino.c src/jswrap_flash.c src/jswrap_functions.c src/jswrap_interactive.c src/jswrap_io.c src/jswrap_json.c src/jswrap_modules.c src/jswrap_pin.c src/jswrap_number.c src/jswrap_object.c src/jswrap_onewire.c src/jswrap_pipe.c src/jswrap_process.c src/jswrap_promise.c src/jswrap_regexp.c src/jswrap_serial.c src/jswrap_storage.c src/jswrap_spi_i2c.c src/jswrap_stream.c src/jswrap_string.c src/jswrap_waveform.c libs/compression/jswrap_heatshrink.c libs/math/jswrap_math.c libs/graphics/jswrap_graphics.c libs/network/jswrap_net.c libs/network/http/jswrap_http.c libs/network/js/jswrap_jsnetwork.c libs/bluetooth/jswrap_bluetooth.c libs/neopixel/jswrap_neopixel.c Generating pin info make: *** [Makefile:776: gen/platform_config.h] Error 1 make: *** Waiting for unfinished jobs.... DEFINES = -DGIT_COMMIT=4e25e2211 -DNO_ASSERT -DRELEASE -DBUILDNUMBER="5" -DNRFMDK -DCONFIG_GPIO_AS_PINRESET -DBOARD_PCA10059 -DNRF_USB=1 -DUSB -DPIN_NAMES_DIRECT=1 -DUSE_DEBUGGER -DUSE_TAB_COMPLETE -DUSE_HEATSHRINK -DUSE_MATH -DUSE_GRAPHICS -DUSE_NET -DUSE_NETWORK_JS -DBLUETOOTH -DUSE_NEOPIXEL -DS140 -DNRF_SD_BLE_API_VERSION=6 -D__HEAP_SIZE=0 -DBLE_STACK_SUPPORT_REQD -DSWI_DISABLE0 -DSOFTDEVICE_PRESENT -DFLOAT_ABI_HARD -DNRF52_SERIES -DNRF52840_XXAA -DNRF52840 -DNRF5X -DNRF5X_SDK_15 -DUSE_APP_CONFIG -DARM -DLINK_TIME_OPTIMISATION -DEMBEDDED
-
-
Hello @fanoush, nice to read you again, I was able to find the schematic of the dongle I have. From waht I can see it is really simple just a nRF52840 chip a voltage regulator and a classic rgb led. You'll find the schematic below. no external flash is present by the way
-
-
A quick update, as suggested by @fanoush I logged a bit more code and here is the result:
this is the isCharging() function:bool jswrap_uwatch_isCharging() { [#ifdef](https://forum.espruino.com/search/?q=%23ifdef) BAT_PIN_CHARGING jsiConsolePrintf("*-> isCharging Debug: \n"); jsiConsolePrintf("*-> PIN: %d\n",BAT_PIN_CHARGING); jsiConsolePrintf("*-> ReadPin %d\n",jshPinGetValue(BAT_PIN_CHARGING)); jsiConsolePrintf("*-> DBG PIN Valid %d\n",jshIsPinValid(BAT_PIN_CHARGING)); jsiConsolePrintf("*-> DBG PIN Nrf %d\n",nrf_gpio_pin_read(BAT_PIN_CHARGING)); return jshPinGetValue(BAT_PIN_CHARGING); [#else](https://forum.espruino.com/search/?q=%23else) return 0; [#endif](https://forum.espruino.com/search/?q=%23endif) }
and here is the output:
>Uwatch.isCharging() *-> isCharging Debug: *-> PIN: 19 *-> ReadPin 1 *-> DBG PIN Valid 1 *-> DBG PIN Nrf 0 =true >Uwatch.isCharging() *-> isCharging Debug: *-> PIN: 19 *-> ReadPin 1 *-> DBG PIN Valid 1 *-> DBG PIN Nrf 0 =true
so from waht I can see the nrf_gpio_pin_read() is not working basically all the analog pins were added back to the board file by the way.
-
Hello @Gordon, nice to read you again, yes my first idea was to use the latest version of espruino because it is the most logical thing to do, but I'm new to espruino and I though that this was too difficult for me, thanks to the precious help provided by @fanoush I feel a bit more confident now so I will give a try with the latest version of espruino
-
Hi all,
I'm working on the Uwatch 2 from umidigi and thanks to @fanoush and @Gordon I was able to have espruino running on it, version is 2v05.29 and I started from this github repo https://github.com/kabbi/espruino-uwatch . I'm facing some issues regarding the battery operations. The first one is the about the isCharging() basically it does not detect the pin change from low to high when I plug the charging plug, thanks to @fanoush suggestion I added some printf to understand what happen when isCharging() is called from javascript as you can see below:bool jswrap_uwatch_isCharging() { [#ifdef](https://forum.espruino.com/search/?q=%23ifdef) BAT_PIN_CHARGING jsiConsolePrintf("*-> isCharging Debug: \n"); jsiConsolePrintf("*-> PIN: %d\n",BAT_PIN_CHARGING); jsiConsolePrintf("*-> ReadPin %d\n",jshPinGetValue(BAT_PIN_CHARGING)); return jshPinGetValue(BAT_PIN_CHARGING); [#else](https://forum.espruino.com/search/?q=%23else) return 0; [#endif](https://forum.espruino.com/search/?q=%23endif) }
and this is the output in the espruino ide when I now call Uwatch.isCharging()
>Uwatch.isCharging() *-> isCharging Debug: *-> PIN: 19 *-> ReadPin 0 =false
The pin is defined correctly as BAT_PIN_CHARGING but it is not reading the change. Strange thing is that if I use instead digitalRead(19) I can see the pin change when I plug / unplug the charger cable. I would like to fix this if is possible in some way.
The second issue is about the getBattery() function, it included in the UWATCH.py and is present in the jswrap_uwatch.c but is not available in the interpreter itself if I try to call it in the IDE by doing E.
I hope the informations are detailed enought
Any help will be very appreciated
-
Hello, after the use of nrf52 recover everything went well, as you can see in the picture below. jlink is a piece of cake to use on those watches I was considering documenting the procesess on my github so people can do things more easily. I uploaded even some apps in the watch and everything went fine. Thanks a lot for the help !!
-
Hello guys, I'm playing with the build of Espruino for my brand new bangle js watch, let's assume I would like to add a variable or a welcome message between the mac addr. and the Espruino Copyright printout on the bootscreen logo where should I look in the source code ? It is something doable ?
Thanks to everyone will join
-
-
Hi, a bit of progress has been made, after the soldering of bigger battery the device turned back on, as @fanoush suggested I started the hr measure and connected the pcb to my sagger jlink edu mini with openocd now I can connect to the device:
Open On-Chip Debugger 0.11.0 (2021-07-29) [https://github.com/sysprogs/openocd] Licensed under GNU GPL v2 libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3 For bug reports, read http://openocd.org/doc/doxygen/bugs.html swd Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections Info : J-Link EDU Mini V1 compiled Sep 24 2021 16:44:11 Info : Hardware version: 1.00 Info : VTarget = 1.584 V Info : clock speed 1000 kHz Info : SWD DPIDR 0x2ba01477 Error: Could not find MEM-AP to control the core ****** WARNING ****** nRF52 device has AP lock engaged (see UICR APPROTECT register). Debug access is denied. Use 'nrf52_recover' to erase and unlock the device. Warn : target nrf52.cpu examination failed Info : starting gdb server for nrf52.cpu on 3333 Info : Listening on port 3333 for gdb connections
now, should I use the nrf52_recover command as openocd suggested ? Or I should try directly to flash the device with Espruino firmware ?
P.S. The sagger j-link is much more capable that the st-link clone by the way even if the problem I had yesterday was a very low battery on the watch I will try again the stlink tomorrow
-
Ok, so I've opened the case of the st-link and labels on the pcb match the one on the case, I also tried to swap the swdio and swclk with vdd disconnected of course but as soon as i entered the openocd command the lcd screen went off and it is not turning on anymore, maybe i need to disconnect the battery from the pcb and attach it again, I also found a j-link edu mini debugger i will also try this one. It will be good to know it is mandatory to do some sort of unlock of the mcu before I can actually use the swd port to reprogram it. Anyway @fanoush thank you so much for your time !!
-
-
Hello Guys, I've also tried with openocd v11 on windows but it is not working, this is the error I'm having:
Open On-Chip Debugger 0.11.0 (2021-03-07-12:52) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html WARNING: interface/stlink-v2.cfg is deprecated, please switch to interface/stlink.cfg Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'. Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD nRF52 device has a CTRL-AP dedicated to recover the device from AP lock. A high level adapter (like a ST-Link) you are currently using cannot access the CTRL-AP so 'nrf52_recover' command will not work. Do not enable UICR APPROTECT. Info : clock speed 1000 kHz Info : STLINK V2J34S7 (API v2) VID:PID 0483:3748 Info : Target voltage: 3.151546 Warn : target nrf52.cpu examination failed Error: jtag status contains invalid mode value - communication failure Polling target nrf52.cpu failed, trying to reexamine Examination failed, GDB will be halted. Polling again in 100ms Info : Previous state query failed, trying to reconnect Error: jtag status contains invalid mode value - communication failure Polling target nrf52.cpu failed, trying to reexamine Examination failed, GDB will be halted. Polling again in 300ms Info : starting gdb server for nrf52.cpu on 3333 Info : Listening on port 3333 for gdb connections Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections Info : Previous state query failed, trying to reconnect Error: jtag status contains invalid mode value - communication failure Polling target nrf52.cpu failed, trying to reexamine Examination failed, GDB will be halted. Polling again in 700ms Info : Previous state query failed, trying to reconnect Error: jtag status contains invalid mode value - communication failure
I'm using a stlink v2 clone by the way
P.S. I tried even with stlink.cfg as interface, the result is the same, consider that the VDD pad on pcb is connected to the 3.3v on the adapter
-
Hello @HughB actually it is the opposite, is the BangleJS that is based on the DTNO.I NO.1 F18 the main mcu is NRF52832QFAA thats why it is possible to flash it with Espruino. @Gordon I found something that maybe could work for flashing but i'm not sure:
sudo openocd -f interface/stlink.cfg -f tcl/target/nrf52.cfg -c "init" -c "program espruino/firmware.hex" verify reset exit"
I do not know if I'm supposed to do something before flashing
-
Hello guys, I received 2 very particular gifts, gift number one is a Bangle JS and gift number two is an unbranded F18 smartwatch, fortunately they are different colors. I really really really love the bangle js an I started reading this forum a lot, I've done a bit of homework and thanks to the suggestions found on this post I have a compiled espruino firmware, I would like to flash it on the other F18 smartwatch on which I already soldered the swd connections. Right now I have firmware hex file, the stlink clone adapter and openocd installed on the machine. What should I do to flash the watch ? It is possible to have all the commands needed for the flashing ? I really would like to put Espruino even on this F18. Thank you everyone !
A bit late but here I am, below you'll find the board file I did and a pre compiled hex (to be used with st-link / j-link ) for flashing. Everything works really well, the only thing I haven't done yet is to decide what to do with the BTN1 device because right now it is connected to the reset pin of the nRF