Skip to main content
Piotr Romaniuk
Senior
February 16, 2018
Solved

BLE_SensorDEMO built in TrueSTUDIO is not working on idb007v1

  • February 16, 2018
  • 13 replies
  • 4400 views
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
This topic has been closed for replies.
Best answer by Piotr Romaniuk
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.

13 replies

thoe
Explorer
August 10, 2018

Thanks for sharing this solution @Piotr Romaniuk​ , @Robert Scholz​ , works for me.

(The problem still exists in BlueNRG-1_2 DK 3.0.0.)

DCarl
Associate
September 7, 2018

Thank you all for presenting this issue in detail!

I agree that even with BlueNRG-1_2 DK 3.0.0. and TrueStudio 9.0.1 none of the dev kit BLE examples will run even though they appear to build and load without error.

Using the -mcpu=cortex-m0 option as described above instantly fixes the problem. In my case I added it to the Assembler and Linker tool options. the -mcpu=cortex-m0 optoion was already in the Compiler options for the BlueMS App compatible example.

I do not think I would have ever figured this out on my own. Thank you again!

Dilbert K
Associate III
September 15, 2018

Thanks for great info...

I got passed the "crashing issue" but using STlink-V2 + TrueStudio 9.0,1 + BlueMS App still could not run using debugger.

Is there a way to update the STLink "Connection Settings" in TrueStudio ?

e.g. SWD : Frequency and Mode : Connect with Pre-Reset

I loaded the hex file build using update options with "BlueNRG-1 ST-Link Utility",

the code does run as I can connect to BLE.