Quellcode durchsuchen

🐛 Fix Maple / STM32 serial buffer (#22292)

ldursw vor 3 Jahren
Ursprung
Commit
0595b87d9a
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden

+ 0
- 12
buildroot/share/PlatformIO/scripts/fix_framework_weakness.py Datei anzeigen

30
         print("Done patching exception handler")
30
         print("Done patching exception handler")
31
 
31
 
32
     print("Libmaple modified and ready for post mortem debugging")
32
     print("Libmaple modified and ready for post mortem debugging")
33
-
34
-mf = env["MARLIN_FEATURES"]
35
-rxBuf = mf["RX_BUFFER_SIZE"] if "RX_BUFFER_SIZE" in mf else "0"
36
-txBuf = mf["TX_BUFFER_SIZE"] if "TX_BUFFER_SIZE" in mf else "0"
37
-if int(rxBuf) < 64:
38
-	rxBuf = "64"
39
-if int(txBuf) < 64:
40
-	txBuf = "64"
41
-
42
-build_flags = env.get('BUILD_FLAGS')
43
-build_flags.append("-DUSART_RX_BUF_SIZE=" + rxBuf + " -DUSART_TX_BUF_SIZE=" + txBuf)
44
-env.Replace(BUILD_FLAGS=build_flags)

+ 6
- 1
buildroot/share/PlatformIO/scripts/stm32_serialbuffer.py Datei anzeigen

13
 #
13
 #
14
 # The script will set the value as the default one (64 bytes)
14
 # The script will set the value as the default one (64 bytes)
15
 # or the user-configured one, whichever is higher.
15
 # or the user-configured one, whichever is higher.
16
+#
17
+# Marlin has 128 and 32 as default values for RX_BUFFER_SIZE and
18
+# TX_BUFFER_SIZE respectively. We use the highest value.
16
 mf = env["MARLIN_FEATURES"]
19
 mf = env["MARLIN_FEATURES"]
17
-rxBuf = str(max(64, int(mf["RX_BUFFER_SIZE"]) if "RX_BUFFER_SIZE" in mf else 0))
20
+rxBuf = str(max(128, int(mf["RX_BUFFER_SIZE"]) if "RX_BUFFER_SIZE" in mf else 0))
18
 txBuf = str(max(64, int(mf["TX_BUFFER_SIZE"]) if "TX_BUFFER_SIZE" in mf else 0))
21
 txBuf = str(max(64, int(mf["TX_BUFFER_SIZE"]) if "TX_BUFFER_SIZE" in mf else 0))
19
 
22
 
20
 build_flags = env.get('BUILD_FLAGS')
23
 build_flags = env.get('BUILD_FLAGS')
21
 build_flags.append("-DSERIAL_RX_BUFFER_SIZE=" + rxBuf)
24
 build_flags.append("-DSERIAL_RX_BUFFER_SIZE=" + rxBuf)
22
 build_flags.append("-DSERIAL_TX_BUFFER_SIZE=" + txBuf)
25
 build_flags.append("-DSERIAL_TX_BUFFER_SIZE=" + txBuf)
26
+build_flags.append("-DUSART_RX_BUF_SIZE=" + rxBuf)
27
+build_flags.append("-DUSART_TX_BUF_SIZE=" + txBuf)
23
 env.Replace(BUILD_FLAGS=build_flags)
28
 env.Replace(BUILD_FLAGS=build_flags)

+ 3
- 1
ini/stm32f1-maple.ini Datei anzeigen

36
 platform_packages = tool-stm32duino
36
 platform_packages = tool-stm32duino
37
 extra_scripts     = ${common.extra_scripts}
37
 extra_scripts     = ${common.extra_scripts}
38
   pre:buildroot/share/PlatformIO/scripts/fix_framework_weakness.py
38
   pre:buildroot/share/PlatformIO/scripts/fix_framework_weakness.py
39
+  pre:buildroot/share/PlatformIO/scripts/stm32_serialbuffer.py
39
 
40
 
40
 #
41
 #
41
 # STM32F103RC
42
 # STM32F103RC
325
 platform      = ${common_stm32f1.platform}
326
 platform      = ${common_stm32f1.platform}
326
 extends       = common_stm32f1
327
 extends       = common_stm32f1
327
 board         = marlin_CHITU_F103
328
 board         = marlin_CHITU_F103
328
-extra_scripts = pre:buildroot/share/PlatformIO/scripts/common-dependencies.py
329
+extra_scripts = ${common_stm32f1.extra_scripts}
330
+  pre:buildroot/share/PlatformIO/scripts/common-dependencies.py
329
   pre:buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py
331
   pre:buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py
330
   buildroot/share/PlatformIO/scripts/chitu_crypt.py
332
   buildroot/share/PlatformIO/scripts/chitu_crypt.py
331
 build_flags   = ${common_stm32f1.build_flags}
333
 build_flags   = ${common_stm32f1.build_flags}

+ 2
- 2
ini/stm32f1.ini Datei anzeigen

150
 board_build.offset   = 0x7000
150
 board_build.offset   = 0x7000
151
 board_upload.offset_address = 0x08007000
151
 board_upload.offset_address = 0x08007000
152
 build_unflags        = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC
152
 build_unflags        = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC
153
-extra_scripts        = ${common.extra_scripts}
153
+extra_scripts        = ${common_stm32.extra_scripts}
154
   pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
154
   pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
155
   pre:buildroot/share/PlatformIO/scripts/random-bin.py
155
   pre:buildroot/share/PlatformIO/scripts/random-bin.py
156
   buildroot/share/PlatformIO/scripts/stm32_bootloader.py
156
   buildroot/share/PlatformIO/scripts/stm32_bootloader.py
174
 board_build.offset   = 0x7000
174
 board_build.offset   = 0x7000
175
 board_upload.offset_address = 0x08007000
175
 board_upload.offset_address = 0x08007000
176
 build_unflags        = ${common_stm32.build_unflags}
176
 build_unflags        = ${common_stm32.build_unflags}
177
-extra_scripts        = ${common.extra_scripts}
177
+extra_scripts        = ${common_stm32.extra_scripts}
178
   pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
178
   pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
179
   buildroot/share/PlatformIO/scripts/stm32_bootloader.py
179
   buildroot/share/PlatformIO/scripts/stm32_bootloader.py
180
 debug_tool           = jlink
180
 debug_tool           = jlink

Laden…
Abbrechen
Speichern