#2 FineTuning

开启中
juraj 请求将 3 次代码提交从 irep/jd_slaveFIX1 合并至 irep/main
共有 7 个文件被更改,包括 106 次插入70 次删除
  1. 2 4
      .cproject
  2. 5 0
      Core/Inc/main.h
  3. 83 53
      Core/Src/main.c
  4. 2 3
      Core/Src/stm32l0xx_hal_msp.c
  5. 1 1
      Modules/nbus
  6. 7 3
      baModule-slave Debug.launch
  7. 6 6
      baModule-slave.ioc

+ 2 - 4
.cproject

@@ -21,7 +21,7 @@
 							<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid.2016087764" name="CPU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid" useByScannerDiscovery="false" value="0" valueType="string"/>
 							<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.423721789" name="Core" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid" useByScannerDiscovery="false" value="0" valueType="string"/>
 							<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.1415206628" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" useByScannerDiscovery="false" value="genericBoard" valueType="string"/>
-							<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.949399491" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.6 || Debug || true || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || STM32L082KZTx || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Core/Inc | ../Drivers/STM32L0xx_HAL_Driver/Inc | ../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy | ../Drivers/CMSIS/Device/ST/STM32L0xx/Include | ../Drivers/CMSIS/Include ||  ||  || USE_HAL_DRIVER | STM32L082xx ||  || Drivers | Core/Startup | Core ||  ||  || ${workspace_loc:/${ProjName}/STM32L082KZTX_FLASH.ld} || true || NonSecure ||  || secure_nsclib.o ||  || None ||  ||  || " valueType="string"/>
+							<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.949399491" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.6 || Debug || true || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || STM32L082KZTx || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Core/Inc | ../Drivers/STM32L0xx_HAL_Driver/Inc | ../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy | ../Drivers/CMSIS/Device/ST/STM32L0xx/Include | ../Drivers/CMSIS/Include ||  ||  || USE_HAL_DRIVER | STM32L082xx ||  || Drivers | Core/Startup | Core ||  ||  || ${workspace_loc:/${ProjName}/STM32L082KZTX_FLASH.ld} || true || NonSecure ||  || secure_nsclib.o ||  || None ||  ||  ||  || ::" valueType="string"/>
 							<option id="com.st.stm32cube.ide.mcu.debug.option.cpuclock.546024625" name="Cpu clock frequence" superClass="com.st.stm32cube.ide.mcu.debug.option.cpuclock" useByScannerDiscovery="false" value="32" valueType="string"/>
 							<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.922562106" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
 							<builder buildPath="${workspace_loc:/baModule-slave}/Debug" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.1586147119" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
@@ -49,7 +49,6 @@
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Modules/dataframe/src}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Modules/one-wire-memory/Inc}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Modules/nbus/include}&quot;"/>
-									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Modules/icm20948/src}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Modules/DMP-ICM20948/inc}&quot;"/>
 								</option>
 								<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.139895820" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
@@ -66,7 +65,6 @@
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Modules/dataframe/src}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Modules/one-wire-memory/Inc}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Modules/nbus/include}&quot;"/>
-									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Modules/icm20948/src}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Modules/DMP-ICM20948/inc}&quot;"/>
 								</option>
 								<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols.1846472396" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
@@ -133,7 +131,7 @@
 							<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid.562557773" name="CPU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid" useByScannerDiscovery="false" value="0" valueType="string"/>
 							<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.1525837965" name="Core" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid" useByScannerDiscovery="false" value="0" valueType="string"/>
 							<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.1112811640" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" useByScannerDiscovery="false" value="genericBoard" valueType="string"/>
