PSoC6 cm0+ and cm4 UART priority

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

cross mob
lock attach
Attachments are accessible only for community members.
SuRa_2245351
Level 4
Level 4
First like received First like given

I have written code for UART and printing using both core CM0+ and CM4, its printing properly but I had doubt. Since both cores are transmitting using same UART block will there be any clash.

Example: if suppose CM4 is transmitting and CM0+ also want to transmit at same time will there be any clash, and if there is clash how priority is resolved between CM0+ and CM4 or else I have to use IPC to check whether UART is free and done with transmission.

0 Likes
1 Solution
AlanH_86
Employee
Employee
100 replies posted 50 replies posted 25 solutions authored

Yes there is a clash

The contention is resolved as a race condition... whoever writes first wins

The priority is resolved first come first serve.

The only correct thing to do is to use a semaphore... implemented via IPC.

View solution in original post

0 Likes
3 Replies
AlanH_86
Employee
Employee
100 replies posted 50 replies posted 25 solutions authored

Yes there is a clash

The contention is resolved as a race condition... whoever writes first wins

The priority is resolved first come first serve.

The only correct thing to do is to use a semaphore... implemented via IPC.

0 Likes

Thank you for reply arh, I will try using semaphore.

0 Likes
MarkA_91
Employee
Employee
25 replies posted 10 replies posted 5 replies posted

Please see application note AN215656 and code example CE216795. Both show how to set up an IPC-based semaphore for the two CPUs in PSoC 6 to share a resource. In the project the resource is just a byte in RAM, but the concept can be easily extended for other resources such as a UART.

0 Likes