Skip to content

Commit fff660e

Browse files
committed
fix flash 4
1 parent 6667751 commit fff660e

2 files changed

Lines changed: 24 additions & 27 deletions

File tree

.vscode/launch.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
"monitor reset halt"
2525
],
2626
"postLaunchCommands": [
27-
"monitor rtt setup 0x24000000 0x24080000 \"SEGGER RTT\"",
27+
"monitor rtt setup 0x20000000 0x20020000 \"SEGGER RTT\"",
2828
"monitor rtt start",
2929
"monitor rtt server start 9090 0"
3030
],
3131
"postRestartCommands": [
3232
"monitor halt",
33-
"monitor rtt setup 0x24000000 0x24080000 \"SEGGER RTT\"",
33+
"monitor rtt setup 0x20000000 0x20020000 \"SEGGER RTT\"",
3434
"monitor rtt start",
3535
"monitor rtt server start 9090 0"
3636
],
@@ -69,13 +69,13 @@
6969
"monitor reset halt"
7070
],
7171
"postLaunchCommands": [
72-
"monitor rtt setup 0x24000000 0x24080000 \"SEGGER RTT\"",
72+
"monitor rtt setup 0x20000000 0x20020000 \"SEGGER RTT\"",
7373
"monitor rtt start",
7474
"monitor rtt server start 9090 0"
7575
],
7676
"postRestartCommands": [
7777
"monitor halt",
78-
"monitor rtt setup 0x24000000 0x24080000 \"SEGGER RTT\"",
78+
"monitor rtt setup 0x20000000 0x20020000 \"SEGGER RTT\"",
7979
"monitor rtt start",
8080
"monitor rtt server start 9090 0"
8181
],
@@ -105,7 +105,7 @@
105105
"svdFile": "${workspaceFolder}/STM32H723.svd",
106106
"showDevDebugOutput": "parsed",
107107
"postAttachCommands": [
108-
"monitor rtt setup 0x24000000 0x24080000 \"SEGGER RTT\"",
108+
"monitor rtt setup 0x20000000 0x20020000 \"SEGGER RTT\"",
109109
"monitor rtt start",
110110
"monitor rtt server start 9090 0"
111111
],

Core/Src/stm32h7xx_it.c

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,22 @@ __attribute__((noreturn, optimize("O0"))) void my_fault_handler_c(sContextStateF
273273
&metadata_buffer,
274274
sizeof(metadata_buffer)
275275
);
276-
// reboot the system
276+
// In debug builds, stop here instead of forcing a reset loop.
277+
#ifndef NDEBUG
278+
__BKPT(0);
279+
while (1) {
280+
}
281+
#else
282+
// In debug sessions on release binaries, stop here as well.
283+
volatile uint32_t* dhcsr = (volatile uint32_t*)0xE000EDF0;
284+
if ((*dhcsr & 0x1U) != 0U) {
285+
__BKPT(0);
286+
while (1) {
287+
}
288+
}
289+
#endif
290+
291+
// Reboot the system in non-debug runs.
277292
volatile uint32_t* aircr = (volatile uint32_t*)0xE000ED0C;
278293
__asm volatile("dsb");
279294
*aircr = (0x05FA << 16) | 0x1 << 2;
@@ -408,32 +423,14 @@ void FDCAN3_IT0_IRQHandler(void) { HAL_FDCAN_IRQHandler(&hfdcan1); }
408423
void FDCAN3_IT1_IRQHandler(void) { HAL_FDCAN_IRQHandler(&hfdcan1); }
409424

410425
/**
411-
* @brief This function handles EXTI line0 interrupt.
426+
* @brief This function handles DMA1 stream0 global interrupt.
412427
*/
413-
void EXTI0_IRQHandler(void) {
414-
/* USER CODE BEGIN EXTI0_IRQn 0 */
415-
416-
/* USER CODE END EXTI0_IRQn 0 */
417-
HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_0);
418-
/* USER CODE BEGIN EXTI0_IRQn 1 */
419428

420-
/* USER CODE END EXTI0_IRQn 1 */
421-
}
429+
void FMAC_IRQHandler(void) { HAL_FMAC_IRQHandler(&hfmac); }
422430

423431
/**
424-
* @brief This function handles EXTI line1 interrupt.
432+
* @brief This function handles SPI3 global interrupt.
425433
*/
426-
void EXTI1_IRQHandler(void) {
427-
/* USER CODE BEGIN EXTI1_IRQn 0 */
428-
429-
/* USER CODE END EXTI1_IRQn 0 */
430-
HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_1);
431-
/* USER CODE BEGIN EXTI1_IRQn 1 */
432-
433-
/* USER CODE END EXTI1_IRQn 1 */
434-
}
435-
436-
void FMAC_IRQHandler(void) { HAL_FMAC_IRQHandler(&hfmac); }
437434

438435
/**
439436
* @brief This function handles Ethernet global interrupt.

0 commit comments

Comments
 (0)