Skip to content

Writing binary data to flash from IMU device - buffering issue causing acquisition loss #16059

Discussion options

You must be logged in to vote

I believe what you are trying to do is feasible, but you need to read up on memory allocation. The method readfrom_mem allocates, but readfrom_mem_into does not. As I suggested above, you need a hard ISR with a double buffer. The buf arg would be a segment of one of the buffers, defined with a memoryview. When one phase of the buffer is full, the ISR would be pointed at the other buffer and the first one written out.

These are relatively advanced techniques so be prepared to do some reading, e.g. this official doc and this one.

Replies: 6 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@peterhinch
Comment options

@rjsdotorg
Comment options

@peterhinch
Comment options

Answer selected by rjsdotorg
@rjsdotorg
Comment options

@rjsdotorg
Comment options

@peterhinch
Comment options

@peterhinch
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@rjsdotorg
Comment options

@jonnor
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants