Commit a8fb8f0
committed
Fix Bluetooth test hang
The hang is most likely a hang in the peripheral bus arbitrator for
UART2 where both CPUs are trying to access UART2, one to set the
baudrate and the other to read another character from the device or
check UART2 status.
Since the tasks are cooperative multitasking it is possible that one of
the UART2 tasks is executing at the time the vTaskDelete call is made.
The vTask call most likely this call only marks the task for deletion,
but does not wait for the deletion of the task. The task may not get
deleted until it enters the ready state again.
Adding a delay after the vTaskDelete allows the tasks to exit and the
task deletion to complete. As such, only one task is running that is
attempting to access the UART.
Testing was done by modifying menuSystem in menuSystem.ino to place the
Bluetooth test into a while(1) loop and to print a loop count for each
pass through the test. Testing has gone on for over 2.5 hours and the
loop count has exceeded 170,000.1 parent d9591db commit a8fb8f0
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
388 | 392 | | |
389 | 393 | | |
390 | 394 | | |
| |||
0 commit comments