mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 05:03:34 +08:00
Make board_crashdump.c arch agnostic and move to common
This commit is contained in:
committed by
Lorenz Meier
parent
127a639cd6
commit
59ec0e8aef
@@ -35,7 +35,6 @@ px4_add_module(
|
|||||||
MODULE drivers__boards__aerofc-v1
|
MODULE drivers__boards__aerofc-v1
|
||||||
COMPILE_FLAGS
|
COMPILE_FLAGS
|
||||||
SRCS
|
SRCS
|
||||||
../common/stm32/board_crashdump.c
|
|
||||||
aerofc_init.c
|
aerofc_init.c
|
||||||
aerofc_spi.c
|
aerofc_spi.c
|
||||||
aerofc_usb.c
|
aerofc_usb.c
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ px4_add_module(
|
|||||||
MODULE drivers__boards__auav-x21
|
MODULE drivers__boards__auav-x21
|
||||||
COMPILE_FLAGS
|
COMPILE_FLAGS
|
||||||
SRCS
|
SRCS
|
||||||
../common/stm32/board_crashdump.c
|
../common/board_crashdump.c
|
||||||
../common/board_dma_alloc.c
|
../common/board_dma_alloc.c
|
||||||
auav_can.c
|
auav_can.c
|
||||||
auav_init.c
|
auav_init.c
|
||||||
|
|||||||
-5
@@ -6,22 +6,18 @@
|
|||||||
|
|
||||||
#include <nuttx/board.h>
|
#include <nuttx/board.h>
|
||||||
|
|
||||||
#include "board_config.h"
|
|
||||||
|
|
||||||
#include <systemlib/hardfault_log.h>
|
#include <systemlib/hardfault_log.h>
|
||||||
|
|
||||||
#if defined(CONFIG_STM32_SAVE_CRASHDUMP) || defined(CONFIG_STM32F7_SAVE_CRASHDUMP)
|
|
||||||
static void copy_reverse(stack_word_t *dest, stack_word_t *src, int size)
|
static void copy_reverse(stack_word_t *dest, stack_word_t *src, int size)
|
||||||
{
|
{
|
||||||
while (size--) {
|
while (size--) {
|
||||||
*dest++ = *src--;
|
*dest++ = *src--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
__EXPORT void board_crashdump(uintptr_t currentsp, FAR void *tcb, FAR const uint8_t *filename, int lineno)
|
__EXPORT void board_crashdump(uintptr_t currentsp, FAR void *tcb, FAR const uint8_t *filename, int lineno)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_STM32_SAVE_CRASHDUMP) || defined(CONFIG_STM32F7_SAVE_CRASHDUMP)
|
|
||||||
/* We need a chunk of ram to save the complete context in.
|
/* We need a chunk of ram to save the complete context in.
|
||||||
* Since we are going to reboot we will use &_sdata
|
* Since we are going to reboot we will use &_sdata
|
||||||
* which is the lowest memory and the amount we will save
|
* which is the lowest memory and the amount we will save
|
||||||
@@ -160,7 +156,6 @@ __EXPORT void board_crashdump(uintptr_t currentsp, FAR void *tcb, FAR const uint
|
|||||||
|
|
||||||
up_lowputc('!');
|
up_lowputc('!');
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CONFIG_BOARD_RESET_ON_CRASH)
|
#if defined(CONFIG_BOARD_RESET_ON_CRASH)
|
||||||
px4_systemreset(false);
|
px4_systemreset(false);
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
px4_add_module(
|
px4_add_module(
|
||||||
MODULE drivers__boards__crazyflie
|
MODULE drivers__boards__crazyflie
|
||||||
SRCS
|
SRCS
|
||||||
../common/stm32/board_crashdump.c
|
../common/board_crashdump.c
|
||||||
../common/board_dma_alloc.c
|
../common/board_dma_alloc.c
|
||||||
crazyflie_init.c
|
crazyflie_init.c
|
||||||
crazyflie_usb.c
|
crazyflie_usb.c
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ px4_add_module(
|
|||||||
MODULE drivers__boards__mindpx-v2
|
MODULE drivers__boards__mindpx-v2
|
||||||
COMPILE_FLAGS
|
COMPILE_FLAGS
|
||||||
SRCS
|
SRCS
|
||||||
../common/stm32/board_crashdump.c
|
../common/board_crashdump.c
|
||||||
../common/board_dma_alloc.c
|
../common/board_dma_alloc.c
|
||||||
mindpx_can.c
|
mindpx_can.c
|
||||||
mindpx2_init.c
|
mindpx2_init.c
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ px4_add_module(
|
|||||||
MODULE drivers__boards__px4fmu-v2
|
MODULE drivers__boards__px4fmu-v2
|
||||||
COMPILE_FLAGS
|
COMPILE_FLAGS
|
||||||
SRCS
|
SRCS
|
||||||
../common/stm32/board_crashdump.c
|
../common/board_crashdump.c
|
||||||
../common/board_dma_alloc.c
|
../common/board_dma_alloc.c
|
||||||
px4fmu_can.c
|
px4fmu_can.c
|
||||||
px4fmu2_init.c
|
px4fmu2_init.c
|
||||||
|
|||||||
@@ -477,10 +477,3 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void copy_reverse(stack_word_t *dest, stack_word_t *src, int size)
|
|
||||||
{
|
|
||||||
while (size--) {
|
|
||||||
*dest++ = *src--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ px4_add_module(
|
|||||||
MODULE drivers__boards__px4fmu-v4
|
MODULE drivers__boards__px4fmu-v4
|
||||||
COMPILE_FLAGS
|
COMPILE_FLAGS
|
||||||
SRCS
|
SRCS
|
||||||
../common/stm32/board_crashdump.c
|
../common/board_crashdump.c
|
||||||
../common/board_dma_alloc.c
|
../common/board_dma_alloc.c
|
||||||
px4fmu_can.c
|
px4fmu_can.c
|
||||||
px4fmu_init.c
|
px4fmu_init.c
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ px4_add_module(
|
|||||||
MODULE drivers__boards__px4fmu-v4pro
|
MODULE drivers__boards__px4fmu-v4pro
|
||||||
COMPILE_FLAGS
|
COMPILE_FLAGS
|
||||||
SRCS
|
SRCS
|
||||||
../common/stm32/board_crashdump.c
|
../common/board_crashdump.c
|
||||||
../common/board_dma_alloc.c
|
../common/board_dma_alloc.c
|
||||||
px4fmu_can.c
|
px4fmu_can.c
|
||||||
px4fmu_init.c
|
px4fmu_init.c
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ px4_add_module(
|
|||||||
COMPILE_FLAGS
|
COMPILE_FLAGS
|
||||||
-Os
|
-Os
|
||||||
SRCS
|
SRCS
|
||||||
../common/stm32/board_crashdump.c
|
../common/board_crashdump.c
|
||||||
../common/board_dma_alloc.c
|
../common/board_dma_alloc.c
|
||||||
# WIP px4fmu_can.c
|
# WIP px4fmu_can.c
|
||||||
px4fmu_init.c
|
px4fmu_init.c
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ px4_add_module(
|
|||||||
COMPILE_FLAGS
|
COMPILE_FLAGS
|
||||||
-Os
|
-Os
|
||||||
SRCS
|
SRCS
|
||||||
../common/stm32/board_crashdump.c
|
../common/board_crashdump.c
|
||||||
../common/board_dma_alloc.c
|
../common/board_dma_alloc.c
|
||||||
# WIP px4nucleo_can.c
|
# WIP px4nucleo_can.c
|
||||||
px4nucleo_init.c
|
px4nucleo_init.c
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ px4_add_module(
|
|||||||
MODULE drivers__boards__tap-v1
|
MODULE drivers__boards__tap-v1
|
||||||
COMPILE_FLAGS
|
COMPILE_FLAGS
|
||||||
SRCS
|
SRCS
|
||||||
../common/stm32/board_crashdump.c
|
../common/board_crashdump.c
|
||||||
../common/board_dma_alloc.c
|
../common/board_dma_alloc.c
|
||||||
tap_init.c
|
tap_init.c
|
||||||
tap_pwr.c
|
tap_pwr.c
|
||||||
|
|||||||
Reference in New Issue
Block a user