Sending commands over BLE instead of USB/USART using Nordic Semicondcutors nRF52832DK #783
Replies: 1 comment
-
Posted at 2015-08-14 by @gfwilliams Well, I think you're spot on with using Also, when the chip hardfaults you can often still access the call stack - it might help to see where it's going wrong. Could it just be some issue with transmitting at the same time as receiving? You could try using your existing Serial implementation and Transmitting on Serial while receiving via BLE, and vice versa - it might help to narrow it down. The other issue might be that Espruino is filling up the output buffer and blocking? When you send data without an There's actually not much info about the internals at the moment. I'm doing a talk at Fullstack in October where I'll dive into that a bit more, and I hope to put that all online. Basically though, Espruino communicates with the world via two Queues:
The only important thing is just to make sure that you don't access wrong side of the queues from an IRQ (and don't let one IRQ interrupt another IRQ in the middle of accessing the queues). I doubt it'd hard-fault, but you'd lose characters all over the place. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2015-08-14 by mjdietz
for example:
1.) turn on board loaded with espruino_nrf52.hex, board starts advertising in jshinit().
2.) connect to board with smartphone
3.) send "digitalWrite(LED_1, 1);" using UART simulated over BLE
4.) LED_1 lights up.
then extend this to sending entire scripts. (currently using nordics nRF Toolbox app and the UART module to send and receive data from espruino).
--My problem
currently this is kind of working.. i can send commands under 20 bytes no problem. but when i send a command like "function a() { 25; }" the chip hard fualts. also for some reason i cant send over ~36 bytes even though i implemented ble long write and not sure why...
I am pretending like I am using EV_SERIAL1 right now. just using pushIOCharEvent like normal and USARTkick.
just looking for some advice on how to make this work. any suggestions/tips? Maybe i have some misunderstanding about how espruino read and writes from the terminal and what it expects? any suggestions on source files that I should look at to get a better idea about this?
thanks,
Mike
Beta Was this translation helpful? Give feedback.
All reactions