Compare commits
No commits in common. "c43df6e576e6b559fa3481e0ca9f6a1d783fc2c8" and "9343842eae6e619235766f29ed31393e8e70e3d9" have entirely different histories.
c43df6e576
...
9343842eae
6 changed files with 4 additions and 119 deletions
|
|
@ -1,9 +1,9 @@
|
||||||
cmake_minimum_required(VERSION 3.20)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
# Use the fancy version substitution
|
# Use the fancy version substitution
|
||||||
project(main
|
project(cmake-cpputest-template
|
||||||
VERSION 1.0
|
VERSION 1.0
|
||||||
DESCRIPTION "STM32 template for cmake + cpputest"
|
DESCRIPTION "template for cmake + cpputest"
|
||||||
LANGUAGES C CXX
|
LANGUAGES C CXX
|
||||||
)
|
)
|
||||||
enable_testing()
|
enable_testing()
|
||||||
|
|
|
||||||
2
Doxyfile
2
Doxyfile
|
|
@ -42,7 +42,7 @@ DOXYFILE_ENCODING = UTF-8
|
||||||
# title of most generated pages and in a few other places.
|
# title of most generated pages and in a few other places.
|
||||||
# The default value is: My Project.
|
# The default value is: My Project.
|
||||||
|
|
||||||
PROJECT_NAME = "Project"
|
PROJECT_NAME = "My Project"
|
||||||
|
|
||||||
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
|
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
|
||||||
# could be handy for archiving the generated documentation or if some version
|
# could be handy for archiving the generated documentation or if some version
|
||||||
|
|
|
||||||
27
README.md
27
README.md
|
|
@ -1,27 +0,0 @@
|
||||||
# STM32 CMake+CppuTest Template
|
|
||||||
|
|
||||||
## Requirements
|
|
||||||
|
|
||||||
- An ARM compiler and linker.
|
|
||||||
- Bash or a POSIX shell.
|
|
||||||
- CMAKE version 3.20 or newer.
|
|
||||||
- Cpputest 3.8 or newer.
|
|
||||||
- Clangd LSP.
|
|
||||||
- Git version control.
|
|
||||||
|
|
||||||
## Instructions
|
|
||||||
|
|
||||||
1. Clone/copy the repo locally.
|
|
||||||
2. Check the requirements to make sure you're development enviroment is ready.
|
|
||||||
3. Update the linker script files to target your current uC.
|
|
||||||
|
|
||||||
## Running Tests
|
|
||||||
|
|
||||||
|
|
||||||
## TODO
|
|
||||||
|
|
||||||
- [ ] Create or copy a linker.ld file.
|
|
||||||
- [ ] Add a startup file for at least the stm32f103c8t6.
|
|
||||||
- [ ] Add messages for case where tool-chain is missing.
|
|
||||||
- [ ] Check for FreeBSD & Linux compat.
|
|
||||||
- [ ] Add in RTOS stuff.
|
|
||||||
47
linker.ld
47
linker.ld
|
|
@ -1,47 +0,0 @@
|
||||||
/*
|
|
||||||
* Filename: linker.ld
|
|
||||||
* Micro-Controller: stm32f103c8t6
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Program Entry Point:
|
|
||||||
* This part is put into the elf file header.
|
|
||||||
*/
|
|
||||||
ENTRY(Reset_Handler)
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* FORMAT:
|
|
||||||
* R: Read only section.
|
|
||||||
* W: Read/Write section.
|
|
||||||
* X: Executable section.
|
|
||||||
* A: Allocation section.
|
|
||||||
* I: Initialized section.
|
|
||||||
* !: Invert following attribute.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* MEMORY Format:
|
|
||||||
* name [(attr)] : ORIGIN = origin, LENGTH = len
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* You will want to change these values to match your uC.*/
|
|
||||||
MEMORY
|
|
||||||
{
|
|
||||||
FLASH(rx):ORIGIN =0x08000000,LENGTH =64K
|
|
||||||
SRAM(rwx):ORIGIN =0x20000000,LENGTH =20K
|
|
||||||
}
|
|
||||||
|
|
||||||
floating_point = 0;
|
|
||||||
SECTIONS
|
|
||||||
{
|
|
||||||
. = 0x10000;
|
|
||||||
.text : { *(.text) }
|
|
||||||
. = 0x8000000;
|
|
||||||
.data : { *(.data) }
|
|
||||||
.bss : { *(.bss) }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,8 +1,3 @@
|
||||||
add_executable(${PROJECT_NAME}
|
add_executable(main
|
||||||
main.c
|
main.c
|
||||||
)
|
)
|
||||||
|
|
||||||
# Ensure the build rules are defined
|
|
||||||
set_target_properties(${PROJECT_NAME} PROPERTIES SUFFIX ".elf")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
# ###############################
|
|
||||||
# STM32 toolchain file
|
|
||||||
# ###############################
|
|
||||||
|
|
||||||
# Specify the cross-compiler
|
|
||||||
set(CROSS_TOOLCHAIN arm-none-eabi-)
|
|
||||||
set(CMAKE_SYSTEM_NAME Generic)
|
|
||||||
set(CMAKE_SYSTEM_PROCESSOR arm)
|
|
||||||
set(CMAKE_CROSSCOMPILING 1)
|
|
||||||
set(CMAKE_SYSTEM_VERSION 1)
|
|
||||||
|
|
||||||
# Specify the exact Chip
|
|
||||||
|
|
||||||
|
|
||||||
# Programmer and debugging
|
|
||||||
set(PROGRAMMER serialupdi)
|
|
||||||
set(PORT /dev/ttyU0)
|
|
||||||
|
|
||||||
|
|
||||||
# Define the toolchain executables
|
|
||||||
set(CMAKE_C_COMPILER avr-gcc)
|
|
||||||
set(CMAKE_CXX_COMPILER avr-g++)
|
|
||||||
set(CMAKE_ASM_COMPILER avr-gcc)
|
|
||||||
set(CMAKE_LINKER avr-ld)
|
|
||||||
set(CMAKE_OBJCOPY avr-objcopy)
|
|
||||||
set(CMAKE_SIZE avr-size)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Define compile options
|
|
||||||
set(CMAKE_C_FLAGS " -Os -mmcu=${AVR_MCU} -DF_CPU=${F_CPU}")
|
|
||||||
set(CMAKE_CXX_FLAGS "-mmcu=${AVR_MCU} -DF_CPU=${F_CPU}")
|
|
||||||
set(CMAKE_EXE_LINKER_FLAGS_INIT "-mmcu=${AVR_MCU}")
|
|
||||||
|
|
||||||
|
|
||||||
Loading…
Add table
Reference in a new issue