-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #367 from adafruit/fix-322
Fix 322
- Loading branch information
Showing
22 changed files
with
284 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
cmake_minimum_required(VERSION 3.17) | ||
|
||
include(${CMAKE_CURRENT_LIST_DIR}/../family_support.cmake) | ||
|
||
project(tinyuf2 C ASM) | ||
set(CMAKE_EXECUTABLE_SUFFIX .elf) | ||
|
||
#------------------------------------ | ||
# TinyUF2 | ||
#------------------------------------ | ||
add_executable(tinyuf2 | ||
board_flash.c | ||
boards.c | ||
${TOP}/lib/tinyusb/src/portable/synopsys/dwc2/dcd_dwc2.c | ||
) | ||
target_link_options(tinyuf2 PUBLIC | ||
"LINKER:--script=${CMAKE_CURRENT_LIST_DIR}/linker/stm32f4_boot.ld" | ||
) | ||
|
||
family_configure_tinyuf2(tinyuf2 OPT_MCU_STM32F4) | ||
family_flash_jlink(tinyuf2) | ||
|
||
#------------------------------------ | ||
# Application (e.g self update) | ||
#------------------------------------ | ||
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/apps/self_update) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#------------------------------------ | ||
# Self Update | ||
# This file is meant to be include by add_subdirectory() in the root CMakeLists.txt | ||
#------------------------------------ | ||
|
||
# Generate bootloader_bin.c | ||
add_custom_command(OUTPUT bootloader_bin.c | ||
COMMAND ${Python_EXECUTABLE} ${UF2CONV_PY} --carray -o bootloader_bin.c $<TARGET_FILE_DIR:tinyuf2>/tinyuf2.bin | ||
DEPENDS tinyuf2 | ||
) | ||
|
||
# self_update target | ||
add_executable(self_update | ||
${TOP}/apps/self_update/self_update.c | ||
${CMAKE_CURRENT_LIST_DIR}/../../boards.c | ||
${CMAKE_CURRENT_LIST_DIR}/../../board_flash.c | ||
${CMAKE_CURRENT_BINARY_DIR}/bootloader_bin.c | ||
) | ||
|
||
target_include_directories(self_update PUBLIC | ||
${TOP}/src | ||
) | ||
target_compile_definitions(self_update PUBLIC | ||
TINYUF2_SELF_UPDATE | ||
BUILD_NO_TINYUSB | ||
BUILD_APPLICATION | ||
) | ||
target_link_options(self_update PUBLIC | ||
"LINKER:--script=${CMAKE_CURRENT_LIST_DIR}/../../linker/stm32f4_app.ld" | ||
) | ||
|
||
family_configure_common(self_update) | ||
family_add_uf2(self_update ${UF2_FAMILY_ID}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
set(JLINK_DEVICE stm32f411ve) | ||
|
||
function(update_board TARGET) | ||
target_sources(${TARGET} PUBLIC | ||
${ST_CMSIS}/Source/Templates/gcc/startup_stm32f411xe.s | ||
) | ||
target_compile_definitions(${TARGET} PUBLIC | ||
STM32F411xE | ||
HSE_VALUE=8000000U | ||
) | ||
endfunction() |
Oops, something went wrong.