From c7d6ba78d537fdc29c3345e78ab8816657b3929b Mon Sep 17 00:00:00 2001 From: Oliver Walter Date: Thu, 23 May 2024 02:15:36 +0200 Subject: [PATCH] issue hardfault try --- .vscode/launch.json | 27 +++++++++++++++++++++++++++ Application/BSP/BSP_ADC.c | 4 ++-- Core/Src/main.c | 2 +- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index eae96f5..971a0a7 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -44,6 +44,33 @@ //"armToolchainPath": "c:\\ST\\STM32CubeIDE_1.7.0\\STM32CubeIDE\\plugins\\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_2.0.0.202105311346\\tools\\bin", //"stm32cubeprogrammer": "c:\\Program Files\\STMicroelectronics\\STM32Cube\\STM32CubeProgrammer\\bin", + /* If you use external loader, add additional arguments */ + //"serverArgs": ["--extload", "path/to/ext/loader.stldr"], + }, + { + "name": "Attach Microcontroller - ST-Link", + "cwd": "${workspaceFolder}", + "type": "cortex-debug", + "executable": "${command:cmake.launchTargetPath}", //or fixed file path: build/stm32h735g-dk-led.elf + "request": "attach", //Use "attach" to connect to target w/o elf download + "servertype": "stlink", + "device": "STM32H723VGT", //MCU used, ex. "STM32H735IG" + "interface": "swd", + "serialNumber": "002800223232511939353236", //Set ST-Link ID if you use multiple at the same time + "runToEntryPoint": "main", + "svdFile": "STM32H723.svd", //Path to SVD file to see registers + "v1": false, + "showDevDebugOutput": "both", + "liveWatch": { + "enabled": true, + "samplesPerSecond": 4 + } + /* Will get automatically detected if STM32CubeIDE is installed to default directory + or it can be manually provided if necessary.. */ + //"serverpath": "c:\\ST\\STM32CubeIDE_1.7.0\\STM32CubeIDE\\plugins\\com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.win32_2.0.100.202109301221\\tools\\bin\\ST-LINK_gdbserver.exe", + //"armToolchainPath": "c:\\ST\\STM32CubeIDE_1.7.0\\STM32CubeIDE\\plugins\\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_2.0.0.202105311346\\tools\\bin", + //"stm32cubeprogrammer": "c:\\Program Files\\STMicroelectronics\\STM32Cube\\STM32CubeProgrammer\\bin", + /* If you use external loader, add additional arguments */ //"serverArgs": ["--extload", "path/to/ext/loader.stldr"], } diff --git a/Application/BSP/BSP_ADC.c b/Application/BSP/BSP_ADC.c index 77855d5..2913df4 100644 --- a/Application/BSP/BSP_ADC.c +++ b/Application/BSP/BSP_ADC.c @@ -47,7 +47,7 @@ void BSP_ADC_Start() void HAL_ADC_ConvHalfCpltCallback(ADC_HandleTypeDef* hadc) { /* Invalidate Data Cache to get the updated content of the SRAM on the first half of the ADC converted data buffer: 32 bytes */ - SCB_InvalidateDCache_by_Addr((uint32_t *) &aADCxConvertedData[0], ADC_CONVERTED_DATA_BUFFER_SIZE); + //SCB_InvalidateDCache_by_Addr((uint32_t *) &aADCxConvertedData[0], ADC_CONVERTED_DATA_BUFFER_SIZE); } /** @@ -58,7 +58,7 @@ void HAL_ADC_ConvHalfCpltCallback(ADC_HandleTypeDef* hadc) void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc) { /* Invalidate Data Cache to get the updated content of the SRAM on the second half of the ADC converted data buffer: 32 bytes */ - SCB_InvalidateDCache_by_Addr((uint32_t *) &aADCxConvertedData[ADC_CONVERTED_DATA_BUFFER_SIZE/2], ADC_CONVERTED_DATA_BUFFER_SIZE); + //SCB_InvalidateDCache_by_Addr((uint32_t *) &aADCxConvertedData[ADC_CONVERTED_DATA_BUFFER_SIZE/2], ADC_CONVERTED_DATA_BUFFER_SIZE); } diff --git a/Core/Src/main.c b/Core/Src/main.c index 3282376..68097f9 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -107,7 +107,7 @@ int main(void) /* USER CODE END 1 */ /* Enable I-Cache---------------------------------------------------------*/ - //SCB_EnableICache(); + SCB_EnableICache(); /* MCU Configuration--------------------------------------------------------*/