Forum Discussion
Altera_Forum
Honored Contributor
15 years agoHow to use the mutex
Hello to everyone i am developing an application with two processor, one is using pure C code and the other one has an uCLinux running in it. I want them to share the same onchip memory so they...
Altera_Forum
Honored Contributor
12 years agoHi Aprado,
I have two cores sharing a particular memory address. I also implemented the mutex same way you did. But when I program and start my first core it works. As I program and start the second core, it freezes the first code. These happen only when i implement the mutex for sharing some common address space between two cores. Otherwise if I run two cores independently, it RUNs. Below is a template for my code: if (!altera_avalon_mutex_trylock (m1, ALT_CPU_CPU_ID_VALUE)) { if (!altera_avalon_mutex_trylock (m2, ALT_CPU_CPU_ID_VALUE)) { IORD(BASE, 0x00); //Memory Operation altera_avalon_mutex_unlock (m2); } } I used IORD. Does IORD & IORD_32DIRECT will make a difference in this case. Please suggest.