-
Did you find where variables are used without initialisation? That sounds like a pretty worrying bug.
Perhaps yes - main runs jshInit before jsvInit https://github.com/espruino/Espruino/blob/master/targets/nrf5x/main.c#L21
near end of jshInit is jsble_init https://github.com/espruino/Espruino/blob/master/targets/nrf5x/jshardware.c#L641
so I am guessing this
https://github.com/espruino/Espruino/blob/master/targets/nrf5x/bluetooth.c#L2408
at least it hangs in HardFault_Handler after stepping over jsble_init()
That's interesting - it does look pretty tidy, although it doesn't solve the MTU issue unless you also swap the order of heap and stack? IIRC there's something (
_bss
?) that you can actually modify at runtime such that if someone tries to usemalloc
(which was done in a recent bit of code you posted I think) you don't end up allocating over the top of it.Honestly right now it's not a big priority to add something like that though....
Did you find where variables are used without initialisation? That sounds like a pretty worrying bug.
It's a bit of both. Because it's recursive descent it actually uses the stack pretty heavily so you need quite a bit.