I got a tiny board(nucleo-l432kc), just need a micro-usb cable to power, com and flash code as drag & drop, but with 256k flash and 64k ram. so I'm trying to port Espruino on it as it's convenient to carry and play, or use it to prepare some funny toys for the kid :)
but the process is painful :( I modified the files use nucleol476rg as reference, cleared out many compilation errors due to the differences between l476 and l432(pinutils.py, jshardware.c etc.), but during link stage, I met a strange error :
LD espruino_1v94.3387_nucleol432kc.elf _init' referenced in section.text.__libc_init_array' of /usr/local/gcc-arm-none-eabi-6-2017-q2-update-mac/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/libc.a(lib_a-init.o): defined in discarded section `.init' of /usr/local/gcc-arm-none-eabi-6-2017-q2-update-mac/bin/../lib/gcc/arm-none-eabi/6.3.1/thumb/v7e-m/crti.o
collect2: error: ld returned 1 exit status
seems it's due to build_linker.py put below stuff into discard :
/* Remove stuff we don't want /
/ we don't call init and fini anyway. GCC 5.x starting added them but then optimising them out */
/DISCARD/ :
{
LD espruino_1v94.3387_nucleol432kc.elf
GEN espruino_1v94.3387_nucleol432kc.lst
GEN espruino_1v94.3387_nucleol432kc.bin
GEN espruino_1v94.3387_nucleol432kc.hex
bash scripts/check_size.sh espruino_1v94.3387_nucleol432kc.bin
PASS - size of 241360 is under 241664 bytes
after flash the board, use WebIDE I can connect the board successfully, but can't interact with the console(REPL - enter 1+1 and get the response).
by write a simple code like digitalWrite(LED1,1) and upload, I do not get the famous Espruino logo and copyright note, but an error message - ERROR: Prompt not detected - upload failed. Trying to recover...
anyone with similar experience ? any hint to potential issue behind ? I doubt the build is passed but actually something wrong for the remap of *(.init)...
what's the reason behind that l476 do not need crti.o from .init(the c-runtime environment) but l432 do?
the default console is EV_SERIAL2, default_console_tx is A2 and default_console_rx is A15 referring to nucleo-l432kc board schematic.
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.
Hi,
I got a tiny board(nucleo-l432kc), just need a micro-usb cable to power, com and flash code as drag & drop, but with 256k flash and 64k ram. so I'm trying to port Espruino on it as it's convenient to carry and play, or use it to prepare some funny toys for the kid :)
but the process is painful :( I modified the files use nucleol476rg as reference, cleared out many compilation errors due to the differences between l476 and l432(pinutils.py, jshardware.c etc.), but during link stage, I met a strange error :
LD espruino_1v94.3387_nucleol432kc.elf
_init' referenced in section
.text.__libc_init_array' of /usr/local/gcc-arm-none-eabi-6-2017-q2-update-mac/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/libc.a(lib_a-init.o): defined in discarded section `.init' of /usr/local/gcc-arm-none-eabi-6-2017-q2-update-mac/bin/../lib/gcc/arm-none-eabi/6.3.1/thumb/v7e-m/crti.ocollect2: error: ld returned 1 exit status
seems it's due to build_linker.py put below stuff into discard :
/* Remove stuff we don't want /
/ we don't call init and fini anyway. GCC 5.x starting added them but then optimising them out */
/DISCARD/ :
{
}
after move *(.init) under linker FLASH or RAM section, for example as below :
codeOut("""
} >FLASH
the build is passed :
LD espruino_1v94.3387_nucleol432kc.elf
GEN espruino_1v94.3387_nucleol432kc.lst
GEN espruino_1v94.3387_nucleol432kc.bin
GEN espruino_1v94.3387_nucleol432kc.hex
bash scripts/check_size.sh espruino_1v94.3387_nucleol432kc.bin
PASS - size of 241360 is under 241664 bytes
after flash the board, use WebIDE I can connect the board successfully, but can't interact with the console(REPL - enter 1+1 and get the response).
by write a simple code like digitalWrite(LED1,1) and upload, I do not get the famous Espruino logo and copyright note, but an error message - ERROR: Prompt not detected - upload failed. Trying to recover...
anyone with similar experience ? any hint to potential issue behind ? I doubt the build is passed but actually something wrong for the remap of *(.init)...
what's the reason behind that l476 do not need crti.o from .init(the c-runtime environment) but l432 do?
the default console is EV_SERIAL2, default_console_tx is A2 and default_console_rx is A15 referring to nucleo-l432kc board schematic.
thanks