2018-02-16 11:28 AM
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,
PiotrSolved! Go to Solution.
2018-02-20 08:22 AM
Yes I post the issue on Atollic forum, but not yet to ST.
2018-02-20 09:18 AM
Oh - that's a pain.
Have you tried on the Atollic forum?
Have you tried raising a case with ST?
2018-02-20 01:37 PM
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.
2018-06-15 12:32 PM
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
2018-06-15 02:17 PM
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
2018-06-15 06:08 PM
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
2018-06-16 03:16 AM
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,
Piotr2018-06-20 10:39 AM
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
2018-06-21 01:06 AM
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!
2018-06-21 11:31 AM
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