From 92e1d5eb78d9d04a89b0413718c8bab6e9af7f63 Mon Sep 17 00:00:00 2001 From: px4dev Date: Wed, 28 Nov 2012 20:12:36 -0800 Subject: Possible fix for #78 - increase the wait timeout for discard when flashing PX4IO. It's not clear this solves the issue, but I can't reproduce it with this added. --- apps/drivers/px4io/uploader.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apps/drivers') diff --git a/apps/drivers/px4io/uploader.cpp b/apps/drivers/px4io/uploader.cpp index 5669aeb01..8b354ff60 100644 --- a/apps/drivers/px4io/uploader.cpp +++ b/apps/drivers/px4io/uploader.cpp @@ -189,8 +189,10 @@ PX4IO_Uploader::drain() int ret; do { - ret = recv(c, 10); - //log("discard 0x%02x", c); + ret = recv(c, 250); + if (ret == OK) { + //log("discard 0x%02x", c); + } } while (ret == OK); } -- cgit v1.2.3 From d16d66f990664481cb8ef6dddd038c575fe16380 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 30 Nov 2012 10:42:27 +0100 Subject: Enabled UART3, added JTAG make target for IO, removed potentially problematic usleep --- Makefile | 15 +++++++++++++-- apps/drivers/px4io/px4io.cpp | 1 - nuttx/configs/px4io/io/defconfig | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'apps/drivers') diff --git a/Makefile b/Makefile index 801256cfe..d9469bb49 100644 --- a/Makefile +++ b/Makefile @@ -114,10 +114,21 @@ endif upload: $(FIRMWARE_BUNDLE) $(UPLOADER) @python -u $(UPLOADER) --port $(SERIAL_PORTS) $(FIRMWARE_BUNDLE) - + +# +# JTAG firmware uploading with OpenOCD +# +ifeq ($(JTAGCONFIG),) +JTAGCONFIG=interface/olimex-jtag-tiny.cfg +endif + upload-jtag-px4fmu: @echo Attempting to flash PX4FMU board via JTAG - @openocd -f interface/olimex-jtag-tiny.cfg -f ../Bootloader/stm32f4x.cfg -c init -c "reset halt" -c "flash write_image erase nuttx/nuttx" -c "flash write_image erase ../Bootloader/px4fmu_bl.elf" -c "reset run" -c shutdown + @openocd -f $(JTAGCONFIG) -f ../Bootloader/stm32f4x.cfg -c init -c "reset halt" -c "flash write_image erase nuttx/nuttx" -c "flash write_image erase ../Bootloader/px4fmu_bl.elf" -c "reset run" -c shutdown + +upload-jtag-px4io: all + @echo Attempting to flash PX4IO board via JTAG + @openocd -f $(JTAGCONFIG) -f ../Bootloader/stm32f1x.cfg -c init -c "reset halt" -c "flash write_image erase nuttx/nuttx" -c "flash write_image erase ../Bootloader/px4io_bl.elf" -c "reset run" -c shutdown # # Hacks and fixups diff --git a/apps/drivers/px4io/px4io.cpp b/apps/drivers/px4io/px4io.cpp index 11f2f6f68..a74437d08 100644 --- a/apps/drivers/px4io/px4io.cpp +++ b/apps/drivers/px4io/px4io.cpp @@ -348,7 +348,6 @@ PX4IO::task_main() /* this would be bad... */ if (ret < 0) { log("poll error %d", errno); - usleep(1000000); continue; } diff --git a/nuttx/configs/px4io/io/defconfig b/nuttx/configs/px4io/io/defconfig index d354ebfe5..7af9c9e4f 100755 --- a/nuttx/configs/px4io/io/defconfig +++ b/nuttx/configs/px4io/io/defconfig @@ -124,7 +124,7 @@ CONFIG_STM32_TIM7=n CONFIG_STM32_WWDG=n CONFIG_STM32_SPI2=n CONFIG_STM32_USART2=y -CONFIG_STM32_USART3=n +CONFIG_STM32_USART3=y CONFIG_STM32_I2C1=y CONFIG_STM32_I2C2=n CONFIG_STM32_BKP=n -- cgit v1.2.3