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 can comunicate with each other, i've done with no mutex and it works fine as long as one processor only reads and the other one only writes. However i want both to be able to read and write from the same onchipmemory, how can i do it using mutex? I haven't understood how to use mutex properly, do i need two mutex (one for each processor) and how should i connect them on Q-Sys? I've read the altera documentation but it isn't clear for me yet. Thanks13 Replies
- Altera_Forum
Honored Contributor
Hi,
I know it's been a while since you've posted to this thread but if you don't mind and still remember how you were able to get two processors to work without using the mutex, can you please explain the approach you took to solving this. I'm currently having issues with getting two processors to correctly read and write using uart. - Altera_Forum
Honored Contributor
--- Quote Start --- Hi, I know it's been a while since you've posted to this thread but if you don't mind and still remember how you were able to get two processors to work without using the mutex, can you please explain the approach you took to solving this. I'm currently having issues with getting two processors to correctly read and write using uart. --- Quote End --- Hi, For multi-core system, make sure that your Qsys system is correct and each core has a different(exclusive) memory space allocated. Do verify it from BSP Editor->Linker Script that each core has the correct memory span allocated. In qsys, try NOT connecting Interrupt pin from JTAG UART to NIOS. For an application where 2 cores doesn't share memory/peripherals, you can directly make different applications for both cores and make them RUN. Example: LED blinking. You can assign separate LED for blinking, to each core. - Altera_Forum
Honored Contributor
Thanks for the reply. I got it working.