Disabling Hard Reset Puck.js #3296
Replies: 5 comments
-
Posted at 2020-02-09 by Robin Sun 2020.02.09
Has an attempt been made to extend the startup call to onInit() been extended, such that a conditional step would then allow the saved code to then execute? Should additional assistance be required, please post your startup call to the onInit() function. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-02-10 by @gfwilliams I'm afraid there isn't a way of disabling the removal of 'boot code' in Espruino at the moment, it's built into the firmware. However on a long-press, the only files that get removed are the ones created by If you write your code to I'm afraid bonding data will still be cleared though. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-02-10 by tronic98776 Thank you Gordon. That should be perfect. I'll give it a try. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-02-20 by tronic98776 I'm having trouble getting this to work. For eaxample here is what I'm trying to write to .boot0 and have it execute on device start-up, but it's not working for me:
So i have nothing in save(), so do not enter the save() command into the terminal, I just send the above code onto the puck via the IDE, then disconnect from the IDE and restart the puck by cycling the power. I have tried both including the onInit and leaving it commented out as above. Do I have something wrong, or is it something to do with the ble_hid_keyboard service not working from boot0? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-02-24 by @gfwilliams Ahh - yes, it's because Maybe try using https://www.espruino.com/ide/ to write the code - I just pushed some changes I'd had locally that make this much easer.
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-02-09 by tronic98776
I'm looking for a way to disable the hard-reset that is initiated by holding down the button on power up to clear out any previously saved code and bonding data. Is there a command I can add into my code that will prevent this function?
I understand there are certain risks with doing this but I want to prevent the chance of erasing the code accidentally.
I would like to still have the self-test function intact where you can power up the puck without loading the saved code and without deleting the saved code.
many thanks
Beta Was this translation helpful? Give feedback.
All reactions