Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Jamber
Level 3
Level 3
25 replies posted 50 sign-ins First like received

In TC377, what's the problem with DMA and CPU access a same SRAM at the same time? For example, during CPU reading a variable DMA moves a data to the variable, or during DMA moving a data to a variable CPU reads it, what will happend in this case?

0 Likes
1 Solution
MoD
Employee
Employee
10 likes given 50 likes received 500 replies posted

There is no problem. DMA and CPU don't access at the same time the SRAM (this not a dual port ram). If one of them access the SRAM then the other wait for access from other finished and access then the SRAM.

For your example: If CPU reading a variable when DMA moves a data to the variable, then the CPU will read the old value or the new value dependent which access was earlier.

View solution in original post

0 Likes
1 Reply
MoD
Employee
Employee
10 likes given 50 likes received 500 replies posted

There is no problem. DMA and CPU don't access at the same time the SRAM (this not a dual port ram). If one of them access the SRAM then the other wait for access from other finished and access then the SRAM.

For your example: If CPU reading a variable when DMA moves a data to the variable, then the CPU will read the old value or the new value dependent which access was earlier.

0 Likes