-							<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.324250348" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.6 || Release || false || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || STM32L082KZTx || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Core/Inc | ../Drivers/STM32L0xx_HAL_Driver/Inc | ../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy | ../Drivers/CMSIS/Device/ST/STM32L0xx/Include | ../Drivers/CMSIS/Include ||  ||  || USE_HAL_DRIVER | STM32L082xx ||  || Drivers | Core/Startup | Core ||  ||  || ${workspace_loc:/${ProjName}/STM32L082KZTX_FLASH.ld} || true || NonSecure ||  || secure_nsclib.o ||  || None ||  ||  || " valueType="string"/>
+							<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.324250348" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.6 || Release || false || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || STM32L082KZTx || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Core/Inc | ../Drivers/STM32L0xx_HAL_Driver/Inc | ../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy | ../Drivers/CMSIS/Device/ST/STM32L0xx/Include | ../Drivers/CMSIS/Include ||  ||  || USE_HAL_DRIVER | STM32L082xx ||  || Drivers | Core/Startup | Core ||  ||  || ${workspace_loc:/${ProjName}/STM32L082KZTX_FLASH.ld} || true || NonSecure ||  || secure_nsclib.o ||  || None ||  ||  ||  || ::" valueType="string"/>
 							<option id="com.st.stm32cube.ide.mcu.debug.option.cpuclock.1585210253" name="Cpu clock frequence" superClass="com.st.stm32cube.ide.mcu.debug.option.cpuclock" useByScannerDiscovery="false" value="32" valueType="string"/>
 							<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.552215938" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
 							<builder buildPath="${workspace_loc:/baModule-slave}/Release" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.1764690039" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>

+ 5 - 0
Core/Inc/main.h

