From 1633a224f391645709135459090aee2ac62fd826 Mon Sep 17 00:00:00 2001 From: Razvalyaev Date: Wed, 5 Mar 2025 13:04:40 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B1=D0=BB=D0=B5=D0=BC?= =?UTF-8?q?=D0=B0=20=D0=B1=D1=8B=D0=BB=D0=B0=20=D0=B2=20=D0=BD=D0=B5=D0=B2?= =?UTF-8?q?=D1=8B=D1=80=D0=BE=D0=B2=D0=BD=D0=B5=D0=BD=D1=8B=D1=85=20=D0=B4?= =?UTF-8?q?=D0=B0=D0=BD=D0=BD=D1=8B=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit была строчка sensor->sensROM = *(uint64_t *)(ROM); и она требует чтобы указатель ROM был выровнен по 4 байта Но он не выровнен, потому что шаг модбас структуры 2 байта и он оказывается смещен на 2 байта вместо 4 Добавил резервные 2 байта, чтобы адрес быо кратен 4 байтам --- Core/Modbus/modbus_data.h | 3 +- MDK-ARM/PY32Dallas.uvoptx | 87 ++++++++++++++++----------------------- 2 files changed, 38 insertions(+), 52 deletions(-) diff --git a/Core/Modbus/modbus_data.h b/Core/Modbus/modbus_data.h index 15222ce..c841c33 100644 --- a/Core/Modbus/modbus_data.h +++ b/Core/Modbus/modbus_data.h @@ -54,7 +54,8 @@ typedef struct //MB_DataInRegsTypeDef { uint16_t SensTemperature[DS18B20_DEVICE_AMOUNT]; MB_SensorParamsTypeDef Response; - uint16_t AllROMs[DS18B20_DEVICE_AMOUNT][4]; + uint16_t reserved; + uint16_t AllROMs[DS18B20_DEVICE_AMOUNT][4]; }MB_DataInRegsTypeDef; diff --git a/MDK-ARM/PY32Dallas.uvoptx b/MDK-ARM/PY32Dallas.uvoptx index df7ffaf..fe7e885 100644 --- a/MDK-ARM/PY32Dallas.uvoptx +++ b/MDK-ARM/PY32Dallas.uvoptx @@ -153,7 +153,24 @@ (105=-1,-1,-1,-1,0) - + + + 0 + 0 + 252 + 1 +
134221158
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\Core\Dallas\dallas_tools.c + + \\Project\../Core/Dallas/dallas_tools.c\252 +
+
0 @@ -168,92 +185,52 @@ 2 1 - module2 + ROM 3 1 - *(volatile uint32_t *)0xE0001000 + hmodbus1,0x0A 4 1 - scratchpad + RS_Buffer,0x10 5 1 - ROM + mb_location 6 1 - start,0x0A + *(uint64_t *)(ROM) 7 1 - end,0x0A + *ROM 8 1 - (uint16_t)htim1.Instance->CNT-start,0x0A + sensor->sensROM 9 1 - end-start,0x0A + sensor 10 1 - ((uint16_t)htim1.Instance->CNT-start <(end-start)),0x0A + (uint64_t *)(ROM) 11 1 - ((uint16_t)htim1.Instance->CNT-start < us*tim_1us_period),0x0A - - - 12 - 1 - (uint16_t)htim1.Instance->CNT-start,0x0A - - - 13 - 1 - hmodbus1,0x0A - - - 14 - 1 - RS_Buffer,0x10 - - - 15 - 1 - mb_location - - - 16 - 1 - DS - - - 17 - 1 - \\Project\../Core/PY32Module/PY32module_main.c\pchsens.module3 - - - 18 - 1 - \\Project\../Core/PY32Module/PY32module_main.c\pchsens.module4 - - - 19 - 1 - scan_cnt + (uint32_t *)(0x20000076) @@ -283,6 +260,14 @@ hmodbus1 + + + 1 + 0 + 0x20000058-2 + 0 + + 0