Giter Club home page Giter Club logo

uc-os3's Introduction

µC/OS is a full-featured embedded operating system originally developed by Micriµm™. In addition to the two highly popular kernels, µC/OS features support for TCP/IP, USB-Device, USB-Host, and Modbus, as well as a robust File System.

Since its founding in 1999 as a private company, Micriµm and its team of engineers have offered world-class embedded software components for the most critical and demanding real-time applications. Recognized as having some of the cleanest code in the industry, with easy-to-understand documentation, the Micrium real-time kernels, and software components have successfully been deployed in thousands of products worldwide across a broad range of industries. Micrium’s µC/OS-II™ kernel has been certified for use in safety-critical applications and remains a respected favorite in the medical, aerospace, and industrial markets. µC/OS continues to be the RTOS of choice for engineers requiring the most reliable and trusted solution for their mission-critical applications.


Founded by a team of former Micrium employees, Weston Embedded Solutions is the official custodian for the µC/OS RTOS and Stacks software repository to ensure it remains the trusted choice for embedded engineers around the world.


Product Documentation and Release Notes *************** https://micrium.atlassian.net/

Technical Support

https://weston-embedded.com/micrium-support

Example Projects ********* https://weston-embedded.com/micrium-examples

Commercial Licensing Option ********* https://weston-embedded.com/products/cesium

Who to Contact ********* https://weston-embedded.com/company/contact

uc-os3's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uc-os3's Issues

A bug in the OS_FlagTaskRdy function (os_flag.c)

There is missing one case, as shown in bold below:
void OS_FlagTaskRdy (OS_TCB p_tcb,
OS_FLAGS flags_rdy,
CPU_TS ts)
{
#if (OS_CFG_TS_EN == 0u)
(void)ts; /
Prevent compiler warning for not using 'ts' */
#endif

p_tcb->FlagsRdy = flags_rdy;
p_tcb->PendStatus = OS_STATUS_PEND_OK; /* Clear pend status /
p_tcb->PendOn = OS_TASK_PEND_ON_NOTHING; /
Indicate no longer pending /
#if (OS_CFG_TS_EN > 0u)
p_tcb->TS = ts;
#endif
switch (p_tcb->TaskState) {
case OS_TASK_STATE_PEND:
case OS_TASK_STATE_PEND_TIMEOUT:
#if (OS_CFG_TICK_EN > 0u)
if (p_tcb->TaskState == OS_TASK_STATE_PEND_TIMEOUT) {
OS_TickListRemove(p_tcb); /
Remove from tick list /
}
#endif
OS_RdyListInsert(p_tcb); /
Insert the task in the ready list /
p_tcb->TaskState = OS_TASK_STATE_RDY;
break;
case OS_TASK_STATE_PEND_SUSPENDED:
case OS_TASK_STATE_PEND_TIMEOUT_SUSPENDED:
#if (OS_CFG_TICK_EN > 0u)
if (p_tcb->TaskState == OS_TASK_STATE_PEND_TIMEOUT) {
OS_TickListRemove(p_tcb); /
Remove from tick list /
}
#endif

p_tcb->TaskState = OS_TASK_STATE_SUSPENDED;
break;
case OS_TASK_STATE_RDY:
case OS_TASK_STATE_DLY:
case OS_TASK_STATE_DLY_SUSPENDED:
case OS_TASK_STATE_SUSPENDED:
default:
/
Default case. */
break;
}
OS_PendListRemove(p_tcb);
}
#endif

os_pend_multi.c and os_int.c

Hello, I am going through the companion book and noticed that the above two files are listed in the book but are missing in this repository. Could you please explain why?

A bug in the OS_TaskChangePrio funciton (os_task.c)

When a task to change its priority is blocked on a mutex, its priority change may affect the priority of the owner of the mutex. Specifically, in this function, if the priority of the task is to be reduced, that is, prio_ new>prio_ Cur, at this time, if the priority of the owner of the mutex is higher than prio_ Cur, which is not handled in this case, that is, the loop should be ended, but this is not done in the function.

case OS_TASK_PEND_ON_MUTEX:
#if (OS_CFG_MUTEX_EN > 0u)
OS_PendListChangePrio(p_tcb);
p_tcb_owner = ((OS_MUTEX *)((void )p_tcb->PendObjPtr))->OwnerTCBPtr;
if (prio_cur > prio_new) { /
Are we increasing the priority? /
if (p_tcb_owner->Prio <= prio_new) { /
Yes, do we need to give this prio to the owner? */
p_tcb_owner = (OS_TCB )0;
} else {
/
Block is empty when trace is disabled. /
OS_TRACE_MUTEX_TASK_PRIO_INHERIT(p_tcb_owner, prio_new);
}
} else {
if (p_tcb_owner->Prio == prio_cur) { /
No, is it required to check for a lower prio? */
prio_new = OS_MutexGrpPrioFindHighest(p_tcb_owner);
prio_new = (prio_new > p_tcb_owner->BasePrio) ? p_tcb_owner->BasePrio : prio_new;
if (prio_new == p_tcb_owner->Prio) {
p_tcb_owner = (OS_TCB )0;
} else {
/
Block is empty when trace is disabled. */
OS_TRACE_MUTEX_TASK_PRIO_DISINHERIT(p_tcb_owner, prio_new);
}
}
A condition to end the loop is missing here
}
#endif
break;

A bug in the OS_FlagTaskRdy funciton (os_flag.c)

