Skip to content

Conversation

0xc0170
Copy link
Contributor

@0xc0170 0xc0170 commented Jun 30, 2016

Fixes #2059. As reported, if timer thread is not created, the main thread
id is 0x01. We introduce MAIN_THREAD_ID macro to define the id. We shall consider,
if we keep this in a variable.

I placed MAIN_THREAD_ID in cmsis_os.h as that header is safe to include within RTX, not like
RTX_Config.h or RTX_CM_Lib.h). I reported an issue to cmsis team about this inclusion mess within RTX.

tested with K64F with default config:

+--------+------------+-----------+---------+-------------------------+--------------------+---------------+-------+
| Result | Target     | Toolchain | Test ID | Test Description        | Elapsed Time (sec) | Timeout (sec) | Loops |
+--------+------------+-----------+---------+-------------------------+--------------------+---------------+-------+
| OK     | K64F[f3f7] | ARM       | RTOS_1  | Basic thread            |       11.36        |       15      |  1/1  |
| OK     | K64F[f3f7] | ARM       | RTOS_3  | Semaphore resource lock |        8.45        |       20      |  1/1  |
| OK     | K64F[f3f7] | ARM       | RTOS_5  | Queue messaging         |        2.4         |       20      |  1/1  |
| OK     | K64F[f3f7] | ARM       | RTOS_7  | Timer                   |       11.33        |       15      |  1/1  |
| OK     | K64F[f3f7] | ARM       | RTOS_8  | ISR (Queue)             |        6.41        |       20      |  1/1  |
+--------+------------+-----------+---------+-------------------------+--------------------+---------------+-------+

+--------+------------+-----------+---------+-------------------------+--------------------+---------------+-------+
| Result | Target     | Toolchain | Test ID | Test Description        | Elapsed Time (sec) | Timeout (sec) | Loops |
+--------+------------+-----------+---------+-------------------------+--------------------+---------------+-------+
| OK     | K64F[f3f7] | GCC_ARM   | RTOS_1  | Basic thread            |       11.37        |       15      |  1/1  |
| OK     | K64F[f3f7] | GCC_ARM   | RTOS_3  | Semaphore resource lock |        8.5         |       20      |  1/1  |
| OK     | K64F[f3f7] | GCC_ARM   | RTOS_5  | Queue messaging         |        2.38        |       20      |  1/1  |
| OK     | K64F[f3f7] | GCC_ARM   | RTOS_7  | Timer                   |       11.36        |       15      |  1/1  |
| OK     | K64F[f3f7] | GCC_ARM   | RTOS_8  | ISR (Queue)             |        6.45        |       20      |  1/1  |
+--------+------------+-----------+---------+-------------------------+--------------------+---------------+-------+

Our tests are multithreaded thus NOT SUPPORTED once I switch to small default build. I run just main thread with blinky to blink LED, working.

@gdhamp Please verify this patch.

Fixes ARMmbed#2059. As reported, if timer thread is not created, the main thread
id is 0x01. We introduce MAIN_THREAD_ID macro to define the id. We shall consider,
if we keep this in a variable.

I placed MAIN_THREAD_ID in cmsis_os.h as that header is safe to include within RTX, not like
RTX_Config.h or RTX_CM_Lib.h).
@geky
Copy link
Contributor

geky commented Jun 30, 2016

+1, also +1 for reporting the inclusion mess.

Is cmsis_os.h the appropriate place for rtx defines accessible from other code? Perhaps we should move the overrides in RTX_Conf_CM.c out to cmsis_os.h then?

@hamslabs
Copy link

+1 - Looks good and thanks for the fast response.

@sg- sg- merged commit 26e9aa4 into ARMmbed:master Jun 30, 2016
@0xc0170 0xc0170 deleted the fix_#2059 branch July 1, 2016 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants