Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start to STM32F4XX port #8

Merged
merged 36 commits into from
Jun 26, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
ed9e0c1
Start adding STM32F4 cmsis and placeholders for the C API
oampo Apr 18, 2013
d18875b
Add nvic dynamic vector handling.
oampo Apr 19, 2013
40abe5f
Add STM32 to the buildchain
oampo Apr 24, 2013
4718fc6
Add alternative function to pinmap for STM32.
oampo Apr 24, 2013
96f69ae
Add untested port api
oampo Apr 24, 2013
883d985
Add analog in api
oampo Apr 24, 2013
93b0048
Add GPIO api
oampo Apr 24, 2013
56ad7f7
Add I2C master mode API
oampo Apr 24, 2013
7acc783
Add SPI api
oampo Apr 24, 2013
f51b151
Add pinmap.
oampo Apr 24, 2013
a28d170
Add define to let stm32f4xx.h know which uC version we are working with.
oampo Apr 24, 2013
f1a1835
Add device specific pin definitions, etc.
oampo Apr 24, 2013
b4c4ae8
Add options.json file for STM32.
oampo Apr 24, 2013
0b01040
Lots of small changes which get us compiling.
oampo Apr 24, 2013
179b7f6
Add us_ticker api.
oampo Apr 24, 2013
8efa81b
Lot of small fixes to cmsis code so it works correctly.
oampo May 13, 2013
e6ff45d
Remove moved options file.
oampo May 13, 2013
8ffca41
Generate update event when initializing the ticker so the new prescaler
oampo May 14, 2013
3a0c872
Small fixes to the GPIO api, meaning it works!
oampo May 14, 2013
4e68eae
Make pinmap and port API use the correct memory region for the GPIOs.
oampo May 14, 2013
bec4eca
Add fixes for us_ticker so it updates the prescale register after the
oampo May 15, 2013
9329d73
Leave enough space at the start of the RAM block for the dynamic
oampo May 16, 2013
e06063a
Lots of small fixes to make SPI work.
oampo May 16, 2013
a71c955
Various small fixes to get I2C working.
oampo May 28, 2013
9e3cd7f
Make GPIOs use high-speed mode
oampo May 31, 2013
a3fd58b
Initialize the I2S PLL in the system startup.
oampo May 31, 2013
32e7bb8
GPIO fixes to make digital input work.
oampo Jun 3, 2013
79bb66b
Small fixes to make analog in work.
oampo Jun 3, 2013
af5bc35
Changes to make port api work.
oampo Jun 4, 2013
fe625b1
Remove empty files, and not ported driver code.
oampo Jun 4, 2013
9d488c6
Make toolchain use hard float, and remove debugging statement.
oampo Jun 5, 2013
425f177
Untested start to USB device support.
oampo Jun 5, 2013
92a5e41
Merge branch 'master' into STM32F4
oampo Jun 19, 2013
0523687
Merge branch 'cortex-m4-float-options' into STM32F4
oampo Jun 19, 2013
3e40b90
Merge branch 'master' of git://github.com/mbedmicro/mbed into STM32F4
oampo Jun 26, 2013
6bfe908
Remove start to USB Device so only tested code is merged.
oampo Jun 26, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions libraries/mbed/common/pinmap_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ void pinmap_pinout(PinName pin, const PinMap *map) {
while (map->pin != NC) {
if (map->pin == pin) {
pin_function(pin, map->function);
#if defined(TARGET_STM32F407)
pin_alternate_function(pin, map->alternate_function);
#endif
pin_mode(pin, PullNone);
return;
}
Expand Down
6 changes: 6 additions & 0 deletions libraries/mbed/hal/pinmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,15 @@ typedef struct {
PinName pin;
int peripheral;
int function;
#if defined(TARGET_STM32F407)
int alternate_function;
#endif
} PinMap;

void pin_function(PinName pin, int function);
# if defined(TARGET_STM32F407)
void pin_alternate_function(PinName pin, int alternate_function);
#endif
void pin_mode (PinName pin, PinMode mode);

uint32_t pinmap_peripheral(PinName pin, const PinMap* map);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
/* Linker script for STM32F407 */

/* Linker script to configure memory regions. */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K
RAM (rwx) : ORIGIN = 0x20000188, LENGTH = 0x1FE78
}

/* Linker script to place sections and symbol values. Should be used together
* with other linker script that defines memory regions FLASH and RAM.
* It references following symbols, which must be defined in code:
* Reset_Handler : Entry of reset handler
*
* It defines following symbols, which code can use without definition:
* __exidx_start
* __exidx_end
* __etext
* __data_start__
* __preinit_array_start
* __preinit_array_end
* __init_array_start
* __init_array_end
* __fini_array_start
* __fini_array_end
* __data_end__
* __bss_start__
* __bss_end__
* __end__
* end
* __HeapLimit
* __StackLimit
* __StackTop
* __stack
*/
ENTRY(Reset_Handler)

SECTIONS
{
.text :
{
KEEP(*(.isr_vector))
*(.text*)

KEEP(*(.init))
KEEP(*(.fini))

/* .ctors */
*crtbegin.o(.ctors)
*crtbegin?.o(.ctors)
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
*(SORT(.ctors.*))
*(.ctors)

/* .dtors */
*crtbegin.o(.dtors)
*crtbegin?.o(.dtors)
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
*(SORT(.dtors.*))
*(.dtors)

*(.rodata*)

KEEP(*(.eh_frame*))
} > FLASH

.ARM.extab :
{
*(.ARM.extab* .gnu.linkonce.armextab.*)
} > FLASH

__exidx_start = .;
.ARM.exidx :
{
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
} > FLASH
__exidx_end = .;

__etext = .;

.data : AT (__etext)
{
__data_start__ = .;
*(vtable)
*(.data*)

. = ALIGN(4);
/* preinit data */
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP(*(.preinit_array))
PROVIDE_HIDDEN (__preinit_array_end = .);

. = ALIGN(4);
/* init data */
PROVIDE_HIDDEN (__init_array_start = .);
KEEP(*(SORT(.init_array.*)))
KEEP(*(.init_array))
PROVIDE_HIDDEN (__init_array_end = .);


. = ALIGN(4);
/* finit data */
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP(*(SORT(.fini_array.*)))
KEEP(*(.fini_array))
PROVIDE_HIDDEN (__fini_array_end = .);

KEEP(*(.jcr*))
. = ALIGN(4);
/* All data end */
__data_end__ = .;

} > RAM

.bss :
{
. = ALIGN(4);
__bss_start__ = .;
*(.bss*)
*(COMMON)
. = ALIGN(4);
__bss_end__ = .;
} > RAM

.heap (COPY):
{
__end__ = .;
end = __end__;
*(.heap*)
__HeapLimit = .;
} > RAM

/* .stack_dummy section doesn't contains any symbols. It is only
* used for linker to calculate size of stack sections, and assign
* values to stack symbols later */
.stack_dummy (COPY):
{
*(.stack*)
} > RAM

/* Set stack top to end of RAM, and stack limit move down by
* size of stack_dummy section */
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
PROVIDE(__stack = __StackTop);

/* Check if data + heap + stack exceeds RAM limit */
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
}

Loading