I am currently successfully compiling and executing the ‘sleep_manager_power_mode’ HAL example code in the Keil IDE (v18.104.22.168) on a LinkIt 2523 HDK board. I am using SDK 4.6.1
I have made no modifications to my LinkIt board, which means all jumpers are in their default positions.
I have made the following small mods to the code
1. All debug comes out of UART0 (because that what I want)
a. I have added a call to ‘hal_sleep_manager_is_sleep_locked()’ to make sure sleep is unlocked
2. I have added code to check the return values of the following related functions
i) I erased flash completely before downloading my app
ii) I am using the MK20 USB connection to power the board ad update flash
iii) I am using UART0 to look at my debug o/p (bootloader and app have been updated to support this)
3. After calling ‘hal_sleep_manager_enter_sleep_mode()’ the code runs for a little and then enters the hard fault handler ‘Hard_Fault_Handler()’.
At the end of this issue description is a screen shot of the debug o/p.
The important lines are typed below FYI
In Hard Fault Handler
SCB->HFSR = 0x40000000
Forced Hard Fault
SCB->CFSR = 0x00000001
Memory Management fault: MPU or Execute Never (XN) default memory map ac
r0 = 0x0400afb1
r1 = 0xa2010314
r2 = 0xa0150000
r3 = 0x0011e103
r4 = 0x00000002
r5 = 0x00000003
r6 = 0x00000001
r7 = 0xa5a5a5a5
r8 = 0x00000002
r9 = 0xa5a5a5a5
r10 = 0xa5a5a5a5
r11 = 0xa5a5a5a5
r12 = 0x0801b59d
lr = 0x0400afb1
pc = 0xa5a5a5a4
psr = 0x81000000
EXC_RET = 0xfffffffd
CONTROL = 0x00000002
MSP = 0x04027f98
PSP = 0x10005be0
sp = 0x10005be0
- This fault means that the processor attempted an instruction fetch from a location that does not permit execution.
- I have been able to use the debugger to watch the processor crashing but I have no idea WHY it is happening.
The crash actually happens in library code (assembler)
Q. Any ideas ?
There are some HW setup instructions in the readme that I do not understand and so have not done anything with them.
Please tell me if and how I need to change the configuration of my LinkIt board in some way.
Q. What M24C01 device ?
Q. Is this what is messing me up ?
Connect J1014 SCL0 and J1014 SDA0 to the SCL (clock) and SDA (data) pins
of the M24C01 EEPROM device, respectively.
Connect VCC of EEPROM with
CON6102 VIO18 and GND of EEPROM with J1018 GND on LinkIt 2523 HDK.
Looking forward to getting this problem solved quickly.
MediaTek USA Inc