Page 2 of 2

Re: chThdSleepX stucks while debugging on STM32F030x4

Posted: Mon Mar 18, 2019 12:37 pm
by ceremcem
@Giovanni Would you please cherry pick the sanity check https://github.com/ChibiOS/ChibiOS/comm ... 7b239221bd into stable_18 branch?

Re: chThdSleepX stucks while debugging on STM32F030x4

Posted: Mon Mar 18, 2019 1:20 pm
by Giovanni
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

Re: chThdSleepX stucks while debugging on STM32F030x4

Posted: Sun Apr 07, 2019 11:42 pm
by ceremcem
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.

Re: chThdSleepX stucks while debugging on STM32F030x4

Posted: Mon Apr 08, 2019 7:39 am
by Giovanni
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

Re: chThdSleepX stucks while debugging on STM32F030x4

Posted: Mon Apr 08, 2019 8:16 am
by ceremcem
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?

Re: chThdSleepX stucks while debugging on STM32F030x4

Posted: Mon Apr 08, 2019 8:43 am
by Giovanni
No other preparation, just make sure you are invoking the right compiler if you have multiple instances. It should just work.

Giovanni

Re: chThdSleepX stucks while debugging on STM32F030x4

Posted: Fri Apr 24, 2020 1:42 am
by ceremcem
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

Re: chThdSleepX stucks while debugging on STM32F030x4

Posted: Fri Apr 24, 2020 5:45 am
by Giovanni
Hi,

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

Giovanni

Re: chThdSleepX stucks while debugging on STM32F030x4

Posted: Fri Apr 24, 2020 1:04 pm
by ceremcem
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?

Re: chThdSleepX stucks while debugging on STM32F030x4

Posted: Fri Apr 24, 2020 6:24 pm
by Giovanni
It is the same problem, context switch thread-to-thread works but it does not reschedule after an interrupt.

Giovanni