From: travisutk Date: Sun, 6 May 2012 13:11:06 +0000 (+0000) Subject: Getting closer to working Cortex M3 targets. X-Git-Url: http://git.rot13.org/?p=goodfet;a=commitdiff_plain;h=5bffb24e3e49be3e6667f45950cb158eda019b37;ds=sidebyside Getting closer to working Cortex M3 targets. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@1156 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- diff --git a/firmware/Makefile b/firmware/Makefile index a3ffacd..49dbf99 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -68,14 +68,8 @@ CC =$(GCC) -Wall -O1 -fno-strict-aliasing -g $(CCEXTRA) # your firmware. The "config" variable is just a space-delimited list # of apps you want included. The makefile will take the list of apps # and include all of the proper code needed to build your desired -# firmware. This is generated by config.mk. +# firmware. $(config) is generated by config.mk. -# New default. -# ifeq ($(platform),tilaunchpad) -# config ?= monitor chipcon i2c -# else -# config ?= monitor chipcon spi jtag430 jtag430x2 avr openocd ccspi maxusb -# endif # Build the needed list of app and lib object files from the config @@ -85,7 +79,7 @@ ifeq ($(platform),tilaunchpad) libs= lib/$(platform).o lib/command.o lib/apps.o lib/msp430_serial.o #libs+=lib/setjmp.o else -libs= lib/$(mcu).o lib/command.o lib/dco_calib.o lib/apps.o lib/msp430.o lib/arduino.o +libs= lib/$(mcu).o lib/command.o lib/dco_calib.o lib/apps.o lib/msp430.o lib/arduino.o $(extralibs) endif hdrs= diff --git a/firmware/config.mk b/firmware/config.mk index 554e79a..48829ce 100644 --- a/firmware/config.mk +++ b/firmware/config.mk @@ -47,6 +47,7 @@ LDFLAGS = mcu ?= stm32f407 platform := stm32f4discovery config = monitor +extralibs = lib/cortexm3.o endif ifneq (,$(findstring $(board),facedancer10)) diff --git a/firmware/lib/cortexm3.s b/firmware/lib/cortexm3.s new file mode 100644 index 0000000..cccf7c5 --- /dev/null +++ b/firmware/lib/cortexm3.s @@ -0,0 +1,15 @@ + .syntax unified + .cpu cortex-m3 + .fpu softvfp + .thumb + + +.section .text.Reset_Handler + .weak Reset_Handler + .type Reset_Handler, %function + +Reset_Handler: + mov r0, #0 + ldr r13, =0x20002000 + bl main + diff --git a/firmware/lib/stm32f407.c b/firmware/lib/stm32f407.c index 8e22329..603c0eb 100644 --- a/firmware/lib/stm32f407.c +++ b/firmware/lib/stm32f407.c @@ -1,10 +1,16 @@ -//! MSP430F2618 clock and I/O definitions - -// Included by other 2xx ports, such as the 2274. +/*! \file stm32f407.h + \author Travis Goodspeed + \brief STM32F407 port definitions. +*/ #include "platform.h" +//! Initialize the STM32F4xx ports and USB. +void stm32f4xx_init(){ + +} + //! Receive a byte. unsigned char serial0_rx(){ } @@ -35,16 +41,4 @@ void setbaud1(unsigned char rate){ } -void msp430_init_uart(){ - -} - - -//! Initialization is correct. -void msp430_init_dco_done(){ -} - -//! Initialize the MSP430 clock. -void msp430_init_dco() { -} diff --git a/firmware/platforms/stm32f4discovery.h b/firmware/platforms/stm32f4discovery.h index 4b7c518..2eb33a0 100644 --- a/firmware/platforms/stm32f4discovery.h +++ b/firmware/platforms/stm32f4discovery.h @@ -2,3 +2,7 @@ // Nothing to see here. + +#define INITCHIP stm32f4xx_init(); + +void stm32f4xx_init();