Page 1 of 1

probable a bug in stm32f4xx code

Posted: Thu Apr 10, 2014 10:26 am
by tfan
Hi, I am just newly to use ERIKA RTOS, try to run the example in porting_examples_GNU\monostack\EEtest08 for stm32f4xx, and found a tiny bug,
in cpu\cortex_mx\src\ee_contex.c, the original code is as below

#ifdef __MONO__
void EE_cortex_mx_change_context(EE_TID tid)
{
do {
tid = EE_std_run_task_code(tid);
} while (EE_std_need_context_change(tid));
}
#endif /* __MONO__ */

when both tasks are termiated, the tid=-1, calling EE_cortex_mx_change_context in ISR without checking tid will cause system crash. I modified the code to:

#ifdef __MONO__
void EE_cortex_mx_change_context(EE_TID tid)
{
while (EE_std_need_context_change(tid)) {
tid = EE_std_run_task_code(tid);
}
}
#endif /* __MONO__ */

and it's working for stm32f407 discovery board now . Could someone take a look, if there are any side effects.
BTW, I've made a stm32f2xx porting, thanks to the elegant code, I just need to comment out 1 line of code.

Re: probable a bug in stm32f4xx code

Posted: Thu Apr 10, 2014 2:26 pm
by paolo.gai
Thanks for the report. It could be a bug in the assembly part which is part of the porting of the STM32F4.

We'll make a check on it.

Could you confirm that you are running the latest plugins (please update the latest ones just published on the nightly builds for 2.3.0nb), and that the problem appears on porting_examples_GNU\monostack\EEtest08 ?

Thanks again,

PJ

Re: probable a bug in stm32f4xx code

Posted: Thu Apr 10, 2014 3:41 pm
by tfan
No worries, PJ,

Actually, I'm using GNU ARM plugin for eclipse CDT(Kepler) instead of EE, and yes, the example I've tested is the "porting_examples_GNU\monostack\EEtest08", I reckon it will be the same for all monostack examples.

Regards,

Tom Fan

Re: probable a bug in stm32f4xx code

Posted: Thu Apr 10, 2014 3:50 pm
by paolo.gai
ok. so I guess you are running teh configurator from command-line...

The test is the same for all architectures. Probably I guess an error on the implementation of the assembly part. I talked to the people in the University who did the porting, hopefully there will be an answer soon...

PJ