Forum Discussion
Altera_Forum
Honored Contributor
13 years agoproblem with mutex core
Dear all, I've created a qsys system composed of two NIOS, each one attached to its on-chip memory that contains its program. the two processors are connected to a shared RAM protected via a ...
Altera_Forum
Honored Contributor
13 years agoI've added this code at teh beginning of the program to test if teh mutex is not NULL:
mutex = altera_avalon_mutex_open(MUTEX_NAME); if (mutex == NULL) /* for testing only */ { error_code = ERROR_OPENED_INVALID_MUTEX; printf("error \n"); goto error; } The two cpu do not access to this if, this means that the mutex is not NULL, I also added a printf inside the if of cpu1 after wrinting data, which displays hello in console and it's OK However the data read by cpu2 is fault How to be sure that the second CPU is reading the value after the first one set it? Please help me