From b952395216f9b5b5a627b675c9fcdfeb617a143f Mon Sep 17 00:00:00 2001 From: Dan Drown Date: Tue, 7 Jun 2016 20:34:36 -0500 Subject: [PATCH 1/4] fix for: PWM on STM32F4 doesn't work right away Credit to hathach for finding and fixing this: https://github.com/rogerclarkmelbourne/Arduino_STM32/issues/178 Fixes #178 --- STM32F4/cores/maple/boards.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STM32F4/cores/maple/boards.cpp b/STM32F4/cores/maple/boards.cpp index ea46f2a..a856571 100644 --- a/STM32F4/cores/maple/boards.cpp +++ b/STM32F4/cores/maple/boards.cpp @@ -158,7 +158,6 @@ static void timerDefaultConfig(timer_dev *dev) { regs->PSC = 1; regs->SR = 0; regs->DIER = 0; - regs->EGR = TIMER_EGR_UG; switch (dev->type) { case TIMER_ADVANCED: @@ -176,5 +175,6 @@ static void timerDefaultConfig(timer_dev *dev) { break; } + regs->EGR = TIMER_EGR_UG; timer_resume(dev); } From 78a10514063bfd1c52cf3808880c57663b127866 Mon Sep 17 00:00:00 2001 From: Martin Ayotte Date: Thu, 30 Jun 2016 14:02:30 -0400 Subject: [PATCH 2/4] fix LeafLab bug in disableBlockingTx() of F4 USBSerial --- STM32F4/cores/maple/usb_serial.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STM32F4/cores/maple/usb_serial.cpp b/STM32F4/cores/maple/usb_serial.cpp index d606855..cc726c2 100644 --- a/STM32F4/cores/maple/usb_serial.cpp +++ b/STM32F4/cores/maple/usb_serial.cpp @@ -149,7 +149,7 @@ void USBSerial::enableBlockingTx(void) { } void USBSerial::disableBlockingTx(void) { - usbEnableBlockingTx(); + usbDisableBlockingTx(); } USBSerial SerialUSB; From a301d4cc7629a02802a8f88ef785a2db6c655a3f Mon Sep 17 00:00:00 2001 From: Martin Ayotte Date: Thu, 30 Jun 2016 14:04:26 -0400 Subject: [PATCH 3/4] add forgotten flag for NETDUINO2PLUS --- STM32F4/boards.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STM32F4/boards.txt b/STM32F4/boards.txt index c6841e4..453d520 100644 --- a/STM32F4/boards.txt +++ b/STM32F4/boards.txt @@ -79,7 +79,7 @@ netduino2plus.upload.dfuse_addr=0x8000000 netduino2plus.build.mcu=cortex-m4 netduino2plus.build.f_cpu=168000000L netduino2plus.build.core=maple -netduino2plus.build.extra_flags=-DMCU_STM32F406VG -mthumb -DSTM32_HIGH_DENSITY -DSTM32F2 -DSTM32F4 -DBOARD_discovery_f4 +netduino2plus.build.extra_flags=-DMCU_STM32F406VG -mthumb -DSTM32_HIGH_DENSITY -DSTM32F2 -DSTM32F4 -DBOARD_discovery_f4 -DARDUINO_STM32F4_NETDUINO2PLUS netduino2plus.build.ldscript=ld/jtag.ld netduino2plus.build.variant=discovery_f407 netduino2plus.build.variant_system_lib=lib_f407.a From 8c6f302e9cdc46d23c9e17c24714e49caef79a30 Mon Sep 17 00:00:00 2001 From: Roger Clark Date: Sat, 16 Jul 2016 09:15:32 +1000 Subject: [PATCH 4/4] Effecively disabled the code that waits for serial device re-enumeration See http://stm32duino.com/viewtopic.php?f=35&t=1251 --- tools/linux/stlink_upload | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/linux/stlink_upload b/tools/linux/stlink_upload index 24e528d..f0dd789 100755 --- a/tools/linux/stlink_upload +++ b/tools/linux/stlink_upload @@ -1,4 +1,8 @@ #!/bin/bash +$(dirname $0)/stlink/st-flash write "$4" 0x8000000 +exit 0 + +## Remove the lines 2 and 3 (above) if you want this script to wait until the Serial device has been enumerated and loaded before the script exits # Check for leaf device. function leaf_status()