@@ -37,6 +37,11 @@ extern "C" {
 /* Exported types ------------------------------------------------------------*/
 /* USER CODE BEGIN ET */
 
+typedef enum {
+    STATE_WAIT_LEN,
+    STATE_PAYLOAD,
+} ProtocolState;
+
 /* USER CODE END ET */
 
 /* Exported constants --------------------------------------------------------*/

+ 83 - 53
Core/Src/main.c

@@ -89,11 +89,18 @@ static void MX_USART1_UART_Init(void);
 /* Private user code ---------------------------------------------------------*/
 /* USER CODE BEGIN 0 */
 #define MAX_SYSTICK  0xFFFFFFFF
-uint8_t data[BUFF_SIZE];	// tmp read buffer
+
+uint8_t rx_ring_buffer[BUFF_SIZE];
 uint8_t *dataUART;  // pointee for rx_buffer
-volatile uint8_t dataL;
-volatile uint8_t dataI;
+
+// UART DMA related variables
 volatile uint32_t uart_timeout = MAX_SYSTICK;
+volatile uint16_t rx_read_pos = 0; // DAM UART CIRCULAR - tail
+volatile uint8_t msg_len = 0;
+volatile uint8_t msg_idx = 0;
+
+ProtocolState state = STATE_WAIT_LEN;
+
 
 #if MODULE == MODULE_IMU || MODULE == MODULE_DMP
 volatile uint8_t icm_data_ready = 0;
@@ -111,13 +118,12 @@ inline void uart_send(uint8_t *data, int n)
 inline void uart_receive(uint8_t *dataNBUS, int n)
 {
 	dataUART = dataNBUS;
-	dataL = 0;
-	dataI = 0;
-	data[0] = 0;
+	rx_ring_buffer[0] = 0;
 	uart_timeout = HAL_GetTick();
-	HAL_UARTEx_ReceiveToIdle_DMA(&huart1, data, n);
+	HAL_UART_Receive_DMA(&huart1, rx_ring_buffer, n);
 }
 
+
 inline void led_on(){
 	HAL_GPIO_WritePin(LD3_GPIO_Port, LD3_Pin, GPIO_PIN_SET);
 }
@@ -134,13 +140,73 @@ inline void app_delay(uint8_t ms){
 	HAL_Delay(ms);
 }
 
+
+static uint8_t Parse_Protocol_Byte(uint8_t b) {
+
+	uint8_t packet_finished = 0;
+	// Timeout reset logic
+	if (state != STATE_WAIT_LEN) {
+		if ((HAL_GetTick() - uart_timeout) > NBUS_UART_FRAME_TIMEOUT){
+			state = STATE_WAIT_LEN;
+			msg_len = 0;
+			msg_idx = 0;
+		}
+	}
+
+    switch (state) {
+        case STATE_WAIT_LEN:
+            // Validácia dĺžky (max 128 bajtov, min 4 bajty)
+            if (b > 3 && b < PAYLOAD_SIZE) {
+                msg_len = b;
+                msg_idx = 0;
+                state = STATE_PAYLOAD;
+                uart_timeout = HAL_GetTick(); // Reset timeoutu
+            }
+            break;
+
+
+        case STATE_PAYLOAD:
+        	dataUART[msg_idx++] = b;
+        	uart_timeout = HAL_GetTick(); // Aktualizácia timeoutu pri každom bajte
+
+            if (msg_idx >= msg_len) { // Koniec paketu (podľa definície dĺžky)
+            	nbus_cb_UART_RX(msg_idx);	// callback to nBus, notify message length
+                state = STATE_WAIT_LEN;
+                packet_finished = 1;
+            }
+            break;
+    }
+
+    return packet_finished;
+
+
+}
+
+static void Process_UART_RingBuffer(void) {
+	// Zistíme, kde sa aktuálne nachádza DMA (Head)
+    // CNDTR register obsahuje počet ZOSTÁVAJÚCICH bajtov do konca buffra
+    uint16_t rx_dma_pos = BUFF_SIZE - __HAL_DMA_GET_COUNTER(huart1.hdmarx);
+
+    while (rx_read_pos != rx_dma_pos) {
+        uint8_t byte = rx_ring_buffer[rx_read_pos];
+        rx_read_pos++;
+        if (rx_read_pos >= BUFF_SIZE) {
+            rx_read_pos = 0;
+        }
+
+        if( Parse_Protocol_Byte(byte) != 0){
+        	return;
+        }
+    }
+}
+
 static inline uint8_t loop_callback(nBusStateCallbackType_t state_check) {
-// traba kontrolovat kazdu stav (state_check) zvmlast. Moznost doplnit dalsie kontroly
+// treba kontrolovat kazdy stav (state_check) zvlast. Moznost doplnit dalsie kontroly
 	if (state_check == CallbackType_SENSOR) {
 #if MODULE == MODULE_IMU || MODULE == MODULE_DMP
 		if(icm_data_ready == 1){
 			icm_data_ready = 0;
-			return 1;  // interrupt from external sensor: data ready
+			return 0;  // TODO!!!!!!  TEMPORARY DISABLED STATE. interrupt from external sensor: data ready
 		}
 #endif
 
@@ -148,57 +214,23 @@ static inline uint8_t loop_callback(nBusStateCallbackType_t state_check) {
 	}
 
 	if (state_check == CallbackType_UART) {
-		// timemout: 1 - 2 ms
-		if(HAL_GetTick() - 1 > uart_timeout) {
-			dataL = 0;
-			dataI = 0;
-			data[0] = 0;
-			uart_timeout = MAX_SYSTICK;
-//			led_off();
-			HAL_UARTEx_ReceiveToIdle_DMA(&huart1, data, BUFF_SIZE);
-			return 1;  // UART receive timeout
-		}
-		return 0;
+		Process_UART_RingBuffer();
 	}
 
 	return 0;
 }
 
 //  Application callbacks
-void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size){
-	HAL_UARTEx_ReceiveToIdle_DMA(huart, data, BUFF_SIZE);
-	uint8_t copy_offset = 0;
-	if (dataL == 0) {
-		uart_timeout = HAL_GetTick();
-		dataL = data[0];
-		dataI = 0;
-		if (Size == 1) {
-			return;
-		}
-
-		Size--;
-		copy_offset = 1;
-	}
-
-	memcpy(&dataUART[dataI], &data[copy_offset], Size);
-
-	dataI += Size;
-	if(dataI >= dataL){
-		nbus_cb_UART_RX(dataI);
-		dataL=0;
-		dataI=0;
-		data[0]=0;
-		uart_timeout = MAX_SYSTICK;
-	}
-}
-
 void HAL_UART_ErrorCallback(UART_HandleTypeDef *huart){
-	HAL_UARTEx_ReceiveToIdle_DMA(huart, data, BUFF_SIZE);
+	uart_timeout = MAX_SYSTICK;
+	HAL_UART_Receive_DMA(huart, rx_ring_buffer, BUFF_SIZE);
 }
 
 void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) {
 #if MODULE == MODULE_IMU || MODULE == MODULE_DMP
-	icm_data_ready = 1;
+	if (GPIO_Pin == SPI_INT_Pin) {
+		icm_data_ready = 1;
+	}
 #endif
 }
 
@@ -239,8 +271,6 @@ int main(void)
   MX_SPI1_Init();
   MX_USART1_UART_Init();
   /* USER CODE BEGIN 2 */
-  dataI=0;
-  dataL=0;
 
 #ifdef MODULE_INIT_IP_ADC
   MX_ADC_Init();
@@ -275,7 +305,6 @@ int main(void)
 #endif
 
 #if MODULE == MODULE_DMP
-
   nbus_init(getImuDriver(), &hw_platform);
   nbus_init_app(NULL, NULL);
 #endif
