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 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-02-20 01:26 AM
when I download the image, the board does nothing
It's almost certainly doing something - so connect the debugger, and find out what it's doing!
2018-02-20 02:03 AM
Hi Andrew,
I did, but debugging from TrueStudio, does not work either!
Please read my question:
https://community.st.com/0D50X00009Xkht2SAB
I expected that reference design from ST should work, but not to be debugged.
My configuration constains: - the board from ST, - TrueSTUDIO (ST recommended as one of the IDE)- development kit from ST (library and TrueStudio project)
- jtag/programmer from ST
Regards,
Piotr2018-02-20 02:12 AM
OP? What does it mean?
2018-02-20 03:09 AM
romaniuk.piotr wrote:
I did, but debugging from TrueStudio, does not work either!
Please read my question:
https://community.st.com/0D50X00009Xkht2SAB
Would have been helpful to include that in the OP, then.
2018-02-20 03:27 AM
'Original Post', or 'Opening Post'
Also used as 'Original Poster', or 'Opening Poster'
2018-02-20 06:21 AM
Closer look to program execution show that it does not return to main() from BlueNRG_Stack_Initialization().
Inside the function HardFault exception is generated.
Here is a stack trace:
[...]
main()
BlueNRG_Stack_Initialization
BlueNRG_Stack_Perform_Crystal_Check
BlueNRG_Stack_Initialize_Layers
PM_init
exception in __aeabi_fdiv() => HardFaultHandler
pc = 10041722 HardFault Handler
msp = 0x2000.5f98
2000.5f98 36 R0 <- msp points here
2000.5f9c 0 R1
2000.5fa0 0350.0000 R2
2000.5fa4 0000.6c00 R3
2000.5fa8 0000.0018 R12
2000.5fac 1004.705f LR - would return to PM_init
2000.5fb0 1004.08d8 in __aeabi_fdiv <--- exception location
2000.5fb4 0100.0000
2000.5fb8 2000.094c
2000.5fbc 2000.08d4
2000.5fc0 2000.094c
2000.5fc4 1004.1dc1 in BlueNRG_Stack_Initialize_Layers
2000.5fc8 2000.094c
2000.5fcc 0000.0040
2000.5fd0 0000.0001
2000.5fd4 1004.1feb in BlueNRG_Stack_Perform_Crystal_Check
2000.5fd8 2000.2604
2000.5fdc 0
2000.5fe0 0
2000.5fe4 ffff.ffff
2000.5fe8 ffff.ffff
2000.5fec 1004.1d51 in BlueNRG_Stack_Initialization
2000.5ff0 1004.b580
2000.5ff4 1004.17bb
2000.5ff8 1004.b580
2000.5ffc 1004.14fd
2018-02-20 07:32 AM
Unfortunatelly not. I still cannot debug from TrueSTUDIO IDE.
Above data is from BlueNRG-ST-Link Utility. This tool has very limitted functionality, but enough for getting ARM core register and RAM contents.I have taken function names from a listing generated by the linker.
2018-02-20 08:00 AM
romaniuk.piotr wrote:
exception in __aeabi_fdiv() => HardFaultHandler
Sounds like something to do with Floating Point - so check your FP setup.
Trying to do hardware FP on a chip with no FP HW probably would give a Hard Fault ...
2018-02-20 08:01 AM
romaniuk.piotr wrote:
Closer look to program execution show that it does not return to main() from BlueNRG_Stack_Initialization().
Inside the function HardFault exception is generated.
Does this mean you've got the debugger to work, then?