chThdSleepMilliseconds doesnt return

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

stanley
Posts: 2
Joined: Thu Oct 03, 2013 6:56 am

chThdSleepMilliseconds doesnt return

Post by stanley »

Hi,
My Environment details:
Chibios - 2.6.4
Hardware - STM32F4 Discovery Board
Toolchain - Rowley Crossworks
OS - Windows 8
I am using the STM32F4 discovery board chibios demo, after calling chThdSleepMilliseconds() function processor never returns and when I debug it stops at
_Idle_Thread() function.
There are no exceptions code just runs fine but chThdSleepMilliseconds() doesnt return after the specified timeout period.

Your help is appreciated.

Thanks
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: chThdSleepMilliseconds doesnt return

Post by Giovanni »

hi,

The only cause for what you are experiencing is the CPU not serving interrupts. This could be related to your toolchain.

Could you give a try to ChibiStudio? just to rule out a possible problem.

Unzip it under C:\ and it is ready: http://sourceforge.net/projects/chibios ... ibiStudio/

Giovanni
stanley
Posts: 2
Joined: Thu Oct 03, 2013 6:56 am

Re: chThdSleepMilliseconds doesnt return

Post by stanley »

Hi,
I will try chibistudio, in the meantime I tried with Keil it works fine.
I added ISR routine for systick in crossworks and ISR is getting called without issues.
Pavel
Posts: 3
Joined: Mon Oct 07, 2013 1:49 pm

Re: chThdSleepMilliseconds doesnt return

Post by Pavel »

Hello!
I had the same problem while I use stlink gdb server.
I've solved this problem by using openOCD.
Pavel
alexlesuper
Posts: 10
Joined: Tue Oct 15, 2013 3:52 pm

Re: chThdSleepMilliseconds doesnt return

Post by alexlesuper »

I am getting the same problem using ChibiOS and Rowley Crossworks. My program goes to sleep and waits for an interrupt except it never happens. The same program in Keil runs fine.

Does anyone have an idea of how this is happening?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: chThdSleepMilliseconds doesnt return

Post by Giovanni »

Sorry no idea, it could be some hidden initialization performed by the Rowley library/compiler preventing the system tick interrupt.

I imagine you are using the GCC port, the answer must be in differences between the Rowley compiler and a "normal" GCC.

Giovanni
Legath
Posts: 21
Joined: Thu Oct 17, 2013 3:24 pm

Re: chThdSleepMilliseconds doesnt return

Post by Legath »

Hi all,

i have found the same issue on stm32f3discovery, i use last stable from 2.6.x git branch.
my toolchain is https://launchpad.net/gcc-arm-embedded
in project settings i have set softfp and fpv4-sp-d16 options.
earlier i used own toolchain built with ct-ng, and did not have this issue.
i will try to build new toolchain and test again.

Thanks
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: chThdSleepMilliseconds doesnt return

Post by Giovanni »

I assume you are not using the provided makefiles, correct?

Giovanni
Legath
Posts: 21
Joined: Thu Oct 17, 2013 3:24 pm

Re: chThdSleepMilliseconds doesnt return

Post by Legath »

Hi,

yes, i use eclipse project, without makefile.



Thanks
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: chThdSleepMilliseconds doesnt return

Post by Giovanni »

Are you using the provided linker scripts and startup files? if not then probably the problem is there.

Note, most projects contain Eclipse project files (.project, .cproject) that use the Makefile, much more efficient that normal CDT projects.

Giovanni
Post Reply