cancel
Showing results for 
Search instead for 
Did you mean: 

BLE_SensorDEMO built in TrueSTUDIO is not working on idb007v1

Posted on February 16, 2018 at 20:28

Hi,

I'm trying to run an example program - BLE_Sensor DEMO - built from sources.

I am using TrueSTUDIO for STM32 (v.9.0.0). The sources are from BlueNRG-1.2_DK_2.6.0 kit.

Unfortunatelly, when I download the image, the board does nothing: no led blinking, no BLE communication.

However, when I download prebuilt image (from Firmware folder in the development kit) it works fine.

What I am doing wrong?

Kind regards,

Piotr
26 REPLIES 26
Posted on February 20, 2018 at 17:22

Yes I post the issue on Atollic forum, but not yet to ST.

Posted on February 20, 2018 at 17:18

Oh - that's a pain.

Have you tried on the Atollic forum?

Have you tried raising a case with ST?

Posted on February 20, 2018 at 22:37

TrueSTUDIO project from ST DevKit has missing architecture option:

   -mcpu=cortex-m0

Without that linked libc contains instructions in ARM mode (but it should be only Thumb - because it is Cortex-M0).

That is why HardFault Exception occured. 

How to fix it

The option should be added in:

   Project Properties | C/C++ Build |Settings, tab Tool Settings

for each group:

  Assembler, C Compiler, C Linker

in Miscellaneouos |Other options field.

Posted on June 15, 2018 at 21:32

Hi,

please select Miscellaneous subgroup in Assembler group, then white architecture option in Other options field.

The same, by analogy, for C and linker.

Regards,

Piotr

Posted on June 15, 2018 at 21:17

I'm new to TrueStudio and am having trouble updating the -mcpu=cortex-m0 option...

In all cases the ''All Options:'' field is grayed out and I'm unable to modify the contents (see attached screenshot). Any ideas on how to get around this?

Thanks!

jay

0690X0000060LERQA2.png
Posted on June 16, 2018 at 01:08

Thanks Piotr,

Just as a note to others still experiencing issues, I didn't have to modify the linker options, it was already configured correctly for me, this can be verified by looking at the 'All options:' field in the 'C Linker' submenu. Trying to add it a second time under the 'Other options' lead to build errors.

However, omitting this still didn't result in a working binary, it would compile fine but wouldn't execute properly. I additionally had to change the Assembler/C compiler/C linker->Target->'instruction set' from 'Thumb2' to 'Thumb'.

After these two changes I was able to compile, flash, and run the st examples.

jay

Posted on June 16, 2018 at 10:16

Hi Jay,

I am surprised that programs were not working with Thumb2 setting. According to ST documentation BlueNRG chips are Cortex-M0, and from ARM Cortex-M0 Technical Reference Manual (rev. r0p0) DDI0432C p.28: 

   'The implemented device provides:

    • A low gate count processor that features:

         — The ARMv6-M Thumb® instruction set.

         — Thumb-2 technology

         [...]'

I saw in gray options field is still -mthumb althrough I set Thumb2 in target instruction set. 

Is there any change in options when you switch from thumb2 to thumb?

Please verify in build console window, comparing the contents for both builds.

Regards,

Piotr
jaylong
Associate II
Posted on June 20, 2018 at 19:39

Hi Piotr,

I'm sorry, you're right. There was no thumb vs thumb2 issue, there must have been some other problem with my previous configuration.

jay

Robert Scholz
Associate II
Posted on June 21, 2018 at 10:06

Hi Piotr,

Thanks for the link.

I still have problem to build a running image for BLUENRG-1

I added -mcpu=cortex-m0 option to Assembler

In case of C-Compiler, -mcpu=cortex-m0 was already set.

In case of Linker I can not add -mcpu. I will get following error:

unrecognised emulation mode: cpu=cortex-m0    BLE_SensorDemo_BlueMSapp             C/C++ Problem

Here my Linker Options:

-Wl,-cref,-u,-Xlinker,--defsym=ST_LINKER_OPTION=1,-mcpu=cortex-m0

What is wrong?

I'm using following example:

STMicroelectronics\BlueNRG-1_2 DK 2.6.0\Project\BLE_Examples\BLE_SensorDemo_BlueMSapp

TrueStudio 9.0.0

Thanks!

Posted on June 21, 2018 at 18:31

Hi Robert,

This is the same problem I was having. I found that -mcpu=cortex-m0 was already set in the 

''All options:'' field in the ''C Linker'' submenu. If you add it a second time using the

''C Linker''->''Miscellaneous''->

''Other options:'' field, it leads to build errors.

Double check the ''All Options:'' field, see attached screenshot showing the -mcpu=cortex-m0 highlighted and already set. If it shows up here, you shouldn't need to add it using the Miscellaneous submenu.

jay

0690X0000060LMoQAM.png