-
-
I'm getting these errors during my build:
CC obj/targetlibs/nrf5x_15/components/libraries/atomic/nrf_atomic.o In file included from targetlibs/nrf5x_15/integration/nrfx/legacy/nrf_drv_uart.c:41:0: targetlibs/nrf5x_15/integration/nrfx/legacy/nrf_drv_uart.h:116:13: error: unknown type name 'nrf_uarte_baudrate_t' typedef nrf_uarte_baudrate_t nrf_uart_baudrate_t; ^ targetlibs/nrf5x_15/integration/nrfx/legacy/nrf_drv_uart.h:121:13: error: unknown type name 'nrf_uarte_error_mask_t' typedef nrf_uarte_error_mask_t nrf_uart_error_mask_t; ^ targetlibs/nrf5x_15/integration/nrfx/legacy/nrf_drv_uart.h:124:13: error: unknown type name 'nrf_uarte_hwfc_t' typedef nrf_uarte_hwfc_t nrf_uart_hwfc_t; ^ targetlibs/nrf5x_15/integration/nrfx/legacy/nrf_drv_uart.h:127:13: error: unknown type name 'nrf_uarte_parity_t' typedef nrf_uarte_parity_t nrf_uart_parity_t; ^ targetlibs/nrf5x_15/integration/nrfx/legacy/nrf_drv_uart.h:128:13: error: unknown type name 'nrf_uarte_task_t' typedef nrf_uarte_task_t nrf_uart_task_t; ^ targetlibs/nrf5x_15/integration/nrfx/legacy/nrf_drv_uart.h:129:13: error: unknown type name 'nrf_uarte_event_t' typedef nrf_uarte_event_t nrf_uart_event_t; ^
Here is the relevant (Ihope) portion of my build file:
info = { 'name' : "QY03", 'link' : [ "https://www.kospet.com/products/kospet-magic-3" ], 'espruino_page_link' : 'QY03', 'default_console' : "EV_BLUETOOTH", 'variables' : 14000-300, # 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' : 'e_%v.QY03.hex', 'build' : { 'optimizeflags' : '-Os', 'libraries' : [ 'BLUETOOTH', # 'NET', 'GRAPHICS', #'JIT', # 'NEOPIXEL' ], 'makefile' : [ # 'DEFINES += -DCONFIG_GPIO_AS_PINRESET', # Allow the reset pin to work # 'CFLAGS += -D__STARTUP_CLEAR_BSS -D__START=main', # 'LDFLAGS += -D__STARTUP_CLEAR_BSS -D__START=main -nostartfiles', 'DEFINES += -DNRF_SDH_BLE_GATT_MAX_MTU_SIZE=131', #59 77 131 104 'DEFINES += -DBLUETOOTH_NAME_PREFIX=\'"QY03"\'', 'LDFLAGS += -Xlinker --defsym=LD_APP_RAM_BASE=0x2ec0',#2bf0 0x3058#37f8 0x3720 'LDFLAGS += -Xlinker --defsym=LD_NOINIT_SIZE=0x1290',#2bf0 0x3058#37f8 0x3720 'DFU_PRIVATE_KEY=targets/nrf5x_dfu/dfu_private_key.pem', 'DFU_SETTINGS=--application-version 0xff --hw-version 52 --sd-req 0xa9,0xae,0xb6', [#S140](https://forum.espruino.com/search/?q=%23S140) 6.0.0 'BOOTLOADER_SETTINGS_FAMILY=NRF52840', #'ESPR_BLUETOOTH_ANCS=1', # Enable ANCS (Apple notifications) support # 'BLACKLIST=boards/MAGIC3.blocklist', # force some stuff to be removed to save space 'DEFINES += -DNRF_BL_DFU_INSECURE=1 -DNRF_BOOTLOADER_NO_WRITE_PROTECT=1 -DESPR_DCDC_ENABLE=1', 'DEFINES += -DNO_DUMP_HARDWARE_INITIALISATION', 'DEFINES += -DUSE_FONT_6X8 -DGRAPHICS_PALETTED_IMAGES ', #-DGRAPHICS_ANTIALIAS', # 'DEFINES += -DSAVE_ON_FLASH_SAVE -DSAVE_ON_FLASH_ERRORMSG -DSAVE_ON_FLASH_RANDOM -DSAVE_ON_FLASH_WAVEFORM -DSAVE_ON_FLASH_MATH -DSAVE_ON_FLASH_SWSERIAL -DSAVE_ON_FLASH_FFT -DSAVE_ON_FLASH_DUMP', # 'DEFINES+=-DDUMP_IGNORE_VARIABLES=\'"g\\0"\'', 'DEFINES += -DFDS_VIRTUAL_PAGES=2', [#should](https://forum.espruino.com/search/?q=%23should) match fstorage_pages below 'NRF_SDK15=1' ] } }; save_code_pages = 132; #96; fstorage_pages = 10; # typically 2, 10 reduces risk of brick on first flash from stock FW chip = { 'part' : "NRF52840", 'family' : "NRF52", 'package' : "QFN48", 'ram' : 256, 'flash' : 1024, 'speed' : 64, 'usart' : 0, #2 'spi' : 2, #3 'i2c' : 1, #2 'adc' : 1, 'dac' : 0, 'saved_code' : { 'address' : ((0xf8 - fstorage_pages - save_code_pages) * 4096), # Bootloader at 0xF8000 'page_size' : 4096, 'pages' : save_code_pages, 'flash_available' : 1024 - ((0x26 + (0x100-0xf8) + fstorage_pages + save_code_pages)*4), # Softdevice uses 38 pages of flash (0x26000/0x100), bootloader 0x100-0xe0=0x20, FS 2, code 96. Each page is 4 kb. # TWO PAGES 'address2' : 0x60000000, # put this in external spiflash (see below) 'pages2' : 4096, # Entire 16MB (4096 pages of 4096) of external flash }; devices = { 'BTN1' : { 'pin' : 'D4', 'inverted': True, 'pinstate' : 'IN_PULLUP' }, 'SPIFLASH' : { 'pin_cs' : 'D17', 'pin_sck' : 'D19', 'pin_mosi' : 'D20', 'pin_miso' : 'D21', 'pin_wp' : 'D22', # 'pin_hold' : 'D23', 'pin_rst' : 'D23', # no reset but this is HOLD pin, we want it set to 1 like RST 'size' : 16384*1024, # 16MB 'memmap_base' : 0x60000000, }, };
Not sure why it's happening here and not in other builds (like BANGLEJS2)...?
jv -
Just did a fresh pull and tried to build BANGLEJS2 and it failed with:
CC obj/libs/tensorflow/tensorflow/lite/micro/simple_memory_allocator.cc.o arm-none-eabi-gcc: error: unrecognized command line option '-fmacro-prefix-map=libs/tensorflow/=' make: *** [Makefile:842: obj/libs/tensorflow/tensorflow/lite/micro/simple_memory_allocator.cc.o] Error 1
I commented out TENSORFLOW and it builds fine.
-
As always, thanks for your insights, @fanoush.. great idea.
-
I made sure it was all wired at power up and sure enough, it lit up just fine (@ 38400 too). This will be interesting as my true target for this is battery powered. Maybe I'll add a watch on button hold to enable Serial1 and setConsole...
Either way, thank you both! One step forward.
(BTW: the target board is a C20 smartwatch [https://www.aliexpress.com/item/33025338264.html] which were on sale last year for $10US. One became an experiment and I somehow fried the BT system, so looking for an alternate console. )
-
-
I've done a git pull to get 2v19. I'm seeing this on all NRF52840 boards that previously compiled OK (I'm guessing circa 2v16 or so)...
targets/nrf5x/bluetooth.c: In function 'jsble_exec_pending': targets/nrf5x/bluetooth.c:445:9: error: 'BLEP_BONDING_STATUS' undeclared (first use in this function) case BLEP_BONDING_STATUS: { ^ targets/nrf5x/bluetooth.c:445:9: note: each undeclared identifier is reported only once for each function it appears in targets/nrf5x/bluetooth.c:542:33: error: implicit declaration of function 'bleGetActiveBluetoothGattServer' [-Werror=implicit-function-declaration] JsVar *gattServer = bleGetActiveBluetoothGattServer(centralIdx); ^ targets/nrf5x/bluetooth.c:542:33: warning: initialization makes pointer from integer without a cast [-Wint-conversion] targets/nrf5x/bluetooth.c: In function 'pm_evt_handler': targets/nrf5x/bluetooth.c:1735:31: error: 'BLEP_BONDING_STATUS' undeclared (first use in this function) jsble_queue_pending(BLEP_BONDING_STATUS, BLE_BOND_START); ^ targets/nrf5x/bluetooth.c: In function 'services_init': targets/nrf5x/bluetooth.c:2449:17: error: 'ble_nus_init_t {aka struct <anonymous>}' has no member named mitmProtect' nus_init.mitmProtect = true; ^ targets/nrf5x/bluetooth.c: In function 'jsble_startBonding': targets/nrf5x/bluetooth.c:3223:23: error: 'BLEP_BONDING_STATUS' undeclared (first use in this function) jsble_queue_pending(BLEP_BONDING_STATUS, BLE_BOND_REQUEST); // report that we've requested bonding ^ targets/nrf5x/bluetooth.c: In function 'jsble_set_tx_power': targets/nrf5x/bluetooth.c:3383:9: error: 'm_central_conn_handles' undeclared (first use in this function) if (m_central_conn_handles[i] != BLE_CONN_HANDLE_INVALID)
I can't find BLEP_BONDING_STATUS in any *.h file!
I'm also getting a FLASH overrun error trying to compile BANGLEJS2:
/usr/local/gcc-arm-none-eabi-5_4-2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: bin/bootloader_espruino_2v19.179_banglejs2.elf section `.text' will not fit in region `FLASH' /usr/local/gcc-arm-none-eabi-5_4-2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: region FLASH overflowed with .data and user data /usr/local/gcc-arm-none-eabi-5_4-2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: region `FLASH' overflowed by 1892 bytes collect2: error: ld returned 1 exit status make: *** [make/targets/ARM.make:3: bin/bootloader_espruino_2v19.179_banglejs2.elf] Error 1 In file included from targetlibs/nrf5x_15/modules/nrfx/mdk/nrf_peripherals.h:63:0, from targetlibs/nrf5x_15/modules/nrfx/drivers/nrfx_common.h:49, from targetlibs/nrf5x_15/modules/nrfx/nrfx.h:45, from targetlibs/nrf5x_15/modules/nrfx/hal/nrf_gpio.h:44, from targets/nrf5x_dfu/hardware.h:18, from targets/nrf5x_dfu/lcd.c:15:
-
I'd like to use Web Serial (not Web Bluetooth) for IDE on an NRF52 breakout board.. Here are lines from the board file:
info = { 'name' : "C20 smartwatch", 'boardname' : 'C20X', #'default_console' : "EV_BLUETOOTH", 'default_console' : "EV_SERIAL1", 'default_console_tx' : "D5", 'default_console_rx' : "D7", 'default_console_baudrate' : "38400", ...
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?
-
@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?
Just did a clean clone, and a provision.sh BANGLEJS2, followed by
make clean && BOARD=BANGLEJS2 RELEASE=1 make
Still get the error