zephyrproject-rtos / openocd

OpenOCD with Zephyr patches for building Zephyr SDK
Other
28 stars 45 forks source link

hwthread_rtos broke RTOS autodetection for Zephyr. #16

Closed EvgeniiDidin closed 4 years ago

EvgeniiDidin commented 4 years ago

Hi,

Recently introduced hwthread_rtos broke the process of RTOS autodetection for Zephyr. There is a lack of symbols to look up in this RTOS(https://github.com/zephyrproject-rtos/openocd/blob/zephyr-20191003/src/rtos/hwthread.c#L268) which leads to entering this branch: https://github.com/zephyrproject-rtos/openocd/blob/zephyr-20191003/src/rtos/rtos.c#L263 After that "No RTOS could be auto-detected!" message is printed and Zephyr is not detected as expected.

One of the workarounds can be putting hwthread_rtos in the end of the rtos_types list:

diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c
index b518ba645..474e2b54d 100644
--- a/src/rtos/rtos.c
+++ b/src/rtos/rtos.c
@@ -51,8 +51,8 @@ static struct rtos_type *rtos_types[] = {
        &mqx_rtos,
        &uCOS_III_rtos,
        &nuttx_rtos,
-       &hwthread_rtos,
        &Zephyr_rtos,
+       &hwthread_rtos,
        NULL
 };

@galak , @nashif , what do you think about this workaround?

EvgeniiDidin commented 4 years ago

Fixed in https://github.com/zephyrproject-rtos/openocd/commit/3d7db5535a56accd2d4b377b51fb8f3cfce59d0e