Fix build for f4discovery host.

This commit is contained in:
Gareth McMullin 2013-03-17 10:17:05 +13:00
parent 931cd97f15
commit 87dad080e1
5 changed files with 10 additions and 7 deletions

View File

@ -2,13 +2,15 @@ CROSS_COMPILE ?= arm-none-eabi-
CC = $(CROSS_COMPILE)gcc CC = $(CROSS_COMPILE)gcc
OBJCOPY = $(CROSS_COMPILE)objcopy OBJCOPY = $(CROSS_COMPILE)objcopy
CFLAGS += -Istm32/include -mcpu=cortex-m3 -mthumb \ CFLAGS += -Istm32/include -mcpu=cortex-m4 -mthumb \
-mfloat-abi=hard -mfpu=fpv4-sp-d16 \
-DSTM32F4 -DF4DISCOVERY -I../libopencm3/include \ -DSTM32F4 -DF4DISCOVERY -I../libopencm3/include \
-Iplatforms/stm32 -Iplatforms/stm32
LDFLAGS_BOOT = -lopencm3_stm32f4 -Wl,--defsym,_stack=0x20020000 \ LDFLAGS_BOOT = -lopencm3_stm32f4 -Wl,--defsym,_stack=0x20020000 \
-Wl,-T,platforms/stm32/f4discovery.ld -nostartfiles -lc -lnosys \ -Wl,-T,platforms/stm32/f4discovery.ld -nostartfiles -lc -lnosys \
-Wl,-Map=mapfile -mthumb -mcpu=cortex-m3 -Wl,-gc-sections \ -Wl,-Map=mapfile -mthumb -mcpu=cortex-m4 -Wl,-gc-sections \
-mfloat-abi=hard -mfpu=fpv4-sp-d16 \
-L../libopencm3/lib -L../libopencm3/lib
LDFLAGS = $(LDFLAGS_BOOT) -Wl,-Ttext=0x8010000 LDFLAGS = $(LDFLAGS_BOOT) -Wl,-Ttext=0x8010000

View File

@ -38,7 +38,7 @@
#define BOARD_IDENT "Black Magic Probe (F4Discovery), (Firmware 1.5" VERSION_SUFFIX ", build " BUILDDATE ")" #define BOARD_IDENT "Black Magic Probe (F4Discovery), (Firmware 1.5" VERSION_SUFFIX ", build " BUILDDATE ")"
#define BOARD_IDENT_DFU "Black Magic (Upgrade) for F4Discovery, (Firmware 1.5" VERSION_SUFFIX ", build " BUILDDATE ")" #define BOARD_IDENT_DFU "Black Magic (Upgrade) for F4Discovery, (Firmware 1.5" VERSION_SUFFIX ", build " BUILDDATE ")"
#define DFU_IDENT "Black Magic Firmware Upgrade (F4Discovery" #define DFU_IDENT "Black Magic Firmware Upgrade (F4Discovery"
#define IFACE_STRING "@Internal Flash /0x08000000/1*016Ka,3*016Kg,1*064Kg,7*128Kg" #define DFU_IFACE_STRING "@Internal Flash /0x08000000/1*016Ka,3*016Kg,1*064Kg,7*128Kg"
extern usbd_device *usbdev; extern usbd_device *usbdev;
#define CDCACM_GDB_ENDPOINT 1 #define CDCACM_GDB_ENDPOINT 1

View File

@ -22,6 +22,7 @@
#elif defined(STM32F4) #elif defined(STM32F4)
# include <libopencm3/stm32/f4/flash.h> # include <libopencm3/stm32/f4/flash.h>
#endif #endif
#include <libopencm3/cm3/scb.h>
#include "usbdfu.h" #include "usbdfu.h"

View File

@ -32,10 +32,6 @@
#include "usbdfu.h" #include "usbdfu.h"
/* Commands sent with wBlockNum == 0 as per ST implementation. */
#define CMD_SETADDR 0x21
#define CMD_ERASE 0x41
usbd_device *usbdev; usbd_device *usbdev;
/* We need a special large control buffer for this device: */ /* We need a special large control buffer for this device: */
u8 usbd_control_buffer[1024]; u8 usbd_control_buffer[1024];

View File

@ -25,6 +25,10 @@
# define APP_ADDRESS 0x08002000 # define APP_ADDRESS 0x08002000
#endif #endif
/* Commands sent with wBlockNum == 0 as per ST implementation. */
#define CMD_SETADDR 0x21
#define CMD_ERASE 0x41
/* dfucore.c - DFU core, common to libopencm3 platforms. */ /* dfucore.c - DFU core, common to libopencm3 platforms. */
void dfu_init(const usbd_driver *driver); void dfu_init(const usbd_driver *driver);
void dfu_main(void); void dfu_main(void);