# freeRTOS Demo Fails to Build under TrueStudio

**URL:** <https://forums.freertos.org/t/freertos-demo-fails-to-build-under-truestudio/7666>\
**Category:** Kernel\
**Created:** [February 11, 2019, 6:07am UTC](https://forums.freertos.org/t/freertos-demo-fails-to-build-under-truestudio/7666 "2019-02-11T06:07:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [February 11, 2019, 6:07am UTC](https://forums.freertos.org/t/freertos-demo-fails-to-build-under-truestudio/7666/1 "2019-02-11T06:07:00Z")

</div>

**[tma16](https://sourceforge.net/u/tma16/)** wrote on [Monday, February 11, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/7562eca3ee/#32b4):

Greetings:

DemoName: CORTEX\_STM32F100\_Atollic  
FreeRTOS version: 10.1.1  
TrueStudio version: 9.2.0

```
When I import and then try to build the above demo project I get an error message stating that I need to run the directory structure build batch file first which I did in fact do. The ***FreeRTOSSource*** subdirectory is created in the project directory and files appear within the subdirectories confirming that the batch process completed OK.

If I comment out the error trap code and re-build there are 53 errors reported.     
Three errors similar to this:

                                    lo register required -- `ldmia r0!,{r4-r11}'	

```

Fifty errors similar to this:

```
                                    selected processor does not support `dsb ' in Thumb mode	

```

Is this the proper forum to report Demo project problems to? If not please direct me to where I can get support for this.

Thanks  
tma

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [February 11, 2019, 5:14pm UTC](https://forums.freertos.org/t/freertos-demo-fails-to-build-under-truestudio/7666/2 "2019-02-11T17:14:36Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Monday, February 11, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/7562eca3ee/#32b4/234b):

This looks like a mismatch between the MCU architecture the assembly  
code is written for, and the MCU architecture the compiler is being told  
it is building code for. In other words, it looks like the compiler’s  
command line options are wrong. I’m not sure why this would be -  
perhaps it is an incompatibility in TrueStudio versions in regards to  
how it saves options in its project. Check the command line generated  
by the tool, which you will be able to see as the project builds, and  
also look at the target settings in the tool itself to ensure it matches  
the target you are building for (it looks like it is trying to build for  
a Cortex-M0).

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [February 12, 2019, 5:58am UTC](https://forums.freertos.org/t/freertos-demo-fails-to-build-under-truestudio/7666/3 "2019-02-12T05:58:41Z")

</div>

**[tma16](https://sourceforge.net/u/tma16/)** wrote on [Tuesday, February 12, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/7562eca3ee/#7eca):

Greetings Richard,

Thank you for your support! It turned out to be a target mismatch between  
TrueStudio and the demo. I had presumed it was setup by the demo  
but found I needed to specify the specific STM32 MPU within  
the TrueStudio project settings.

However once I corrected the MPU ID it still would not build. I got two new  
errors similar to the one below. With an online search I discovered a fix

- this info may be of interest to you:

“register may not be same – ‘strexb r3,r2,[r3]’”

The modification described at the link below fixed the problem. The  
procedure involves modifying one of the core files within the demo  
project directory:

[http://letzbecreative.blogspot.com/2015/07/solve-arm-gcc-error-register-may-not-be.html](http://letzbecreative.blogspot.com/2015/07/solve-arm-gcc-error-register-may-not-be.html)

It now builds without error for the stm32f103c8t6 MPU but I wonder if  
this code change is a proper fix for the bug. Note the demo is for a board  
equipped with the lesser memory stm32f100 MPU of the same family. I  
think unlikely that this error occurred because of the MPU difference  
but I suppose possible.

Thanks Again!  
tma

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [February 12, 2019, 7:14pm UTC](https://forums.freertos.org/t/freertos-demo-fails-to-build-under-truestudio/7666/4 "2019-02-12T19:14:55Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Tuesday, February 12, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/7562eca3ee/#7eca/be1d):

Is the ‘register may not be the same’ error in our port code? Or in a  
cmsis file that ships with our demo? I think the latter we don’t use  
that asm instruction.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [February 12, 2019, 7:24pm UTC](https://forums.freertos.org/t/freertos-demo-fails-to-build-under-truestudio/7666/5 "2019-02-12T19:24:09Z")

</div>

**[tma16](https://sourceforge.net/u/tma16/)** wrote on [Tuesday, February 12, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/7562eca3ee/#52e0):

It is in:

“Demo\CORTEX\_STM32F100\_Atollic\Libraries\CMSIS\CM3\CoreSupport\core\_cm3.c”

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [February 12, 2019, 7:29pm UTC](https://forums.freertos.org/t/freertos-demo-fails-to-build-under-truestudio/7666/6 "2019-02-12T19:29:56Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Tuesday, February 12, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/7562eca3ee/#52e0/016d):

Got it, thanks, seems to be multiple copies of this in various demos.
