Skip to content

Commit ae001f4

Browse files
author
eurkaaaa
committed
add debug print and test it sucessfully
1 parent 836aa39 commit ae001f4

8 files changed

Lines changed: 51 additions & 16 deletions

File tree

.cproject

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Drivers/STM32L4xx_HAL_Driver}&quot;"/>
3838
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Athena-Driver/SysDriver/inc}&quot;"/>
3939
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Middlewares/Third_Party/FreeRTOS}&quot;"/>
40-
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/app-example/debug_print}&quot;"/>
4140
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Athena-Driver/BSP/Components/FM25CL64}&quot;"/>
4241
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Athena-Driver/BSP/Components/FM25CL64/inc}&quot;"/>
4342
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Athena-Driver/BSP/Components/FM25CL64/src}&quot;"/>
@@ -46,6 +45,9 @@
4645
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/examples/FS_example/inc}&quot;"/>
4746
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/examples/FS_example/src}&quot;"/>
4847
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/examples/tof_get_data}&quot;"/>
48+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/examples/DebugPrint_example}&quot;"/>
49+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/examples/DebugPrint_example/inc}&quot;"/>
50+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/examples/DebugPrint_example/src}&quot;"/>
4951
</option>
5052
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.948440464" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
5153
</tool>
@@ -89,7 +91,6 @@
8991
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Athena-Driver/SysDriver/inc}&quot;"/>
9092
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Athena-Driver/BSP/Components/DW3000/include}&quot;"/>
9193
<listOptionValue builtIn="false" value="../AdHocUWB/Inc/"/>
92-
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/app-example/debug_print/inc}&quot;"/>
9394
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Athena-Driver/BSP/Components/FM25CL64}&quot;"/>
9495
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Athena-Driver/BSP/Components/FM25CL64/inc}&quot;"/>
9596
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Athena-Driver/BSP/Components/FM25CL64/src}&quot;"/>
@@ -98,6 +99,9 @@
9899
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/examples/FS_example/inc}&quot;"/>
99100
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/examples/FS_example/src}&quot;"/>
100101
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/examples/tof_get_data}&quot;"/>
102+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/examples/DebugPrint_example}&quot;"/>
103+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/examples/DebugPrint_example/inc}&quot;"/>
104+
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/examples/DebugPrint_example/src}&quot;"/>
101105
</option>
102106
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.943746239" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
103107
</tool>
@@ -129,7 +133,7 @@
129133
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/>
130134
<entry excluding="Athena_deck_HAL/src/i2c_hal.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
131135
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Middlewares"/>
132-
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="examples/debug_print"/>
136+
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="examples/DebugPrint_example"/>
133137
</sourceEntries>
134138
</configuration>
135139
</storageModule>

.settings/language.settings.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
66
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
77
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
8-
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1167501675259727652" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
8+
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1254829306932847619" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
99
<language-scope id="org.eclipse.cdt.core.gcc"/>
1010
<language-scope id="org.eclipse.cdt.core.g++"/>
1111
</provider>
@@ -16,7 +16,7 @@
1616
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
1717
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
1818
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
19-
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1167501675259727652" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
19+
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1254829306932847619" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
2020
<language-scope id="org.eclipse.cdt.core.gcc"/>
2121
<language-scope id="org.eclipse.cdt.core.g++"/>
2222
</provider>

.vscode/settings.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@
55
"stm32l4xx_ll_gpio.h": "c",
66
"uart_receive.h": "c",
77
"uart_hal.h": "c",
8-
"test_tof.h": "c"
8+
"test_tof.h": "c",
9+
"cstdarg": "c",
10+
"debugprint_example.h": "c",
11+
"debug.h": "c",
12+
"stdio.h": "c",
13+
"semphr.h": "c",
14+
"task.h": "c",
15+
"typeinfo": "c",
16+
"dwtypes.h": "c",
17+
"libdw3000.h": "c",
18+
"calibration.h": "c",
19+
"freertos.h": "c"
920
}
1021
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "../../../examples/debug_print/inc/debug.h"
1+
#include "debug.h"
22

33
#define Buffer 64
44
static bool SendingisPending = 0;

Core/Src/freertos.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include "dw3000_cbll.h"
4040
#include "tof_get_data.c"
4141

42-
#include "../../examples/debug_print/inc/debug.h"
42+
#include "DebugPrint_example.h"
4343
#include "../../examples/tinymap/inc/calibration.h"
4444

4545
#include "../../examples/FS_example/src/Flash_FS_Example.c"
@@ -108,6 +108,12 @@ const osThreadAttr_t tof_get_data_attributes = {
108108
.stack_size = 128 * 4,
109109
.priority = (osPriority_t) osPriorityNormal,
110110
};
111+
osThreadId_t Debug_ExampleHandle;
112+
const osThreadAttr_t Debug_Example_attributes = {
113+
.name = "Debug_example",
114+
.stack_size = 128 * 2,
115+
.priority = (osPriority_t) osPriorityNormal,
116+
};
111117
/* Private function prototypes -----------------------------------------------*/
112118
/* USER CODE BEGIN FunctionPrototypes */
113119
static void ledTask(void *argument);
@@ -135,7 +141,8 @@ void MX_FREERTOS_Init(void) {
135141
while (1);
136142
}
137143
spi_deck_init();
138-
TOF_exampleHandle = osThreadNew(tof_get_data, NULL, &tof_get_data_attributes);
144+
// TOF_exampleHandle = osThreadNew(tof_get_data, NULL, &tof_get_data_attributes);
145+
Debug_ExampleHandle = osThreadNew(Debug_example, NULL, &Debug_Example_attributes);
139146
// FS_ExampleHandle = osThreadNew(FS_Example, NULL, &FS_Example_attributes);
140147
// ledTaskHandle = osThreadNew(ledTask, NULL, &ledTask_attributes);
141148
// uwbTaskHandle = osThreadNew(uwbTask, NULL, &uwbTask_attributes);
@@ -215,13 +222,7 @@ static void ledTask(void *argument)
215222
while(1)
216223
{
217224
// LL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);
218-
vTaskDelay(2000);
219-
DEBUG_PRINTF("this is a test: %u \n", 85);
220-
// vTaskDelay(2000);
221-
DEBUG_PRINTF("this is a test: %.2f \n", 5.82);
222-
// vTaskDelay(2000);
223-
DEBUG_PRINTF("this is a test: %i \n", -19);
224-
// eprintf(uartPutchar, "i am %s \n", "lihao");
225+
vTaskDelay(100);
225226
}
226227
}
227228
/* USER CODE END Application */
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include "debug.h"
2+
void Debug_example(void *arugment);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include "DebugPrint_example.h"
2+
void Debug_example(void *arugment)
3+
{
4+
while(1)
5+
{
6+
vTaskDelay(2000);
7+
//test print uint
8+
DEBUG_PRINTF("this is a test: %u \n", 85);
9+
//test print float
10+
DEBUG_PRINTF("this is a test: %.2f \n", 5.82);
11+
//test print int
12+
DEBUG_PRINTF("this is a test: %i \n", -19);
13+
//test print string
14+
DEBUG_PRINTF("this is a test: %s \n","hello world");
15+
}
16+
17+
}

0 commit comments

Comments
 (0)