-
Notifications
You must be signed in to change notification settings - Fork 619
[TDM] os/: Code cleanup, remove memory leaks #7029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: TDM
Are you sure you want to change the base?
Conversation
allen-kim-sec
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sample_cc is very important information about position..
alive it.
|
Hi? According to my test result , I can not chatch "0000 Writing BreakPoint via Trace32". you also try to find who write 0000 data ( it has the same result : write 0000 for 64 Bytes ( 4 x 2 Bytes x 8 samples ) ). there are two interrupt asserted. Interval is very short I guess the TDM data is received continuously
Q#3: Another Ideation |
Hi, i think it would be best if we can use 4channel TDM which eliminates the complicity of INT & EXT DMA, however, I would need to check why 8 channel was used in the first place.. Let me do checking before replying you. |
Emm... 4ch is not suitable because it need acquisition time for the next sample. |
I just checked that if 8ch is required, it is mandatory to have both prime and EXT dma due to data interleaving. Using single DMA for 8ch will cause data loss. |
|
@namanjain7 |
d6e9dc6 to
d869294
Compare
|
@zhongnuo-tang Hello. |
i think it might be due to your printing that took some time.. i have modified your code based on this PR, instead of printing all data, print '-' every 100samples. and i can see the three steps |
I got it. But if there is no print, then application will process something else in that time. application also requires time to process the data. So, if callback of i2s from bsp to driver is not coming, then what is the solution of this issue? |
i think it is actually called back to app, but because there is too many logs you kind of missed log. How about you replace the printing with slight delay to simulate the data processing? |
|
@namanjain7 #7031 was merged , please change your base from TDM branch. |
85a8405 to
d5e75fa
Compare
|
@namanjain7 ,
10234: 0266 0004 1ea3 ffff ffff ffff ffff ffff |
os/drivers/sensors/ais25ba.c
Outdated
| send_count++; | ||
| } while (status == -1 && get_errno() == EINTR); | ||
|
|
||
| lldbg("**** send count in mq_send: %d\n", send_count); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the log to check the send_count.
The value is sometimes 2.
But I am assuming if status != OK, then buffer is not pushed to mq, buffer push failed.
| // Clean up | ||
| ret = ioctl(mems_fd, SENSOR_STOP, NULL); | ||
| /* Clean up */ | ||
| mq_unlink(MEMS_SENSOR_PATH); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the mq_unlink to avoid pushing buffer to mq from driver.
we will only remove buffer from mq from application after executing this.
| } | ||
| usleep(10000); | ||
| is_sensor_prepared = false; | ||
| while (mems_mq_receive(g_mems_mq, (FAR char *)&msg, sizeof(msg), &prio) == OK); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are removing the buffers from mq to make it empty.
then we will close it.
|
Add trailing zeroes check, clean code and remove memory leaks
224221d to
a1e728d
Compare
Fixed the issues. |
|
consider sem_tickwait() to treat timeout case
|
code cleanup for ais25ba sensor