@@ -300,9 +329,10 @@ int main(void)
 	 config.mag.mode = mag_mode_power_down;
 
 	 nbus_init(getImuDriver(), &hw_platform);
-	 nbus_init_app(&hspi1, &config);
+	 nbus_init_app(NULL, NULL);
 #endif
 
+
   nBus_MemoryDriver memory_ec20 = {
   		DS28EC20_init,
   		DS28EC20_readData4B,

+ 2 - 3
Core/Src/stm32l0xx_hal_msp.c

@@ -17,7 +17,6 @@
   ******************************************************************************
   */
 /* USER CODE END Header */
-
 /* Includes ------------------------------------------------------------------*/
 #include "main.h"
 /* USER CODE BEGIN Includes */
@@ -361,8 +360,8 @@ void HAL_UART_MspInit(UART_HandleTypeDef* huart)
     hdma_usart1_rx.Init.MemInc = DMA_MINC_ENABLE;
     hdma_usart1_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
     hdma_usart1_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
-    hdma_usart1_rx.Init.Mode = DMA_NORMAL;
-    hdma_usart1_rx.Init.Priority = DMA_PRIORITY_LOW;
+    hdma_usart1_rx.Init.Mode = DMA_CIRCULAR;
+    hdma_usart1_rx.Init.Priority = DMA_PRIORITY_MEDIUM;
     if (HAL_DMA_Init(&hdma_usart1_rx) != HAL_OK)
     {
       Error_Handler();

+ 1 - 1
Modules/nbus

@@ -1 +1 @@
-Subproject commit 219ca744699b12ed7f4a9d51ec05092fe0a433e4
+Subproject commit 61b9ad932d04e24942a86b8378a7baae95e3dd03

+ 7 - 3
baModule-slave Debug.launch

@@ -11,12 +11,16 @@
     <booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.enable_live_expr" value="true"/>
     <booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.enable_swv" value="false"/>
     <intAttribute key="com.st.stm32cube.ide.mcu.debug.launch.formatVersion" value="2"/>
+    <booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.incremental_flashing" value="false"/>
     <stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.ip_address_local" value="localhost"/>
     <booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.limit_swo_clock.enabled" value="false"/>
     <stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.limit_swo_clock.value" value=""/>
     <stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.loadList" value="{&quot;fItems&quot;:[{&quot;fIsFromMainTab&quot;:true,&quot;fPath&quot;:&quot;Debug/baModule-slave.elf&quot;,&quot;fProjectName&quot;:&quot;baModule-slave&quot;,&quot;fPerformBuild&quot;:true,&quot;fDownload&quot;:true,&quot;fLoadSymbols&quot;:true}]}"/>
+    <intAttribute key="com.st.stm32cube.ide.mcu.debug.launch.mode" value="0"/>
     <stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.override_start_address_mode" value="default"/>
+    <stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.port" value=""/>
     <stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.remoteCommand" value="target remote"/>
+    <stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.semihosting" value="Disabled"/>
     <booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startServer" value="true"/>
     <booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startuptab.exception.divby0" value="true"/>
     <booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startuptab.exception.unaligned" value="false"/>
@@ -38,11 +42,11 @@
     <stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.low_power_debug" value="enable"/>
     <stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.max_halt_delay" value="2"/>
     <stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.reset_strategy" value="connect_under_reset"/>
-    <booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_check_serial_number" value="false"/>
-    <stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_txt_serial_number" value=""/>
+    <booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_check_serial_number" value="true"/>
+    <stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_txt_serial_number" value="53FF6D065066505128261087"/>
     <stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.watchdog_config" value="none"/>
     <booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkenable_rtos" value="false"/>
-    <stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations" value="{&quot;fVersion&quot;:1,&quot;fItems&quot;:[{&quot;fDisplayName&quot;:&quot;Reset&quot;,&quot;fIsSuppressible&quot;:false,&quot;fResetAttribute&quot;:&quot;Software system reset&quot;,&quot;fResetStrategies&quot;:[{&quot;fDisplayName&quot;:&quot;Software system reset&quot;,&quot;fLaunchAttribute&quot;:&quot;system_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset\r\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;Hardware reset&quot;,&quot;fLaunchAttribute&quot;:&quot;hardware_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset hardware\r\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;Core reset&quot;,&quot;fLaunchAttribute&quot;:&quot;core_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset core\r\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;None&quot;,&quot;fLaunchAttribute&quot;:&quot;no_reset&quot;,&quot;fGdbCommands&quot;:[],&quot;fCmdOptions&quot;:[&quot;-g&quot;]}],&quot;fGdbCommandGroup&quot;:{&quot;name&quot;:&quot;Additional commands&quot;,&quot;commands&quot;:[]},&quot;fStartApplication&quot;:true}]}"/>
+    <stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations" value="{&quot;fVersion&quot;:1,&quot;fItems&quot;:[{&quot;fDisplayName&quot;:&quot;Reset&quot;,&quot;fIsSuppressible&quot;:false,&quot;fResetAttribute&quot;:&quot;Software system reset&quot;,&quot;fResetStrategies&quot;:[{&quot;fDisplayName&quot;:&quot;Software system reset&quot;,&quot;fLaunchAttribute&quot;:&quot;system_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;Hardware reset&quot;,&quot;fLaunchAttribute&quot;:&quot;hardware_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset hardware\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;Core reset&quot;,&quot;fLaunchAttribute&quot;:&quot;core_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset core\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;None&quot;,&quot;fLaunchAttribute&quot;:&quot;no_reset&quot;,&quot;fGdbCommands&quot;:[],&quot;fCmdOptions&quot;:[&quot;-g&quot;]}],&quot;fGdbCommandGroup&quot;:{&quot;name&quot;:&quot;Additional commands&quot;,&quot;commands&quot;:[]},&quot;fStartApplication&quot;:true}]}"/>
     <booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.enableRtosProxy" value="false"/>
     <stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyCustomProperties" value=""/>
     <stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriver" value="threadx"/>

+ 6 - 6
baModule-slave.ioc

@@ -37,10 +37,10 @@ Dma.USART1_RX.1.Direction=DMA_PERIPH_TO_MEMORY
 Dma.USART1_RX.1.Instance=DMA1_Channel3
 Dma.USART1_RX.1.MemDataAlignment=DMA_MDATAALIGN_BYTE
 Dma.USART1_RX.1.MemInc=DMA_MINC_ENABLE
-Dma.USART1_RX.1.Mode=DMA_NORMAL
+Dma.USART1_RX.1.Mode=DMA_CIRCULAR
 Dma.USART1_RX.1.PeriphDataAlignment=DMA_PDATAALIGN_BYTE
 Dma.USART1_RX.1.PeriphInc=DMA_PINC_DISABLE
-Dma.USART1_RX.1.Priority=DMA_PRIORITY_LOW
+Dma.USART1_RX.1.Priority=DMA_PRIORITY_MEDIUM
 Dma.USART1_RX.1.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority
 Dma.USART1_TX.2.Direction=DMA_MEMORY_TO_PERIPH
 Dma.USART1_TX.2.Instance=DMA1_Channel2
@@ -97,8 +97,8 @@ Mcu.PinsNb=26
 Mcu.ThirdPartyNb=0
 Mcu.UserConstants=
 Mcu.UserName=STM32L082KZTx
-MxCube.Version=6.15.0
-MxDb.Version=DB.6.0.150
+MxCube.Version=6.17.0
+MxDb.Version=DB.6.0.170
 NVIC.ADC1_COMP_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
 NVIC.DMA1_Channel1_IRQn=true\:0\:0\:false\:false\:true\:false\:true\:true
 NVIC.DMA1_Channel2_3_IRQn=true\:0\:0\:false\:false\:true\:false\:true\:true
@@ -198,8 +198,9 @@ ProjectManager.CustomerFirmwarePackage=
 ProjectManager.DefaultFWLocation=true
 ProjectManager.DeletePrevious=true
 ProjectManager.DeviceId=STM32L082KZTx
-ProjectManager.FirmwarePackage=STM32Cube FW_L0 V1.12.3
+ProjectManager.FirmwarePackage=STM32Cube FW_L0 V1.12.4
 ProjectManager.FreePins=false
+ProjectManager.FreePinsContext=
 ProjectManager.HalAssertFull=false
 ProjectManager.HeapSize=0x200
 ProjectManager.KeepUserCode=true
@@ -280,4 +281,3 @@ VP_SYS_VS_Systick.Signal=SYS_VS_Systick
 VP_TIM21_VS_ClockSourceINT.Mode=Internal
 VP_TIM21_VS_ClockSourceINT.Signal=TIM21_VS_ClockSourceINT
 board=custom
-isbadioc=false