diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..45866f9
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,9 @@
+# Defines the Chromium style for automatic reformatting.
+# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
+Language: Cpp
+BasedOnStyle: Google
+ColumnLimit: 160
+AlignConsecutiveMacros: true
+AlignConsecutiveDeclarations: true
+AlignConsecutiveAssignments: true
+AlignOperands: true
\ No newline at end of file
diff --git a/.cproject b/.cproject
index ecf1d14..b96cce2 100644
--- a/.cproject
+++ b/.cproject
@@ -17,15 +17,15 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
-
-
+
+
-
-
-
+
+
+
+
+
@@ -61,7 +78,14 @@
-
+
+
+
+
+
+
+
+
@@ -75,6 +99,8 @@
+
+
@@ -96,27 +122,27 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
+
-
-
-
+
+
-
-
-
+
+
+
+
+
-
+
-
+
+
+
+
+
+
+
+
@@ -158,17 +203,31 @@
-
+
+
+
+
+
+
+
+
+
+
-
+
-
+
+
+
+
+
+
+
-
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index e69de29..1ead615 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+Debug
\ No newline at end of file
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..ee2589e
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "sdk"]
+ path = sdk
+ url = zwsd@192.168.1.3:manufacturer_stm32/iflytop_sdk.git
diff --git a/.project b/.project
index 44c3e1c..f94bb8c 100644
--- a/.project
+++ b/.project
@@ -1,6 +1,6 @@
- app
+ robotic_core_xy
@@ -28,5 +28,6 @@
com.st.stm32cube.ide.mcu.MCURootProjectNature
org.eclipse.cdt.managedbuilder.core.managedBuildNature
org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+ org.eclipse.cdt.core.ccnature
diff --git a/.settings/stm32cubeide.project.prefs b/.settings/stm32cubeide.project.prefs
new file mode 100644
index 0000000..565d7fc
--- /dev/null
+++ b/.settings/stm32cubeide.project.prefs
@@ -0,0 +1,3 @@
+8DF89ED150041C4CBC7CB9A9CAA90856=970C2B927C46598E88F13155941494D3
+DC22A860405A8BF2F2C095E5B6529F12=0CD1751AC27020CB572731DEAAEBD8E6
+eclipse.preferences.version=1
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..cdd1d6e
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,22 @@
+{
+ "files.associations": {
+ "*.hpp": "cpp",
+ "iostream": "cpp",
+ "list": "cpp",
+ "memory": "cpp",
+ "sstream": "cpp",
+ "*.tcc": "cpp",
+ "compare": "c",
+ "stdbool.h": "c",
+ "stdint.h": "c",
+ "chip.h": "c",
+ "atomic": "c",
+ "random": "c",
+ "delay.h": "c",
+ "main.h": "c",
+ "stm32f4xx_hal.h": "c",
+ "stm32f4xx_hal_conf.h": "c",
+ "marco.h": "c",
+ "stdio.h": "c"
+ }
+}
\ No newline at end of file
diff --git a/Core/Src/main.c b/Core/Src/main.c
index accb16a..699db00 100644
--- a/Core/Src/main.c
+++ b/Core/Src/main.c
@@ -107,6 +107,9 @@ int main(void)
MX_USART3_UART_Init();
/* USER CODE BEGIN 2 */
+ extern void umain();
+ umain();
+
/* USER CODE END 2 */
/* Infinite loop */
diff --git a/robotic_core_xy dap.cfg b/robotic_core_xy dap.cfg
new file mode 100644
index 0000000..7166ee8
--- /dev/null
+++ b/robotic_core_xy dap.cfg
@@ -0,0 +1,44 @@
+# This is an genericBoard board with a single STM32F407VETx chip
+#
+# Generated by STM32CubeIDE
+# Take care that such file, as generated, may be overridden without any early notice. Please have a look to debug launch configuration setup(s)
+
+source [find interface/cmsis-dap.cfg]
+
+
+set WORKAREASIZE 0x8000
+
+transport select "swd"
+
+set CHIPNAME STM32F407VETx
+set BOARDNAME genericBoard
+
+# Enable debug when in low power modes
+set ENABLE_LOW_POWER 1
+
+# Stop Watchdog counters when halt
+set STOP_WATCHDOG 1
+
+# STlink Debug clock frequency
+set CLOCK_FREQ 8000
+
+# Reset configuration
+# use hardware reset, connect under reset
+# connect_assert_srst needed if low power mode application running (WFI...)
+reset_config srst_only srst_nogate connect_assert_srst
+set CONNECT_UNDER_RESET 1
+set CORE_RESET 0
+
+# ACCESS PORT NUMBER
+set AP_NUM 0
+# GDB PORT
+set GDB_PORT 3333
+
+
+
+
+
+# BCTM CPU variables
+
+source [find target/stm32f4x.cfg]
+
diff --git a/robotic_core_xy.launch b/robotic_core_xy.launch
new file mode 100644
index 0000000..aea2d51
--- /dev/null
+++ b/robotic_core_xy.launch
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/usrc/main.cpp b/usrc/main.cpp
new file mode 100644
index 0000000..366dca6
--- /dev/null
+++ b/usrc/main.cpp
@@ -0,0 +1,26 @@
+#include "main.hpp"
+
+#include
+#include
+
+#include "main.h"
+#include "project.hpp"
+#include "sdk\chip\iflytop_no_os.h"
+#include "usart.h"
+namespace iflytop {
+Main gmain;
+};
+
+using namespace iflytop;
+void Main::run() {
+ // for (size_t i = 0; i < 100; i++) {
+ // uint8_t c = '1';
+ // HAL_UART_Transmit(&DEBUG_UART, &c, 1, 100);
+ // }
+ iflytop_no_os_cfg_t cfg = {
+ .delayhtim = &DELAY_US_TIMER,
+ .debuguart = &DEBUG_UART,
+ };
+ iflytop_no_os_init(&cfg);
+ printf("Hello World!\r\n");
+}
diff --git a/usrc/main.hpp b/usrc/main.hpp
new file mode 100644
index 0000000..b319733
--- /dev/null
+++ b/usrc/main.hpp
@@ -0,0 +1,21 @@
+#pragma once
+#include
+#include
+
+#include
+namespace iflytop {
+using namespace std;
+class Main {
+ private:
+ /* data */
+ public:
+ Main(/* args */){};
+ ~Main(){};
+ void run();
+};
+extern Main gmain;
+} // namespace iflytop
+
+extern "C" {
+void umain(void) { iflytop::gmain.run(); }
+}
\ No newline at end of file
diff --git a/usrc/project.hpp b/usrc/project.hpp
new file mode 100644
index 0000000..e50609a
--- /dev/null
+++ b/usrc/project.hpp
@@ -0,0 +1,66 @@
+#pragma once
+
+#define VERSION "v1.0"
+// 设备ID
+#define DEVICE_ID (128 + 3)
+// 调试串口
+#define DEBUG_UART huart1
+// 调试指示灯
+#define DEBUG_LIGHT_GPIO PE2
+
+// 微秒延迟定时器,注意该延时定时器需要按照以下文档进行配置
+// http://192.168.1.3:3000/zwikipedia/iflytop_wikipedia/src/branch/master/doc/stm32cubemx_us_timer.md
+#define DELAY_US_TIMER htim6
+
+// 电机通道编号
+#define TMC_MOTOR_SPI hspi1
+
+// MOTOR1
+#define TMC_MOTOR1_CHANNEL 1
+#define TMC_MOTOR1_SPI_SELECT1_IO PA4
+#define TMC_MOTOR1_nFREEZE_IO PC2
+#define TMC_MOTOR1_nRESET_IO PB3
+#define TMC_MOTOR1_SUB_IC_ENN_IO PC3
+#define TMC_MOTOR1_ENN_IO // unused
+
+// MOTOR2
+#define TMC_MOTOR2_CHANNEL 2
+#define TMC_MOTOR2_SPI_SELECT1_IO PA8
+#define TMC_MOTOR2_nFREEZE_IO PC6
+#define TMC_MOTOR2_nRESET_IO PB2
+#define TMC_MOTOR2_SUB_IC_ENN_IO PC7
+#define TMC_MOTOR2_ENN_IO // unused
+
+/*******************************************************************************
+ * MotorConfig *
+ *******************************************************************************/
+
+#define MOTOR_REDUCTION_RATIO1 50
+#define MOTOR_REDUCTION_RATIO2 50
+
+#define SCARA_L2 (2385) // 0.1mm
+#define SCARA_L1 (2150) // 0.1mm
+/*******************************************************************************
+ * REG LIST *
+ *******************************************************************************/
+// https://iflytop1.feishu.cn/docx/ZBsddjrL1oHAiYx8DdmcccEBnPf
+
+#define DEVICE_BASIC_CTRL_ADD_BASE 0
+#define GPIO_INPUT_ADD_BASE 1000 // GPIO输入
+#define REG_MOTOR1_CTRL_ADD_BASE 10000 // 机械臂电机1控制基地址
+#define REG_MOTOR2_CTRL_ADD_BASE 10100 // 机械臂电机2控制基地址
+#define REG_SCARA_CTRL_ADD_BASE 11200 // 机械臂控制基地址
+#define REG_BARCODE_CTRL_ADD_BASE 20000 // 扫码器控制基地址
+
+#define REG_GPIO_INPUT0 (GPIO_INPUT_ADD_BASE + 0)
+
+#define ARM_SENSOR1_GPIO PD0
+#define ARM_SENSOR2_GPIO PD1
+#define ARM_SENSOR3_GPIO PD2
+#define ARM_SENSOR4_GPIO PD3
+#define ARM_SENSOR5_GPIO PD4
+#define ARM_SENSOR6_GPIO PD5
+#define ARM_SENSOR7_GPIO PD6
+#define ARM_SENSOR8_GPIO PD7
+
+#define CODE_SCANER_UART huart3
\ No newline at end of file