Comments (4)
Hello,
You mean that the context switching is done by the PendSV handler I guess?
Best regards
from trampoline.
Yes, because I saw a lot of sample, the context switch all run on systick or timer.
from trampoline.
I still don't understand what you are saying. If the context switch occurs in the Systick or timer handler then it does not occur in the PendSV handler.
If you mean that the context switch occurs in the PendSV handler and the PendSV was triggered by the Systick or Timer handler then I don't see the point of invoking a PendSV rather than doing the context switch directly at the end of the Systick or Timer handler.
Also, I doubt that context switching is only done asynchronously in the handler of a hardware IT. When a synchronous system call leads to a context switch, it should be done immediately, not 1ms later (at worst).
from trampoline.
Thanks for your information!!
That's my first time to investigate the automotive indudtry.
Because sometime the "systick interrupt" and "hardware interrupt" can occur simultaneously , (e.g: uart, spi, button, hardware fault...), so some os can set the systick's priority be lower than other hardware interrupt, then if the systick triggered, it can enable the pendsv interrupt, then do context switch in pendsv.
Below is sample code..
void xPortSysTickHandler( void )
{
/* The SysTick runs at the lowest interrupt priority, so when this interrupt
executes all interrupts must be unmasked. There is therefore no need to
save and then restore the interrupt mask value as its value is already
known.
*/
portDISABLE_INTERRUPTS();
{
/*
Increment the RTOS tick.
*/
if( xTaskIncrementTick() != pdFALSE )
{
/*
A context switch is required. Context switching is performed in
the PendSV interrupt. Pend the PendSV interrupt.
*/
portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;
}
}
/*
Enable interrupt, increntment pensv ISR.
*/
portENABLE_INTERRUPTS();
}
BaseType_t xTaskIncrementTick( void )
{
/// do context switch....
}
Or we just need to set ISR1 or ISR2 on trampline, is it correct?
from trampoline.
Related Issues (20)
- Trampoline FPU armv7 HOT 1
- Does trampoline compatible with Raspberry PI 3(BCM2837) HOT 2
- arm-none-eabi-ld: warning: blink_exe has a LOAD segment with RWX permissions HOT 2
- examples HOT 5
- Trampoline with IDE (KeilC/IAR) HOT 5
- Readbutton_isr example, (osConst) conflict with (osVar) HOT 2
- Le cas de communication samd21 et raspberry ne fonctionne pas HOT 18
- sprintf
- [RFC] CAN and CAN FD stack HOT 5
- [examples] [posix] [ioc] incorrect format specifier
- [os] [tpl_os_timeobj_kernel] Uninitialized variable
- Unbounded write by strcpy HOT 2
- [templates] Invalid linker script generation when using AUTOSAR Application
- ARM Cortex directories naming HOT 10
- How can i generate c file from oil config file ? HOT 3
- Multiple POSIX targets HOT 6
- Example build issue : Teensy 3.1 isr1onFTM HOT 4
- Example build issue : Teensy 3.1 isr2onExternalInterrupt HOT 1
- Example build issue : Teensy 3.1 isr2onPIT HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trampoline.