Useful questions to determine whether or not to mock
- Is the real collaborator a source of risk for the stability of my tests?
- Is it difficult to initialize the real collaborator?
- Is it possible to verify the state of the collaborator after the test, to decide the test status?
- How long will it take for the collaborator to respond?
3 Straightforward Reasons to Mock
1. Collaborator not yet implemented or still under development
2. Hardware independence
3. Fault injection
System Configuration covers system-wide settings for the global memory pool, tick frequency, ISR event buffer and round-robin thread switching.
Thread Configuration provides several parameters to configure the Thread Management functions.
Timer Configuration provides several parameters to configure the Timer Management functions.
Event Flags Configuration provides several parameters to configure the Event Flags functions.
Mutex Configuration provides several parameters to configure the Mutex Management functions.
Semaphore Configuration provides several parameters to configure the Semaphores functions.
Memory Pool Configuration provides several parameters to configure the Memory Pool functions.
Message Queue Configuration provides several parameters to configure the Message Queue functions.
Event Recorder Configuration provides several parameters to configure RTX for usage with Event Recorder.
技术参数
RTX内核内存使用,比较ARM7/9和CortexM
Description ARM7™/ARM9™ Cortex™-M
Defined Tasks Unlimited Unlimited
Active Tasks 250 max 250 max
Mailboxes Unlimited Unlimited
Semaphores Unlimited Unlimited
Mutexes Unlimited Unlimited
Signals / Events 16 per task 16 per task
User Timers Unlimited Unlimited
Code Space <4.2 Kbytes <4.0 Kbytes
RAM Space for Kernel 300 bytes +
80 bytes User Stack
300 bytes +
128 bytes Main Stack
RAM Space for a Task TaskStackSize + 52 bytes TaskStackSize + 52 bytes
RAM Space for a Mailbox MaxMessages * 4 + 16 bytes MaxMessages * 4 + 16 bytes
RAM Space for a Semaphore 8 bytes 8 bytes
RAM Space for a Mutex 12 bytes 12 bytes
RAM Space for a User Timer 8 bytes 8 bytes
Hardware Requirements One on-chip timer SysTick timer
User task priorities 1 - 254 1 - 254
Task switch time <5.3 μsec @ 60 MHz <2.6 μsec @ 72 MHz
Interrupt lockout time <2.7 μsec @ 60 MHz Not disabled by RTX
Keil RTX v5 kernel functions are executed in handler mode (using PendSV/SysTick/SVC) and the tables below lists the maximum stack requirements for the Main Stack (MSP) that the user should consider.
The stack for the osKernelStart function is referred as "Startup" and RTX v5 uses 32 bytes (with Arm Compiler). However the user should also consider additional stack that might be allocated by the 'main' function of the embedded application. The following picture shows a worst-case memory allocation of the Main Stack.
Arm Compiler ARMCC V6.10
Arm Compiler ARMCC V5.06
Determining the required stack sizes for a software project is a crucial part of the development process. The developer aims to create a stable application, while not wasting resources. This application note explains methods that help finding the optimal setting while looking specifically on the stack load caused by interrupt service routines (ISRs) in RTOS applications running on an Arm Cortex-M based processor.
Stacks are memory regions where data is added or removed in a last-in-first-out (LIFO) manner. In an RTOS, each thread has a separate memory region for its stack. During function execution, data may be added on top of the stack; when the function exits, it removes that data from the stack.
Energy optimization of a battery-powered device Optimizing embedded applications for overall efficiency should be an integral part of the development process as it is important to understand how peripherals, software algorithms, and power saving modes work together.
This application note describes the power consumption analysis of an L-Tek FF1502 Bluetooth Low Energy (BLE) beacon with ULINKplus. Beacons are typically low power devices, which sleep most of the time and wake-up briefly to broadcast a message to nearby portable electronic devices (such as mobile phones for example). We’ll
show how to analyze the battery lifetime of an application running on the beacon by using the ULINKplus debug adapter that enables high-precision power analysis together with Arm® Keil® MDK. The findings are used to improve the hardware design and to implement software changes that lead to reduced power consumption and longer battery life.
In this application note, we show how to use ULINKplus to dramatically reduce the power consumption of a battery-driven IoT application. Using this versatile debug probe together with the latest debug features of µVision, it is possible to increase the battery lifetime from just under a year (358 days) to nearly two and a half years (863 days).
流行测试framework比较
September 2018: Testing Embedded Systems
Testing Embedded Systems
1. Unit testing
2. Debugger-based testing using metal.test
3. Phil Koopman’s lectures on embedded software quality and testing
In this project we will walk you through the process of building OpenOCD on Linux to work with Launchpad, debugging a project with GDB, and modifying the project
behavior. OpenOCD opens up debug level development with GDB and GNU tools, but the current stable version does not have Launchpad support. Using this method of
building the stable version with a patch provided by Spencer Oliver, we will be able to run OpenOCD with Launchpad support.