Skip to main content
Fix title, formatting, capitalise "I"
Source Link
David
  • 4.6k
  • 2
  • 29
  • 46

context Context switching and systic handlersystick handling on the STM32F series

iI am using stm32f407a STM32F407 board,building to build my own tiny RTOS i and I have some questions

1-how to define my own stack in different memory location one for each queue of tasks? i need example.

2-how to push and pop to those stacks at systick handler ,what registers, i need example

  1. How can I define my own stack in different memory location, so I can have one stack for each queue of tasks?

  2. How do I push and pop to those stacks in my systick handler, what registers?

  3. Systick handler works fine for me, but when I put a function in an infinite while loop it stops working, why is this?

3-systick handler works fine for me ,whenExample code for testing i put a function in an infinite while loop ,it stop works,why???1 and 2 would be very appreciated.

'code'My current code is below:

#ifdef __cplusplus
extern "C" {
#endif
void SysTick_Handler(void) {
    /*1-Mask all interrupts except for E programs dependency*/
    OSD_maskUnE_Interuppts();
    OSD_SystimerISR();
}
#ifdef __cplusplus
}
#endif

int main(void) {
    SystemCoreClockUpdate();
    SysTick_Config(SystemCoreClock / 100);

    while (1) {}

    return 0;
}

context switching and systic handler

i am using stm32f407 board,building my own tiny RTOS i have some questions

1-how to define my own stack in different memory location one for each queue of tasks? i need example

2-how to push and pop to those stacks at systick handler ,what registers, i need example

3-systick handler works fine for me ,when for testing i put a function in an infinite while loop ,it stop works,why???

'code'

#ifdef __cplusplus
extern "C" {
#endif
void SysTick_Handler(void) {
    /*1-Mask all interrupts except for E programs dependency*/
    OSD_maskUnE_Interuppts();
    OSD_SystimerISR();
}
#ifdef __cplusplus
}
#endif

int main(void) {
    SystemCoreClockUpdate();
    SysTick_Config(SystemCoreClock / 100);

    while (1) {}

    return 0;
}

Context switching and systick handling on the STM32F series

I am using a STM32F407 board to build my own tiny RTOS and I have some questions.

  1. How can I define my own stack in different memory location, so I can have one stack for each queue of tasks?

  2. How do I push and pop to those stacks in my systick handler, what registers?

  3. Systick handler works fine for me, but when I put a function in an infinite while loop it stops working, why is this?

Example code for 1 and 2 would be very appreciated.

My current code is below:

#ifdef __cplusplus
extern "C" {
#endif
void SysTick_Handler(void) {
    /*1-Mask all interrupts except for E programs dependency*/
    OSD_maskUnE_Interuppts();
    OSD_SystimerISR();
}
#ifdef __cplusplus
}
#endif

int main(void) {
    SystemCoreClockUpdate();
    SysTick_Config(SystemCoreClock / 100);

    while (1) {}

    return 0;
}
added 63 characters in body
Source Link
Majenko
  • 56.7k
  • 10
  • 111
  • 195

i am using stm32f407 board,building my own tiny RTOS i have some questions

1-how to define my own stack in different memory location one for each queue of tasks? i need example

2-how to push and pop to those stacks at systick handler ,what registers, i need example

3-systick handler works fine for me ,when for testing i put a function in an infinite while loop ,it stop works,why???

'code' #ifdef __cplusplus extern "C" { #endif void SysTick_Handler(void) { /1-Mask all interrupts except for E programs dependency/ OSD_maskUnE_Interuppts(); OSD_SystimerISR();
} #ifdef __cplusplus } #endif

int main(void) { SystemCoreClockUpdate();

SysTick_Config(SystemCoreClock/100);

while(1) {}

return 0;

}

#ifdef __cplusplus
extern "C" {
#endif
void SysTick_Handler(void) {
    /*1-Mask all interrupts except for E programs dependency*/
    OSD_maskUnE_Interuppts();
    OSD_SystimerISR();
}
#ifdef __cplusplus
}
#endif

int main(void) {
    SystemCoreClockUpdate();
    SysTick_Config(SystemCoreClock / 100);

    while (1) {}

    return 0;
}

i am using stm32f407 board,building my own tiny RTOS i have some questions

1-how to define my own stack in different memory location one for each queue of tasks? i need example

2-how to push and pop to those stacks at systick handler ,what registers, i need example

3-systick handler works fine for me ,when for testing i put a function in an infinite while loop ,it stop works,why???

'code' #ifdef __cplusplus extern "C" { #endif void SysTick_Handler(void) { /1-Mask all interrupts except for E programs dependency/ OSD_maskUnE_Interuppts(); OSD_SystimerISR();
} #ifdef __cplusplus } #endif

int main(void) { SystemCoreClockUpdate();

SysTick_Config(SystemCoreClock/100);

while(1) {}

return 0;

}

i am using stm32f407 board,building my own tiny RTOS i have some questions

1-how to define my own stack in different memory location one for each queue of tasks? i need example

2-how to push and pop to those stacks at systick handler ,what registers, i need example

3-systick handler works fine for me ,when for testing i put a function in an infinite while loop ,it stop works,why???

'code'

#ifdef __cplusplus
extern "C" {
#endif
void SysTick_Handler(void) {
    /*1-Mask all interrupts except for E programs dependency*/
    OSD_maskUnE_Interuppts();
    OSD_SystimerISR();
}
#ifdef __cplusplus
}
#endif

int main(void) {
    SystemCoreClockUpdate();
    SysTick_Config(SystemCoreClock / 100);

    while (1) {}

    return 0;
}
added 371 characters in body
Source Link

i am using stm32f407 board,building my own tiny RTOS i have some questions

1-how to define my own stack in different memory location one for each queue of tasks? i need example

2-how to push and pop to those stacks at systick handler ,what registers, i need example

3-systick handler works fine for me ,when for testing i put a function in an infinite while loop ,it stop works,why???

'code' #ifdef __cplusplus extern "C" { #endif void SysTick_Handler(void) { /1-Mask all interrupts except for E programs dependency/ OSD_maskUnE_Interuppts(); OSD_SystimerISR();
} #ifdef __cplusplus } #endif

int main(void) { SystemCoreClockUpdate();

SysTick_Config(SystemCoreClock/100);

while(1) {}

return 0;

}

i am using stm32f407 board,building my own tiny RTOS i have some questions

1-how to define my own stack in different memory location one for each queue of tasks? i need example

2-how to push and pop to those stacks at systick handler ,what registers, i need example

3-systick handler works fine for me ,when for testing i put a function in an infinite while loop ,it stop works,why???

i am using stm32f407 board,building my own tiny RTOS i have some questions

1-how to define my own stack in different memory location one for each queue of tasks? i need example

2-how to push and pop to those stacks at systick handler ,what registers, i need example

3-systick handler works fine for me ,when for testing i put a function in an infinite while loop ,it stop works,why???

'code' #ifdef __cplusplus extern "C" { #endif void SysTick_Handler(void) { /1-Mask all interrupts except for E programs dependency/ OSD_maskUnE_Interuppts(); OSD_SystimerISR();
} #ifdef __cplusplus } #endif

int main(void) { SystemCoreClockUpdate();

SysTick_Config(SystemCoreClock/100);

while(1) {}

return 0;

}

Source Link
Loading