• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

テスト用のあれこれ共用フォルダ


Commit MetaInfo

修訂ae5fc44842bef96d0a3d650a1cc12df7f7aaec4d (tree)
時間2018-04-21 23:56:14
作者takemasa <suikan@user...>
Commitertakemasa

Log Message

Default Exception Handler is successfuly overwriten.

Confirmed, the exception triggeres the Post motem process and the buffer
contents are flushed. DMA stop timming have to be adjusted.

Change Summary

差異

--- a/stm32_development/nucleo-f303k8/Inc/my_test.hpp
+++ b/stm32_development/nucleo-f303k8/Inc/my_test.hpp
@@ -18,6 +18,8 @@ void InitTestUart(UART_HandleTypeDef * uart_handle);
1818 void DoTestUart(void);
1919 // For the STM32 HAL assertion_failed();
2020 void CustomAssertFailed(uint8_t* file, uint32_t line);
21+// For exception handling
22+void CustomDefaultHandler();
2123 #ifdef __cplusplus
2224 }
2325 #endif
--- a/stm32_development/nucleo-f303k8/Src/my_test.cpp
+++ b/stm32_development/nucleo-f303k8/Src/my_test.cpp
@@ -42,10 +42,19 @@ void InitTestUart(UART_HandleTypeDef * uart_handle)
4242 // String output test.
4343 void DoTestUart(void)
4444 {
45+
46+ typedef void (* func_ptr)();
47+
48+ func_ptr const func = reinterpret_cast<func_ptr>(1);
49+
4550 // MURASAKI_ASSERT(counter % 2 == 0, "Odd counter");
4651 // by murasaki debugging output. You can use this in both task and interrupt context.
4752 // non blocking
48- murasaki::debugger->Printf(MSG);
53+ murasaki::debugger->Printf("Count down 3 \r\n");
54+ murasaki::debugger->Printf("Count down 2 \r\n");
55+ murasaki::debugger->Printf("Count down 1 \r\n");
56+
57+ func();
4958
5059 }
5160
@@ -80,3 +89,7 @@ void HAL_UART_RxCpltCallback(UART_HandleTypeDef * huart)
8089 }
8190
8291
92+void CustomDefaultHandler()
93+{
94+ murasaki::debugger->DoPostMotem();
95+}
--- a/stm32_development/nucleo-f303k8/startup/startup_stm32f303x8.s
+++ b/stm32_development/nucleo-f303k8/startup/startup_stm32f303x8.s
@@ -124,9 +124,11 @@ LoopForever:
124124 * @retval : None
125125 */
126126 .section .text.Default_Handler,"ax",%progbits
127+ .global CustomDefaultHandler
127128 Default_Handler:
128129 Infinite_Loop:
129- b Infinite_Loop
130+ b CustomDefaultHandler
131+// b Infinite_Loop
130132 .size Default_Handler, .-Default_Handler
131133 /******************************************************************************
132134 *