This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Segmentation fault with pynrfjprog

Hello,

I'm writing a python script to flash batches of boards with NRF52's.

This is the part of the script that flashes the boards:

I call that function inside a for-loop until all the boards are flashed. The code works, the boards are flashed, but after a while I get a segmentation fault -11. Is it maybe a memory leak?

Any clues will be appreciated.

Parents
  • Hm, I can't see anything wrong with the script, but the garbage collection in python can be unreliable. Can you try:

    That should ensure that the close() is called whatever happens (it's always called when exiting the with statement), and (maybe) help the python garbage collector out.

  • With that code I get this error:

     

  • Sorry, that should be API.API('NRF52').

  • It seems to have solved the problem. I'll keep testing for a while more and I'll mark your reply as an answer once I'm sure :) Otherwise, I'll update again here. Thanks!

Reply Children
No Data