probable a bug in stm32f4xx code

Forum related to ERIKA Enterprise and RT-Druid version 2

Moderator: paolo.gai

Locked
tfan

probable a bug in stm32f4xx code

Post 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.
paolo.gai
Administrator
Posts: 877
Joined: Thu Dec 07, 2006 12:11 pm

Re: probable a bug in stm32f4xx code

Post 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
tfan

Re: probable a bug in stm32f4xx code

Post 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
paolo.gai
Administrator
Posts: 877
Joined: Thu Dec 07, 2006 12:11 pm

Re: probable a bug in stm32f4xx code

Post 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
Locked