I've always thought the Nordic nRF chip looks to have lots of uses, and wondered about porting Espruino to it. I was very excited to discover that it looks as though lots has been done already.
It looks as though it should run on the Adafruit Flora sewable BTLE module (https://www.adafruit.com/products/2487) - which has the 256k flash nrf51822 chip - Wearing a Javascript interpreter just sounds super geeky :-)
I was curious to try building it and have a problem:
NRF51822DK=1 SOFTDEVICE=1 BLE_INTERFACE=1 RELEASE=1 make
...gives:
LD espruino_1v84.60_nrf51822.elf
/home/colinp/espruino/Espruino/targetlibs/nrf5x/nrf51_sdk/components/toolchain/gcc/gcc_startup_nrf51.o: In function Reset_Handler':
(.text+0x40): undefined reference toSystemInit'
/usr/local/gcc-arm-none-eabi-4_8-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/armv6-m/crt0.o: In function _start':
(.text+0x4e): undefined reference tomain'
collect2: error: ld returned 1 exit status
make: *** [espruino_1v84.60_nrf51822.elf] Error 1
Main for this board appears to be in targets/nrf5x/main.c, which is defined in the Makefile. main.o appears, which implies it is being compiled, but not linked.
I tried various hacks to get it to compile, and encountered different problems. When I got to the stage of patching the include path in the auto-generated gen/platform_config.h I figured I was probably doing something wrong.
I thought perhaps nrf51 build had fallen out of use as nrf52 was in there. If I try to build for nrf52 using the command in README_Building.md I get a different error:
NRF52832DK=1 RELEASE=1 make
targets/nrf5x/jshardware.c:482:23: error: 'nrf_adc_config_t' undeclared (first use in this function)
I'm using commit 6dbda86c of Friday 8th Jan 2016.
I'm using gcc-arm-none-eabi-4_8-2014q1 (I can't remember where it came from) but I think this should be OK - the stm32 Espruino compiles fine.
I get the problem even when using commit 904ca0ac8c19828 which is marked "nRF51 now working". This makes me think I'm doing something dumb.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hello,
I've always thought the Nordic nRF chip looks to have lots of uses, and wondered about porting Espruino to it. I was very excited to discover that it looks as though lots has been done already.
It looks as though it should run on the Adafruit Flora sewable BTLE module (https://www.adafruit.com/products/2487) - which has the 256k flash nrf51822 chip - Wearing a Javascript interpreter just sounds super geeky :-)
I was curious to try building it and have a problem:
NRF51822DK=1 SOFTDEVICE=1 BLE_INTERFACE=1 RELEASE=1 make
...gives:
LD espruino_1v84.60_nrf51822.elf
/home/colinp/espruino/Espruino/targetlibs/nrf5x/nrf51_sdk/components/toolchain/gcc/gcc_startup_nrf51.o: In function
Reset_Handler': (.text+0x40): undefined reference to
SystemInit'/usr/local/gcc-arm-none-eabi-4_8-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/armv6-m/crt0.o: In function
_start': (.text+0x4e): undefined reference to
main'collect2: error: ld returned 1 exit status
make: *** [espruino_1v84.60_nrf51822.elf] Error 1
Main for this board appears to be in targets/nrf5x/main.c, which is defined in the Makefile. main.o appears, which implies it is being compiled, but not linked.
I tried various hacks to get it to compile, and encountered different problems. When I got to the stage of patching the include path in the auto-generated gen/platform_config.h I figured I was probably doing something wrong.
I thought perhaps nrf51 build had fallen out of use as nrf52 was in there. If I try to build for nrf52 using the command in README_Building.md I get a different error:
NRF52832DK=1 RELEASE=1 make
targets/nrf5x/jshardware.c:482:23: error: 'nrf_adc_config_t' undeclared (first use in this function)
I'm using commit 6dbda86c of Friday 8th Jan 2016.
I'm using gcc-arm-none-eabi-4_8-2014q1 (I can't remember where it came from) but I think this should be OK - the stm32 Espruino compiles fine.
I get the problem even when using commit 904ca0ac8c19828 which is marked "nRF51 now working". This makes me think I'm doing something dumb.
Am I missing some sort of Make flag or something?
Thanks,
Colin