I have built a new firmware for the Puck.js in order to add a C function that does some Elliptic Curve math that would be too slow in JS. I have gotten this firmware to build and load onto the puck successfully, but when I try to run the function I wrote it crashes for some reason (puck becomes unresponsive, disconnects from Web IDE). The function is included below for reference. I used LED lighting to narrow down where exactly it stops working and it appears to be on the line with "mbedtls_ecp_group_load".
When I build Espruino with a LINUX target, this code works completely fine, so there doesn't appear to be anything wrong with the code itself. I'm having trouble debugging what could be wrong here. Is there any way to attach a debugger to the Puck or something else I could do here? It seems very difficult to debug C code on the Puck because if anything goes wrong it just disconnects from the Web IDE.
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.
I have built a new firmware for the Puck.js in order to add a C function that does some Elliptic Curve math that would be too slow in JS. I have gotten this firmware to build and load onto the puck successfully, but when I try to run the function I wrote it crashes for some reason (puck becomes unresponsive, disconnects from Web IDE). The function is included below for reference. I used LED lighting to narrow down where exactly it stops working and it appears to be on the line with "mbedtls_ecp_group_load".
When I build Espruino with a LINUX target, this code works completely fine, so there doesn't appear to be anything wrong with the code itself. I'm having trouble debugging what could be wrong here. Is there any way to attach a debugger to the Puck or something else I could do here? It seems very difficult to debug C code on the Puck because if anything goes wrong it just disconnects from the Web IDE.
Thank you.