Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
STM32F407
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
E7020E Embedded Systems
STM32F407
Commits
18194afa
Commit
18194afa
authored
9 years ago
by
Henrik Tjäder
Browse files
Options
Downloads
Patches
Plain Diff
Added makefile, linker script and GDB-init
parent
5b22528b
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
.gdbinit
+8
-0
8 additions, 0 deletions
.gdbinit
.gitignore
+2
-3
2 additions, 3 deletions
.gitignore
Makefile
+100
-0
100 additions, 0 deletions
Makefile
README.md
+1
-1
1 addition, 1 deletion
README.md
stm32f4_flash.ld
+192
-0
192 additions, 0 deletions
stm32f4_flash.ld
with
303 additions
and
4 deletions
.gdbinit
0 → 100644
+
8
−
0
View file @
18194afa
define reload
kill
monitor jtag_reset
load
end
target extended localhost:4242
load
This diff is collapsed.
Click to expand it.
.gitignore
+
2
−
3
View file @
18194afa
Debug
Debug
Lab4-serial.elf.launch
Lab4-serial.elf.launch
stm32f4_flash.ld
.cproject
.cproject
.settings
.settings
serial.elf.launch
serial.elf.launch
.project
.project
kuppe
.elf
*
.elf
kuppe
.hex
*
.hex
src/.main.c.swp
src/.main.c.swp
This diff is collapsed.
Click to expand it.
Makefile
0 → 100644
+
100
−
0
View file @
18194afa
TARGET
=
stm32f4.hex
EXECUTABLE
=
stm32f4.elf
CC
=
arm-none-eabi-gcc
LD
=
arm-none-eabi-ld
#LD=arm-none-eabi-gcc
AR
=
arm-none-eabi-ar
AS
=
arm-none-eabi-as
CP
=
arm-none-eabi-objcopy
OD
=
arm-none-eabi-objdump
BIN
=
$(
CP
)
-O
ihex
#DEFS = -DUSE_STDPERIPH_DRIVER -DSTM32F4XX -DMANGUSTA_DISCOVERY -DUSE_USB_OTG_FS -DHSE_VALUE=8000000
#DEFS = -DUSE_STDPERIPH_DRIVER -DSTM32F4XX -DSTM32F40XX -DHSE_VALUE=8000000
DEFS
=
-DUSE_STDPERIPH_DRIVER
-DSTM32F40XX
-DSTM32F4XX
-DHSE_VALUE
=
16000000
MCU
=
cortex-m4
MCFLAGS
=
--specs
=
nosys.specs
--specs
=
nano.specs
-lc
-lnosys
-mcpu
=
$(
MCU
)
-mthumb
-mlittle-endian
-mfpu
=
fpv4-sp-d16
-mfloat-abi
=
hard
-mthumb-interwork
-std
=
gnu90
-ffunction-sections
-fdata-sections
-g
-Wall
STM32_INCLUDES
=
-ILibraries
/CMSIS/Include/
\
-ILibraries
/STM32F4xx_StdPeriph_Driver/inc/
\
-ILibraries
/Device/STM32F4xx/Include/
\
-Isrc
/
\
#Not using USB
#-ILibraries/STM32_USB_Device_Library/Class/hid/inc \
#-ILibraries/STM32_USB_Device_Library/Core/inc/ \
#-ILibraries/STM32_USB_OTG_Driver/inc/
# Optimize for size
#OPTIMIZE = -Os
# No optimization at all
OPTIMIZE
=
-O0
CFLAGS
=
$(
MCFLAGS
)
$(
OPTIMIZE
)
$(
DEFS
)
-I
./
-I
./
$(
STM32_INCLUDES
)
-Wl
,-gc-sections,-T,stm32f4_flash.ld
AFLAGS
=
$(
MCFLAGS
)
#-mapcs-float use float regs. small increase in code size
#STM32_USB_OTG_SRC = Libraries/STM32_USB_OTG_Driver/src/usb_dcd_int.c \
#Not using USB
#Libraries/STM32_USB_OTG_Driver/src/usb_core.c \
#Libraries/STM32_USB_OTG_Driver/src/usb_dcd.c \
#Not using USB
#STM32_USB_DEVICE_SRC =
#Libraries/STM32_USB_Device_Library/Core/src/usbd_req.c \
#Libraries/STM32_USB_Device_Library/Core/src/usbd_core.c \
#Libraries/STM32_USB_Device_Library/Core/src/usbd_ioreq.c
SRC
=
src/main.c
\
src/stm32f4xx_it.c
\
src/system_stm32f4xx.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/misc.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_adc.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_can.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_crc.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_cryp_aes.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_cryp.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_cryp_des.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_cryp_tdes.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dac.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dbgmcu.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dcmi.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dma.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_exti.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_flash.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_fsmc.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_gpio.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_hash.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_hash_md5.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_hash_sha1.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_i2c.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_iwdg.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_pwr.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rng.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rtc.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_sdio.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_spi.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_syscfg.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_tim.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_usart.c
\
Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_wwdg.c
STARTUP
=
src/startup_stm32f40xx.s
OBJDIR
=
.
OBJ
=
$(
SRC:%.c
=
$(
OBJDIR
)
/%.o
)
OBJ
+=
Startup.o
all
:
$(TARGET)
$(TARGET)
:
$(EXECUTABLE)
$(
CP
)
-O
ihex
$^
$@
$(EXECUTABLE)
:
$(SRC) $(STARTUP)
$(
CC
)
$(
CFLAGS
)
$^
-o
$@
clean
:
rm
-f
Startup.lst
$(
TARGET
)
$(
TARGET
)
.lst
$(
OBJ
)
$(
AUTOGEN
)
$(
TARGET
)
.out
$(
TARGET
)
.hex
$(
TARGET
)
.map
$(
TARGET
)
.dmp
$(
TARGET
)
.elf
This diff is collapsed.
Click to expand it.
README.md
+
1
−
1
View file @
18194afa
...
@@ -21,7 +21,7 @@ Compile with regular GNU make:
...
@@ -21,7 +21,7 @@ Compile with regular GNU make:
Modify the Makefile and linker scripts to suit your requirements.
Modify the Makefile and linker scripts to suit your requirements.
Possibly change the memory size in stm32_
linker
.ld,
Possibly change the memory size in stm32_
flash
.ld,
included libraries in the Makefile.
included libraries in the Makefile.
Connect your MCU and connect st-link.
Connect your MCU and connect st-link.
...
...
This diff is collapsed.
Click to expand it.
stm32f4_flash.ld
0 → 100644
+
192
−
0
View file @
18194afa
/*
*****************************************************************************
**
** File : stm32_flash.ld
**
** Abstract : Linker script for STM32F407VG Device with
** 1024KByte FLASH, 128KByte RAM
**
** Set heap size, stack size and stack location according
** to application requirements.
**
** Set memory bank area and size if external memory is used.
**
** Target : STMicroelectronics STM32
**
** Distribution: The file is distributed "as is", without any warranty
** of any kind.
**
*****************************************************************************
*/
/* Entry Point */
ENTRY(Reset_Handler)
/* Highest address of the user mode stack */
_estack = 0x20020000; /* end of 128K RAM */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0; /* required amount of heap */
_Min_Stack_Size = 0x400; /* required amount of stack */
/* Specify the memory areas */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
/*FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K*/
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K
CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
}
/* Define output sections */
SECTIONS
{
/* The startup code goes first into FLASH */
.isr_vector :
{
. = ALIGN(4);
KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(4);
} >FLASH
/* The program code and other data goes into FLASH */
.text :
{
. = ALIGN(4);
*(.text) /* .text sections (code) */
*(.text*) /* .text* sections (code) */
*(.glue_7) /* glue arm to thumb code */
*(.glue_7t) /* glue thumb to arm code */
*(.eh_frame)
KEEP (*(.init))
KEEP (*(.fini))
. = ALIGN(4);
_etext = .; /* define a global symbols at end of code */
} >FLASH
/* Constant data goes into FLASH */
.rodata :
{
. = ALIGN(4);
*(.rodata) /* .rodata sections (constants, strings, etc.) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
. = ALIGN(4);
} >FLASH
.ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
.ARM : {
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
} >FLASH
.preinit_array :
{
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP (*(.preinit_array*))
PROVIDE_HIDDEN (__preinit_array_end = .);
} >FLASH
.init_array :
{
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array*))
PROVIDE_HIDDEN (__init_array_end = .);
} >FLASH
.fini_array :
{
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(SORT(.fini_array.*)))
KEEP (*(.fini_array*))
PROVIDE_HIDDEN (__fini_array_end = .);
} >FLASH
/* used by the startup to initialize data */
_sidata = LOADADDR(.data);
/* Initialized data sections goes into RAM, load LMA copy after code */
.data :
{
. = ALIGN(4);
_sdata = .; /* create a global symbol at data start */
*(.data) /* .data sections */
*(.data*) /* .data* sections */
. = ALIGN(4);
_edata = .; /* define a global symbol at data end */
} >RAM AT> FLASH
_siccmram = LOADADDR(.ccmram);
/* CCM-RAM section
*
* IMPORTANT NOTE!
* If initialized variables will be placed in this section,
* the startup code needs to be modified to copy the init-values.
*/
.ccmram :
{
. = ALIGN(4);
_sccmram = .; /* create a global symbol at ccmram start */
*(.ccmram)
*(.ccmram*)
. = ALIGN(4);
_eccmram = .; /* create a global symbol at ccmram end */
} >CCMRAM AT> FLASH
/* Uninitialized data section */
. = ALIGN(4);
.bss :
{
/* This is used by the startup in order to initialize the .bss secion */
_sbss = .; /* define a global symbol at bss start */
__bss_start__ = _sbss;
*(.bss)
*(.bss*)
*(COMMON)
. = ALIGN(4);
_ebss = .; /* define a global symbol at bss end */
__bss_end__ = _ebss;
} >RAM
/* User_heap_stack section, used to check that there is enough RAM left */
._user_heap_stack :
{
. = ALIGN(4);
PROVIDE ( end = . );
PROVIDE ( _end = . );
. = . + _Min_Heap_Size;
. = . + _Min_Stack_Size;
. = ALIGN(4);
} >RAM
/* MEMORY_bank1 section, code must be located here explicitly */
/* Example: extern int foo(void) __attribute__ ((section (".mb1text"))); */
.memory_b1_text :
{
*(.mb1text) /* .mb1text sections (code) */
*(.mb1text*) /* .mb1text* sections (code) */
*(.mb1rodata) /* read-only data (constants) */
*(.mb1rodata*)
} >MEMORY_B1
/* Remove information from the standard libraries */
/*/DISCARD/ :*/
/*{*/
/*libc.a ( * )*/
/*libm.a ( * )*/
/*libgcc.a ( * )*/
/*}*/
.ARM.attributes 0 : { *(.ARM.attributes) }
}
/* Nice to have */
__isr_vector_size__ = SIZEOF(.isr_vector);
__text_size__ = SIZEOF(.text);
__data_size__ = SIZEOF(.data);
__bss_size__ = SIZEOF(.bss);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment