chThdSleepX stucks while debugging on STM32F030x4 Topic is solved

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

Moderators: RoccoMarco, barthess

ceremcem
Posts: 67
Joined: Mon Aug 10, 2015 6:57 am
Has thanked: 7 times
Been thanked: 6 times

Re: chThdSleepX stucks while debugging on STM32F030x4

Postby ceremcem » Mon Mar 18, 2019 12:37 pm

@Giovanni Would you please cherry pick the sanity check https://github.com/ChibiOS/ChibiOS/comm ... 7b239221bd into stable_18 branch?

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: chThdSleepX stucks while debugging on STM32F030x4

Postby Giovanni » Mon Mar 18, 2019 1:20 pm

Hi,

The last safe GCC version for Cortex-M0 is 5.4.1. This problem does not affect other Cortex cores.

I will add it to 18.2.x too.

Giovanni

ceremcem
Posts: 67
Joined: Mon Aug 10, 2015 6:57 am
Has thanked: 7 times
Been thanked: 6 times

Re: chThdSleepX stucks while debugging on STM32F030x4

Postby ceremcem » Sun Apr 07, 2019 11:42 pm

For those who face with this problem in the future:

1. Compiling the gcc-arm-none-eabi-5.4.1 from source seems very complicated and currently I've no success: https://unix.stackexchange.com/q/511072/65781
2. Downloading the precompiled toolchain from https://launchpad.net/gcc-arm-embedded/ ... -q3-update and setting the $PATH variable accordingly doesn't work either. Context switch still doesn't work.
3. The best bet (currently working solution) is finding an old Linux installation and using this under a virtual machine.

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: chThdSleepX stucks while debugging on STM32F030x4

Postby Giovanni » Mon Apr 08, 2019 7:39 am

Hi,

The compiler is available from here: https://developer.arm.com/tools-and-sof ... /downloads

It is also included in ChibiStudio.

No need to build anything.

Giovanni

ceremcem
Posts: 67
Joined: Mon Aug 10, 2015 6:57 am
Has thanked: 7 times
Been thanked: 6 times

Re: chThdSleepX stucks while debugging on STM32F030x4

Postby ceremcem » Mon Apr 08, 2019 8:16 am

Hi Giovanni,

I downloaded https://developer.arm.com/-/media/Files ... -q1-update which is the same binary as I downloaded from Launchpad and is not working correctly.

I prefer not to use ChibiStudio since I've created a workflow based on using ChibiOS in command line, so using ChibiStudio is not an option in my case.

Isn't it sufficient to prepend the "/path/to/extracted-toolchain-location/bin" path in front of the PATH environment variable? In my case correct compiler path is resolved:

Code: Select all

(gdb) shell arm-none-eabi-gcc -dumpversion
5.3.1


however context switch still doesn't work. Should I need to make another preparation other then modifying PATH variable?

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: chThdSleepX stucks while debugging on STM32F030x4

Postby Giovanni » Mon Apr 08, 2019 8:43 am

No other preparation, just make sure you are invoking the right compiler if you have multiple instances. It should just work.

Giovanni

ceremcem
Posts: 67
Joined: Mon Aug 10, 2015 6:57 am
Has thanked: 7 times
Been thanked: 6 times

Re: chThdSleepX stucks while debugging on STM32F030x4

Postby ceremcem » Fri Apr 24, 2020 1:42 am

Seems to be resolved in new GCC release.

Code: Select all

From 6c916b07ff6010d1d7c597927be546682ac598bb Mon Sep 17 00:00:00 2001
From: Cerem Cem ASLAN <cem@aktos.io>
Date: Fri, 24 Apr 2020 03:34:41 +0300
Subject: [PATCH] updated GCC bug warning related to Cortex-M0 regarding to the
 fix

---
 os/common/ports/ARMCMx/chcore_v6m.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/os/common/ports/ARMCMx/chcore_v6m.h b/os/common/ports/ARMCMx/chcore_v6m.h
index e43f5030cf..78e76c7576 100644
--- a/os/common/ports/ARMCMx/chcore_v6m.h
+++ b/os/common/ports/ARMCMx/chcore_v6m.h
@@ -128,9 +128,9 @@
 
 /* Handling a GCC problem impacting ARMv6-M.*/
 #if defined(__GNUC__) && !defined(PORT_IGNORE_GCC_VERSION_CHECK)
-#if __GNUC__ > 5
+#if __GNUC__ > 5 && __GNUC__ < 8
 #warning "This compiler has a know problem with Cortex-M0, see bugs: 88167, 88656."
-#warning "*** Use GCC version 5 or below ***"
+#warning "*** Use GCC version (5 or below) or (8 or above) ***"
 #endif
 #endif
 
--
2.20.1

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: chThdSleepX stucks while debugging on STM32F030x4

Postby Giovanni » Fri Apr 24, 2020 5:45 am

Hi,

Careful, GCC version 9-2019-q4 is still affected by the problem.

Giovanni

ceremcem
Posts: 67
Joined: Mon Aug 10, 2015 6:57 am
Has thanked: 7 times
Been thanked: 6 times

Re: chThdSleepX stucks while debugging on STM32F030x4

Postby ceremcem » Fri Apr 24, 2020 1:04 pm

Giovanni wrote:Hi,

Careful, GCC version 9-2019-q4 is still affected by the problem.

Giovanni


Oh, there was an already opened thread for that: viewtopic.php?t=5449&p=37460

Is this a new bug or those fixes didn't fix the problem correctly? Currently my test application performs the context switch correctly. Is it still the same context switch problem?

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: chThdSleepX stucks while debugging on STM32F030x4

Postby Giovanni » Fri Apr 24, 2020 6:24 pm

It is the same problem, context switch thread-to-thread works but it does not reschedule after an interrupt.

Giovanni


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 33 guests