I think there is one missing case in this function, which should be added as shown in bold below:
void OS_FlagTaskRdy (OS_TCB p_tcb,
OS_FLAGS flags_rdy,
CPU_TS ts)
{
#if (OS_CFG_TS_EN == 0u)
(void)ts; /
Prevent compiler warning for not using 'ts' */
#endif

p_tcb->FlagsRdy   = flags_rdy;
p_tcb->PendStatus = OS_STATUS_PEND_OK;                      /* Clear pend status                                    */
p_tcb->PendOn     = OS_TASK_PEND_ON_NOTHING;                /* Indicate no longer pending                           */

#if (OS_CFG_TS_EN > 0u)
p_tcb->TS = ts;
#endif
switch (p_tcb->TaskState) {
case OS_TASK_STATE_PEND:
case OS_TASK_STATE_PEND_TIMEOUT:
#if (OS_CFG_TICK_EN > 0u)
if (p_tcb->TaskState == OS_TASK_STATE_PEND_TIMEOUT) {
OS_TickListRemove(p_tcb); /* Remove from tick list /
}
#endif
OS_RdyListInsert(p_tcb); /
Insert the task in the ready list */
p_tcb->TaskState = OS_TASK_STATE_RDY;
break;

    case OS_TASK_STATE_PEND_SUSPENDED:
    case OS_TASK_STATE_PEND_TIMEOUT_SUSPENDED:

#if (OS_CFG_TICK_EN > 0u)
if (p_tcb->TaskState == OS_TASK_STATE_PEND_TIMEOUT) {
OS_TickListRemove(p_tcb);` /
Remove from tick list /
}
#endif

p_tcb->TaskState = OS_TASK_STATE_SUSPENDED;
break;

     case OS_TASK_STATE_RDY:
     case OS_TASK_STATE_DLY:
     case OS_TASK_STATE_DLY_SUSPENDED:
     case OS_TASK_STATE_SUSPENDED:
     default:
                                                            /* Default case.                                        */
         break;
}
OS_PendListRemove(p_tcb);

}
#endif

ARMv7-M : Only push/pop FPU registers if the task context is using it

During a context switch our current OS port for ARMv7-M is pushing/popping FPU registers by default. Therefore, the new improvement will get rid of this and only save/restore those registers if the task is using them. The new modification will improve task context switch time.

Create a template BSP for dynamic tick

We don't currently deliver any template code for users to use dynamic tick.

A proper template must be developed and reviewed before we can include it.

OS3 RISC-V RV32 GCC Port Comment Correction

void  SysTick_Handler (void) {
    CPU_SR_ALLOC();                            /* Allocate storage for CPU status register             */

    CPU_CRITICAL_ENTER();
    OSIntEnter();                              /* Tell uC/OS-II that we are starting an ISR            */
    CPU_CRITICAL_EXIT();

    OSTimeTick();                              /* Call uC/OS-II's OSTimeTick()                         */

    OSIntExit();                               /* Tell uC/OS-II that we are leaving the ISR            */
}

Need to change the comments to indicate OS-III not OS-II

Crash in OSIntExit

I see a crash in OSIntExit on line 372 in os_core.c:

OSTCBHighRdyPtr->CtxSwCtr++;

The reason being that OSTCBHighRdyPtr is 0. It seems this happens when an interrupt occurs while the ready list is being manipulated. For example I had this stack:

-001|OSIntExit()
| cpu_sr = 64
-002|BSP_IntHandler(:int_id = 38)
| int_id = 38
| cpu_sr = 64
-003|BSP_IntHandlerUSART2()
-->|exception
-004|OS_PrioRemove(prio = ?)
| prio = ?
-005|OS_RdyListRemove(p_tcb = 0x20007CA8)
| p_tcb = 0x20007CA8
-006|OSTimeDly(:dly = 100, :opt = 0, :p_err = 0x20008B2E)
| dly = 100
| opt = 0
| p_err = 0x20008B2E
| cpu_sr = 0
-007|OS_StatTask(p_arg = ?)
| p_arg = ?
| err = OS_ERR_NONE
| dly = 100
-008|OS_TaskReturn()
| err = 2056
---|end of frame

The variable OSPrioHighRdy contained 5 in my case, the contents of the ready list was this:

OSRdyList = (
(HeadPtr = 0x0, TailPtr = 0x0, NbrEntries = 0),
(HeadPtr = 0x0, TailPtr = 0x0, NbrEntries = 0),
(HeadPtr = 0x0, TailPtr = 0x0, NbrEntries = 0),
(HeadPtr = 0x0, TailPtr = 0x0, NbrEntries = 0),
(HeadPtr = 0x0, TailPtr = 0x0, NbrEntries = 0),
(HeadPtr = 0x0, TailPtr = 0x0, NbrEntries = 0),
(HeadPtr = 0x0, TailPtr = 0x0, NbrEntries = 0),
(HeadPtr = 0x2000B53C, TailPtr = 0x2000B53C, NbrEntries = 1),
(HeadPtr = 0x0, TailPtr = 0x0, NbrEntries = 0),
(HeadPtr = 0x20007AF8, TailPtr = 0x20007AF8, NbrEntries = 1))

Entry 5 is all zeros. I'm guessing that it had just removed this entry when the interrupt occurred?

Are there any plans for ARMv8-M support?

Hello,

I want run uC-OS3 on STM32H5 which based on ARMv8-M, but I have not found "ARMv8-M" on "Ports" folder.
So, I hope uC-OS3 will support ARMv8-M.

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.