I have a XIAO nrf52840 running as a BLE scanner in an BLE to Wifi gateway. The nRF picks up BLE advertisements, parses them for specific data then sends the data over serial to an ESP32 with an SD card, then on to an InfluxDB server.
I am using VS Code & PlatformIO for Windows 11, Arduino with the nrf52840 Bluefruit BLE library.
My issue is that after 3-6 hours of scanning the nRF appears to hang as data stops flowing to the ESP32. After a manual reboot it works fine again. I need it to run in a field for months at a time.
My thinking is that there is a memory leak here.
Two questions;
1/ is there a way I can extract the nRF52840 free memory at runtime, in software using Arduino, to monitor memory usage over time
2/ If I was to select an External debugger, would you recommend a jlink(clone), DAPLINK, or a nrf52840DK to provide visibility into the runtime memory usage?
Hi there,
Sounds like a flow control issue, more than a buffering one to me?
WHat type of flow control between the Xiao and ESP serial ports? < have you tried to slow it down or speed it up? to see if you can duplicate it? 3-6 hours is a long time. Are you just collecting scan data or is there a connection happening on the BLE? (3-6 hours of scanning)
I have Jlink and a clone(no serial#) if you go that route you can use segger embedded studio,
and use this
I have a DK but haven’t had to deploy it yet , but soon for the BLE coded phy 2Mbs connection.
I’ve seen arduino code that checked the size at runtime by writing a variable to the stack and reading the location back and comparing it with the malloc, YMMV
HTH
GL PJ
Hmm, No experience , I would go for the latest?
It’s been a long time , I did get the clone working, but remember a issue and ended up getting the unit in the picture on a discount. SO many tools(software) that work with it and jflash or J_link commander.
check out the link recently . someone was getting one going and I posted a ton of screen shots.
HTH
GL PJ
for me the epiphany was being able to see and set variables in real time, with PLio and the Debugger.
breakpoints and single-step was helpful.