Post Go back to editing

CoraZ7+CN0540 Python adi package version Err32 + Err 110

Category: Software

Hi,

While developing a Python script to get data from the ADXL1002 sensor (using the diverse boards specified in the topic subject) i've come across a bug that I cannot seem to debug myself.
I've encountered no problem gathering the data, but after switching the CN0540 sample rate from 32000 to 16000 I firstly saw that :
-The register kept the precedent value (32000) in memory
-The next value were loaded properly (16000)
After running the read data from buffer function, i've come across Error 110 (I have noticed that this error seems to happen after Error 32 Broken Pipe), here is a screenshot of it :

During the development of my script I have also noticed that my adi package version was quite outdated.
Mine : 0.0.8
Latest : 0.0.14
Even though I have ran all the update options available, is it a software//hardware problem, or did something wrong happened ?
I am talking about my package version because in the one I have, the reset_buffer function is not implemented.
I implemented it myself, all I did was copy/paste the actual package function which is :

def reset_buffer(func):
    """Wrapper for set calls which require the SPI engine.
    Without disabling the buffer the DMA would block forever
    """

    def wrapper(*args, **kwargs):
        if args[0]._reset_on_spi_writes:
            args[0].rx_destroy_buffer()
        func(*args, **kwargs)

    return wrapper

And calling the decorator each time a buffer was modified
The function does seem to work properly and doesn't give me any error.
The appearance of the errors seems to be random, sometimes it is when making an instance of my subclass, sometimes it is when starting the script, sometimes it works well.
The errors seem to be correlated with the setting of the CN0540 sample rate and buffer_size
I have as well already used all the update_tools and scripts provided by the wiki.
I really feel like this is a adi package version problem, is my image broken and did not update well or is there no update at all ?
I also feel like clearing the buffer would resolve the problems.

Thank you for helping me out

  • For anyone passing by :

    I have resolved the issue.
    The Broken Pipe Error causing all the trouble was caused by the script not calling the method "rx_destroy_buffer" (which causes the termination of the .rx() method) when being terminated.
    The buffer being still in a busy mode, writing over it (to change your sample rate acquisition for example) would not work since you cannot read/write at the same time
    Maybe you should include the function in the __del__ method of the rx class or would it cause problems of some kind ?
    So when you want to terminate your program, be sure that the rx_destroy_buffer method has been called on your device

    Have a nice day !

  • If you need to update the python package on the board itself you can just use pip. The latest release contains the necessary decorator.

    -Travis