startup edit in lpc2138

hai all,

I m doing rtos programming which is based on osek standard for LPC2138.
In that i need to enter the supervisor mode for running the tasks & all my code must runs under svc mode. but main prog is running in user mode if i use the startup.s in the keil.
so i had changed the startup.s to run the main in svc mode by commenting the usermode stack initialization. Now it is running under SVC mode. but the problem is when i enter into IRQ mode i call some user functions through asm & changing the mode into SVC to save task stack back into IRQ mode , at that time the global variables are changed.Pls give some tech ass regarding this issue.(I need the global variables won't change )

Thanks in advance,

yos

Parents
  • hoolala what a mess :-)

    what do you need SVC mode for to manage tasks? If you are in IRQ mode already - that is a privileged mode - what stops you from doing all the administration in that mode? the processor starts up in SVC mode and switches to user when reaching main. you don't need to change the startup code to have this behavior. the problem with your global variables could be the result of a task preemption/interrupt.

    In that i need to enter the supervisor mode for running the tasks & all my code must runs under svc mode

    err, what? what stops you from doing everything in user mode excepted the context switch itself?

    but main prog is running in user mode if i use the startup.s in the keil.

    as it should. that is the ARM design philosophy!
    exit from user mode can only occur by an exception. stop bending the rules...

Reply
  • hoolala what a mess :-)

    what do you need SVC mode for to manage tasks? If you are in IRQ mode already - that is a privileged mode - what stops you from doing all the administration in that mode? the processor starts up in SVC mode and switches to user when reaching main. you don't need to change the startup code to have this behavior. the problem with your global variables could be the result of a task preemption/interrupt.

    In that i need to enter the supervisor mode for running the tasks & all my code must runs under svc mode

    err, what? what stops you from doing everything in user mode excepted the context switch itself?

    but main prog is running in user mode if i use the startup.s in the keil.

    as it should. that is the ARM design philosophy!
    exit from user mode can only occur by an exception. stop bending the rules...

Children
More questions in this forum