I am having two task vATask and vBTask.
vATask - it is handling Modbus TCP communication at every 5 ms
vBTask- it is handling CAN communication with a device at every 10 ms
I want to access a common memory resources for both the task .
I mean i want to receive data from CAN interface(CAN Rx interrupt for receiving data) and put in some CAN Rx buffers when the request come from Modbus TCP then i want to send the requested data from CAN Rx buffers.
When some request comes from Modbus TCP to write some data i want to write in CAN Tx buffers and send it to CAN interface.
I am worried about the data corruption because both task accesssing the same memory locations.I After reading FreeRTOS documentation i got to know about semaphore and mutex.
I am new to RTOS concepts .
Can you please guide me what to use(semaphore or mutex) and how can i use in my application.