0

i'm reading the definitive guide to ARM cortex-M3 and cortex-M4, i've reached the part where he explains the author explains the how the PendSV works, i'm stuck at the stack creation in the example at context switching in actio nsection page 340, could anybody please explain to me the values he used for initialization : (14<<2) & (15<<2), 0X01000000 and the 16*4 enter image description here

    LED_initialize();
// Starting the task scheduler
// Create stack frame for task0
PSP_array[0] = ((unsigned int) task0_stack)+ (sizeof task0_stack) - 16*4;HW32_REG((PSP_array[0] + (14<<2))) = (unsigned long) task0;
// initial Program Counter
HW32_REG((PSP_array[0] + (15<<2))) = 0x01000000; // initial xPSR

thank you very much for your help !!!!

camelkos
  • 51
  • 5

0 Answers0