Skip to content

Commit 9f29e05

Browse files
committed
Debug: Add diagnostic output to mutex test
The mutex test hangs immediately after enabling preemptive scheduling, with only 'S' printed. Add diagnostic markers at: - Task entry points (task_a, task_b, monitor_task) - Before enabling preemptive scheduling This will help identify if: 1. Tasks never start executing (scheduler issue) 2. Tasks start but hang on first operation (semaphore/sync issue) 3. Preemptive scheduler never activates (app_main return issue) Temporary diagnostic commit to identify root cause of complete hang.
1 parent fc1b43f commit 9f29e05

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/mutex.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ static int currently_in_critical_section = 0;
1818
/* Enhanced Task A */
1919
void task_a(void)
2020
{
21+
printf("[DIAG] Task A entry point reached\n");
2122
printf("Task A (ID %d) starting...\n", mo_task_id());
2223

2324
for (int i = 0; i < MAX_ITERATIONS; i++) {
@@ -70,6 +71,7 @@ void task_a(void)
7071
/* Enhanced Task B */
7172
void task_b(void)
7273
{
74+
printf("[DIAG] Task B entry point reached\n");
7375
printf("Task B (ID %d) starting...\n", mo_task_id());
7476

7577
for (int i = 0; i < MAX_ITERATIONS; i++) {
@@ -130,6 +132,7 @@ void task_b(void)
130132
/* Simple monitor task */
131133
void monitor_task(void)
132134
{
135+
printf("[DIAG] Monitor entry point reached\n");
133136
printf("Monitor starting...\n");
134137

135138
int cycles = 0;
@@ -220,5 +223,6 @@ int32_t app_main(void)
220223
(int) task_b_id, (int) monitor_id, (int) idle_id);
221224

222225
printf("Starting test...\n");
226+
printf("[DIAG] About to enable preemptive scheduling\n");
223227
return true; /* Enable preemptive scheduling */
224228
}

0 commit comments

Comments
 (0)