File tree Expand file tree Collapse file tree 5 files changed +56
-10
lines changed Expand file tree Collapse file tree 5 files changed +56
-10
lines changed Original file line number Diff line number Diff line change @@ -132,4 +132,54 @@ nrf5x
132132
133133下面提供一种擦写softdevice的方法。在keil中选择softdevice Erase的FLASH算法,这个时候就烧写之前可以擦除之前的softdevice。
134134
135- ![ image-20201017194935643] ( docs/images/softdevice_erase.png )
135+ ![ image-20201017194935643] ( docs/images/softdevice_erase.png )
136+
137+
138+
139+ ### 2.如果在使用softdevice的时候,连上手机时候出现一些hardfault
140+
141+ 如下所示:
142+
143+ ```
144+ psr: 0x8100000f
145+ r00: 0x00000000
146+ r01: 0x200034e6
147+ r02: 0x00000000
148+ r03: 0x200034dc
149+ r04: 0x200034dc
150+ r05: 0x00000000
151+ r06: 0x200034e6
152+ r07: 0xdeadbeef
153+ r08: 0xdeadbeef
154+ r09: 0xdeadbeef
155+ r10: 0xdeadbeef
156+ r11: 0xdeadbeef
157+ r12: 0x00000000
158+ lr: 0x000369af
159+ pc: 0x00036972
160+ hard fault on handler
161+
162+ ```
163+
164+ 这个hardfault发生在SOFTDEVICE内部,由于代码不开源,这边尝试了修改如下函数,可以不触发hardfault。
165+
166+ ```
167+ rt_hw_interrupt_disable PROC
168+ EXPORT rt_hw_interrupt_disable
169+ ;MRS r0, PRIMASK
170+ ;CPSID I
171+ BX LR
172+ ENDP
173+
174+ ;/*
175+ ; * void rt_hw_interrupt_enable(rt_base_t level);
176+ ; */
177+ rt_hw_interrupt_enable PROC
178+ EXPORT rt_hw_interrupt_enable
179+ ;MSR PRIMASK, r0
180+ BX LR
181+ ENDP
182+ ```
183+
184+
185+
Original file line number Diff line number Diff line change @@ -21,8 +21,7 @@ extern int __bss_end__;
2121#define HEAP_BEGIN ((void *)&__bss_end__)
2222#endif
2323
24- #define HEAP_SIZE 16*1024
25- #define HEAP_END (HEAP_BEGIN + HEAP_SIZE)
24+ #define HEAP_END (MCU_SRAM_END_ADDRESS)
2625
2726void rt_hw_board_init (void );
2827
Original file line number Diff line number Diff line change @@ -314,8 +314,8 @@ menu "On-chip Peripheral Drivers"
314314 endif
315315 config BSP_USING_SPI
316316 bool "Enable SPI"
317- select RT_USING_PIN
318- default y
317+ select RT_USING_SPI
318+ default n
319319
320320 if BSP_USING_SPI
321321 config NRFX_SPI_ENABLED
Original file line number Diff line number Diff line change @@ -53,9 +53,6 @@ void SysTick_Configuration(void)
5353void rt_hw_board_init (void )
5454{
5555 rt_hw_interrupt_enable (0 );
56- // sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE);
57- /* Activate deep sleep mode */
58- SCB -> SCR |= SCB_SCR_SLEEPDEEP_Msk ;
5956
6057 SysTick_Configuration ();
6158
Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ extern int __bss_end__;
2121#define HEAP_BEGIN ((void *)&__bss_end__)
2222#endif
2323
24- #define HEAP_SIZE 16*1024
25- #define HEAP_END (HEAP_BEGIN + HEAP_SIZE )
24+
25+ #define HEAP_END (MCU_SRAM_END_ADDRESS )
2626
2727void rt_hw_board_init (void );
2828
You can’t perform that action at this time.
0 commit comments