mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 00:38:35 -07:00
<:Nami2:939038794794020874>
This commit is contained in:
366
applications/external/esp_flasher/lib/esp-serial-flasher/CMakeCache.txt
vendored
Normal file
366
applications/external/esp_flasher/lib/esp-serial-flasher/CMakeCache.txt
vendored
Normal file
@@ -0,0 +1,366 @@
|
||||
# This is the CMakeCache file.
|
||||
# For build in directory: /home/cococode/flipperzero-firmware/lib/esp-serial-flasher
|
||||
# It was generated by CMake: /usr/bin/cmake
|
||||
# You can edit this file to change values found and used by cmake.
|
||||
# If you do not want to change any of the values, simply exit the editor.
|
||||
# If you do want to change a value, simply edit, save, and exit the editor.
|
||||
# The syntax for the file is as follows:
|
||||
# KEY:TYPE=VALUE
|
||||
# KEY is the name of a variable in the cache.
|
||||
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
|
||||
# VALUE is the current value for the KEY.
|
||||
|
||||
########################
|
||||
# EXTERNAL cache entries
|
||||
########################
|
||||
|
||||
//Path to a program.
|
||||
CMAKE_ADDR2LINE:FILEPATH=/usr/bin/addr2line
|
||||
|
||||
//Path to a program.
|
||||
CMAKE_AR:FILEPATH=/usr/bin/ar
|
||||
|
||||
//Choose the type of build, options are: None Debug Release RelWithDebInfo
|
||||
// MinSizeRel ...
|
||||
CMAKE_BUILD_TYPE:STRING=
|
||||
|
||||
//Enable/Disable color output during build.
|
||||
CMAKE_COLOR_MAKEFILE:BOOL=ON
|
||||
|
||||
//CXX compiler
|
||||
CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++
|
||||
|
||||
//A wrapper around 'ar' adding the appropriate '--plugin' option
|
||||
// for the GCC compiler
|
||||
CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-9
|
||||
|
||||
//A wrapper around 'ranlib' adding the appropriate '--plugin' option
|
||||
// for the GCC compiler
|
||||
CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-9
|
||||
|
||||
//Flags used by the CXX compiler during all build types.
|
||||
CMAKE_CXX_FLAGS:STRING=
|
||||
|
||||
//Flags used by the CXX compiler during DEBUG builds.
|
||||
CMAKE_CXX_FLAGS_DEBUG:STRING=-g
|
||||
|
||||
//Flags used by the CXX compiler during MINSIZEREL builds.
|
||||
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
|
||||
|
||||
//Flags used by the CXX compiler during RELEASE builds.
|
||||
CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
|
||||
|
||||
//Flags used by the CXX compiler during RELWITHDEBINFO builds.
|
||||
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
|
||||
|
||||
//C compiler
|
||||
CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc
|
||||
|
||||
//A wrapper around 'ar' adding the appropriate '--plugin' option
|
||||
// for the GCC compiler
|
||||
CMAKE_C_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-9
|
||||
|
||||
//A wrapper around 'ranlib' adding the appropriate '--plugin' option
|
||||
// for the GCC compiler
|
||||
CMAKE_C_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-9
|
||||
|
||||
//Flags used by the C compiler during all build types.
|
||||
CMAKE_C_FLAGS:STRING=
|
||||
|
||||
//Flags used by the C compiler during DEBUG builds.
|
||||
CMAKE_C_FLAGS_DEBUG:STRING=-g
|
||||
|
||||
//Flags used by the C compiler during MINSIZEREL builds.
|
||||
CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
|
||||
|
||||
//Flags used by the C compiler during RELEASE builds.
|
||||
CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
|
||||
|
||||
//Flags used by the C compiler during RELWITHDEBINFO builds.
|
||||
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
|
||||
|
||||
//Path to a program.
|
||||
CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND
|
||||
|
||||
//Flags used by the linker during all build types.
|
||||
CMAKE_EXE_LINKER_FLAGS:STRING=
|
||||
|
||||
//Flags used by the linker during DEBUG builds.
|
||||
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
|
||||
|
||||
//Flags used by the linker during MINSIZEREL builds.
|
||||
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
|
||||
|
||||
//Flags used by the linker during RELEASE builds.
|
||||
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
|
||||
|
||||
//Flags used by the linker during RELWITHDEBINFO builds.
|
||||
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
|
||||
|
||||
//Enable/Disable output of compile commands during generation.
|
||||
CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF
|
||||
|
||||
//Install path prefix, prepended onto install directories.
|
||||
CMAKE_INSTALL_PREFIX:PATH=/usr/local
|
||||
|
||||
//Path to a program.
|
||||
CMAKE_LINKER:FILEPATH=/usr/bin/ld
|
||||
|
||||
//Path to a program.
|
||||
CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make
|
||||
|
||||
//Flags used by the linker during the creation of modules during
|
||||
// all build types.
|
||||
CMAKE_MODULE_LINKER_FLAGS:STRING=
|
||||
|
||||
//Flags used by the linker during the creation of modules during
|
||||
// DEBUG builds.
|
||||
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
|
||||
|
||||
//Flags used by the linker during the creation of modules during
|
||||
// MINSIZEREL builds.
|
||||
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
|
||||
|
||||
//Flags used by the linker during the creation of modules during
|
||||
// RELEASE builds.
|
||||
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
|
||||
|
||||
//Flags used by the linker during the creation of modules during
|
||||
// RELWITHDEBINFO builds.
|
||||
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
|
||||
|
||||
//Path to a program.
|
||||
CMAKE_NM:FILEPATH=/usr/bin/nm
|
||||
|
||||
//Path to a program.
|
||||
CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy
|
||||
|
||||
//Path to a program.
|
||||
CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump
|
||||
|
||||
//Value Computed by CMake
|
||||
CMAKE_PROJECT_DESCRIPTION:STATIC=
|
||||
|
||||
//Value Computed by CMake
|
||||
CMAKE_PROJECT_HOMEPAGE_URL:STATIC=
|
||||
|
||||
//Value Computed by CMake
|
||||
CMAKE_PROJECT_NAME:STATIC=Project
|
||||
|
||||
//Path to a program.
|
||||
CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib
|
||||
|
||||
//Path to a program.
|
||||
CMAKE_READELF:FILEPATH=/usr/bin/readelf
|
||||
|
||||
//Flags used by the linker during the creation of shared libraries
|
||||
// during all build types.
|
||||
CMAKE_SHARED_LINKER_FLAGS:STRING=
|
||||
|
||||
//Flags used by the linker during the creation of shared libraries
|
||||
// during DEBUG builds.
|
||||
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
|
||||
|
||||
//Flags used by the linker during the creation of shared libraries
|
||||
// during MINSIZEREL builds.
|
||||
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
|
||||
|
||||
//Flags used by the linker during the creation of shared libraries
|
||||
// during RELEASE builds.
|
||||
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
|
||||
|
||||
//Flags used by the linker during the creation of shared libraries
|
||||
// during RELWITHDEBINFO builds.
|
||||
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
|
||||
|
||||
//If set, runtime paths are not added when installing shared libraries,
|
||||
// but are added when building.
|
||||
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
|
||||
|
||||
//If set, runtime paths are not added when using shared libraries.
|
||||
CMAKE_SKIP_RPATH:BOOL=NO
|
||||
|
||||
//Flags used by the linker during the creation of static libraries
|
||||
// during all build types.
|
||||
CMAKE_STATIC_LINKER_FLAGS:STRING=
|
||||
|
||||
//Flags used by the linker during the creation of static libraries
|
||||
// during DEBUG builds.
|
||||
CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
|
||||
|
||||
//Flags used by the linker during the creation of static libraries
|
||||
// during MINSIZEREL builds.
|
||||
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
|
||||
|
||||
//Flags used by the linker during the creation of static libraries
|
||||
// during RELEASE builds.
|
||||
CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
|
||||
|
||||
//Flags used by the linker during the creation of static libraries
|
||||
// during RELWITHDEBINFO builds.
|
||||
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
|
||||
|
||||
//Path to a program.
|
||||
CMAKE_STRIP:FILEPATH=/usr/bin/strip
|
||||
|
||||
//If this value is on, makefiles will be generated without the
|
||||
// .SILENT directive, and all commands will be echoed to the console
|
||||
// during the make. This is useful for debugging only. With Visual
|
||||
// Studio IDE projects all commands are done without /nologo.
|
||||
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
|
||||
|
||||
//Value Computed by CMake
|
||||
Project_BINARY_DIR:STATIC=/home/cococode/flipperzero-firmware/lib/esp-serial-flasher
|
||||
|
||||
//Value Computed by CMake
|
||||
Project_SOURCE_DIR:STATIC=/home/cococode/flipperzero-firmware/lib/esp-serial-flasher
|
||||
|
||||
|
||||
########################
|
||||
# INTERNAL cache entries
|
||||
########################
|
||||
|
||||
//ADVANCED property for variable: CMAKE_ADDR2LINE
|
||||
CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_AR
|
||||
CMAKE_AR-ADVANCED:INTERNAL=1
|
||||
//This is the directory where this CMakeCache.txt was created
|
||||
CMAKE_CACHEFILE_DIR:INTERNAL=/home/cococode/flipperzero-firmware/lib/esp-serial-flasher
|
||||
//Major version of cmake used to create the current loaded cache
|
||||
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
|
||||
//Minor version of cmake used to create the current loaded cache
|
||||
CMAKE_CACHE_MINOR_VERSION:INTERNAL=16
|
||||
//Patch version of cmake used to create the current loaded cache
|
||||
CMAKE_CACHE_PATCH_VERSION:INTERNAL=3
|
||||
//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE
|
||||
CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1
|
||||
//Path to CMake executable.
|
||||
CMAKE_COMMAND:INTERNAL=/usr/bin/cmake
|
||||
//Path to cpack program executable.
|
||||
CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack
|
||||
//Path to ctest program executable.
|
||||
CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest
|
||||
//ADVANCED property for variable: CMAKE_CXX_COMPILER
|
||||
CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_CXX_COMPILER_AR
|
||||
CMAKE_CXX_COMPILER_AR-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_CXX_COMPILER_RANLIB
|
||||
CMAKE_CXX_COMPILER_RANLIB-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_CXX_FLAGS
|
||||
CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG
|
||||
CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL
|
||||
CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE
|
||||
CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||
CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_C_COMPILER
|
||||
CMAKE_C_COMPILER-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_C_COMPILER_AR
|
||||
CMAKE_C_COMPILER_AR-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_C_COMPILER_RANLIB
|
||||
CMAKE_C_COMPILER_RANLIB-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_C_FLAGS
|
||||
CMAKE_C_FLAGS-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG
|
||||
CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL
|
||||
CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE
|
||||
CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO
|
||||
CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_DLLTOOL
|
||||
CMAKE_DLLTOOL-ADVANCED:INTERNAL=1
|
||||
//Executable file format
|
||||
CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF
|
||||
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS
|
||||
CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
|
||||
CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
|
||||
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
|
||||
CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
|
||||
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS
|
||||
CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1
|
||||
//Name of external makefile project generator.
|
||||
CMAKE_EXTRA_GENERATOR:INTERNAL=
|
||||
//Name of generator.
|
||||
CMAKE_GENERATOR:INTERNAL=Unix Makefiles
|
||||
//Generator instance identifier.
|
||||
CMAKE_GENERATOR_INSTANCE:INTERNAL=
|
||||
//Name of generator platform.
|
||||
CMAKE_GENERATOR_PLATFORM:INTERNAL=
|
||||
//Name of generator toolset.
|
||||
CMAKE_GENERATOR_TOOLSET:INTERNAL=
|
||||
//Source directory with the top level CMakeLists.txt file for this
|
||||
// project
|
||||
CMAKE_HOME_DIRECTORY:INTERNAL=/home/cococode/flipperzero-firmware/lib/esp-serial-flasher
|
||||
//Install .so files without execute permission.
|
||||
CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_LINKER
|
||||
CMAKE_LINKER-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_MAKE_PROGRAM
|
||||
CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS
|
||||
CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
|
||||
CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
|
||||
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
|
||||
CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
|
||||
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_NM
|
||||
CMAKE_NM-ADVANCED:INTERNAL=1
|
||||
//number of local generators
|
||||
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_OBJCOPY
|
||||
CMAKE_OBJCOPY-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_OBJDUMP
|
||||
CMAKE_OBJDUMP-ADVANCED:INTERNAL=1
|
||||
//Platform information initialized
|
||||
CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_RANLIB
|
||||
CMAKE_RANLIB-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_READELF
|
||||
CMAKE_READELF-ADVANCED:INTERNAL=1
|
||||
//Path to CMake installation.
|
||||
CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.16
|
||||
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS
|
||||
CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
|
||||
CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
|
||||
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
|
||||
CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
|
||||
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH
|
||||
CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_SKIP_RPATH
|
||||
CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS
|
||||
CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG
|
||||
CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL
|
||||
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE
|
||||
CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO
|
||||
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_STRIP
|
||||
CMAKE_STRIP-ADVANCED:INTERNAL=1
|
||||
//uname command
|
||||
CMAKE_UNAME:INTERNAL=/usr/bin/uname
|
||||
//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE
|
||||
CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
|
||||
|
||||
76
applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/3.16.3/CMakeCCompiler.cmake
vendored
Normal file
76
applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/3.16.3/CMakeCCompiler.cmake
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
set(CMAKE_C_COMPILER "/usr/bin/cc")
|
||||
set(CMAKE_C_COMPILER_ARG1 "")
|
||||
set(CMAKE_C_COMPILER_ID "GNU")
|
||||
set(CMAKE_C_COMPILER_VERSION "9.4.0")
|
||||
set(CMAKE_C_COMPILER_VERSION_INTERNAL "")
|
||||
set(CMAKE_C_COMPILER_WRAPPER "")
|
||||
set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11")
|
||||
set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert")
|
||||
set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes")
|
||||
set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros")
|
||||
set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert")
|
||||
|
||||
set(CMAKE_C_PLATFORM_ID "Linux")
|
||||
set(CMAKE_C_SIMULATE_ID "")
|
||||
set(CMAKE_C_COMPILER_FRONTEND_VARIANT "")
|
||||
set(CMAKE_C_SIMULATE_VERSION "")
|
||||
|
||||
|
||||
|
||||
set(CMAKE_AR "/usr/bin/ar")
|
||||
set(CMAKE_C_COMPILER_AR "/usr/bin/gcc-ar-9")
|
||||
set(CMAKE_RANLIB "/usr/bin/ranlib")
|
||||
set(CMAKE_C_COMPILER_RANLIB "/usr/bin/gcc-ranlib-9")
|
||||
set(CMAKE_LINKER "/usr/bin/ld")
|
||||
set(CMAKE_MT "")
|
||||
set(CMAKE_COMPILER_IS_GNUCC 1)
|
||||
set(CMAKE_C_COMPILER_LOADED 1)
|
||||
set(CMAKE_C_COMPILER_WORKS TRUE)
|
||||
set(CMAKE_C_ABI_COMPILED TRUE)
|
||||
set(CMAKE_COMPILER_IS_MINGW )
|
||||
set(CMAKE_COMPILER_IS_CYGWIN )
|
||||
if(CMAKE_COMPILER_IS_CYGWIN)
|
||||
set(CYGWIN 1)
|
||||
set(UNIX 1)
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_COMPILER_ENV_VAR "CC")
|
||||
|
||||
if(CMAKE_COMPILER_IS_MINGW)
|
||||
set(MINGW 1)
|
||||
endif()
|
||||
set(CMAKE_C_COMPILER_ID_RUN 1)
|
||||
set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m)
|
||||
set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
|
||||
set(CMAKE_C_LINKER_PREFERENCE 10)
|
||||
|
||||
# Save compiler ABI information.
|
||||
set(CMAKE_C_SIZEOF_DATA_PTR "8")
|
||||
set(CMAKE_C_COMPILER_ABI "ELF")
|
||||
set(CMAKE_C_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
|
||||
|
||||
if(CMAKE_C_SIZEOF_DATA_PTR)
|
||||
set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_ABI)
|
||||
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_LIBRARY_ARCHITECTURE)
|
||||
set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "")
|
||||
if(CMAKE_C_CL_SHOWINCLUDES_PREFIX)
|
||||
set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}")
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/9/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include")
|
||||
set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "gcc;gcc_s;c;gcc;gcc_s")
|
||||
set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib")
|
||||
set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
|
||||
@@ -0,0 +1,88 @@
|
||||
set(CMAKE_CXX_COMPILER "/usr/bin/c++")
|
||||
set(CMAKE_CXX_COMPILER_ARG1 "")
|
||||
set(CMAKE_CXX_COMPILER_ID "GNU")
|
||||
set(CMAKE_CXX_COMPILER_VERSION "9.4.0")
|
||||
set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "")
|
||||
set(CMAKE_CXX_COMPILER_WRAPPER "")
|
||||
set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14")
|
||||
set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20")
|
||||
set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters")
|
||||
set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates")
|
||||
set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates")
|
||||
set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17")
|
||||
set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20")
|
||||
|
||||
set(CMAKE_CXX_PLATFORM_ID "Linux")
|
||||
set(CMAKE_CXX_SIMULATE_ID "")
|
||||
set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "")
|
||||
set(CMAKE_CXX_SIMULATE_VERSION "")
|
||||
|
||||
|
||||
|
||||
set(CMAKE_AR "/usr/bin/ar")
|
||||
set(CMAKE_CXX_COMPILER_AR "/usr/bin/gcc-ar-9")
|
||||
set(CMAKE_RANLIB "/usr/bin/ranlib")
|
||||
set(CMAKE_CXX_COMPILER_RANLIB "/usr/bin/gcc-ranlib-9")
|
||||
set(CMAKE_LINKER "/usr/bin/ld")
|
||||
set(CMAKE_MT "")
|
||||
set(CMAKE_COMPILER_IS_GNUCXX 1)
|
||||
set(CMAKE_CXX_COMPILER_LOADED 1)
|
||||
set(CMAKE_CXX_COMPILER_WORKS TRUE)
|
||||
set(CMAKE_CXX_ABI_COMPILED TRUE)
|
||||
set(CMAKE_COMPILER_IS_MINGW )
|
||||
set(CMAKE_COMPILER_IS_CYGWIN )
|
||||
if(CMAKE_COMPILER_IS_CYGWIN)
|
||||
set(CYGWIN 1)
|
||||
set(UNIX 1)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
|
||||
|
||||
if(CMAKE_COMPILER_IS_MINGW)
|
||||
set(MINGW 1)
|
||||
endif()
|
||||
set(CMAKE_CXX_COMPILER_ID_RUN 1)
|
||||
set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP)
|
||||
set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
|
||||
|
||||
foreach (lang C OBJC OBJCXX)
|
||||
if (CMAKE_${lang}_COMPILER_ID_RUN)
|
||||
foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS)
|
||||
list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension})
|
||||
endforeach()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set(CMAKE_CXX_LINKER_PREFERENCE 30)
|
||||
set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
|
||||
|
||||
# Save compiler ABI information.
|
||||
set(CMAKE_CXX_SIZEOF_DATA_PTR "8")
|
||||
set(CMAKE_CXX_COMPILER_ABI "ELF")
|
||||
set(CMAKE_CXX_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
|
||||
|
||||
if(CMAKE_CXX_SIZEOF_DATA_PTR)
|
||||
set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ABI)
|
||||
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
|
||||
set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "")
|
||||
if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX)
|
||||
set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}")
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include/c++/9;/usr/include/x86_64-linux-gnu/c++/9;/usr/include/c++/9/backward;/usr/lib/gcc/x86_64-linux-gnu/9/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include")
|
||||
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc_s;gcc;c;gcc_s;gcc")
|
||||
set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib")
|
||||
set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
|
||||
BIN
applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_C.bin
vendored
Executable file
BIN
applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_C.bin
vendored
Executable file
Binary file not shown.
BIN
applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_CXX.bin
vendored
Executable file
BIN
applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_CXX.bin
vendored
Executable file
Binary file not shown.
15
applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/3.16.3/CMakeSystem.cmake
vendored
Normal file
15
applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/3.16.3/CMakeSystem.cmake
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
set(CMAKE_HOST_SYSTEM "Linux-5.10.16.3-microsoft-standard-WSL2")
|
||||
set(CMAKE_HOST_SYSTEM_NAME "Linux")
|
||||
set(CMAKE_HOST_SYSTEM_VERSION "5.10.16.3-microsoft-standard-WSL2")
|
||||
set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")
|
||||
|
||||
|
||||
|
||||
set(CMAKE_SYSTEM "Linux-5.10.16.3-microsoft-standard-WSL2")
|
||||
set(CMAKE_SYSTEM_NAME "Linux")
|
||||
set(CMAKE_SYSTEM_VERSION "5.10.16.3-microsoft-standard-WSL2")
|
||||
set(CMAKE_SYSTEM_PROCESSOR "x86_64")
|
||||
|
||||
set(CMAKE_CROSSCOMPILING "FALSE")
|
||||
|
||||
set(CMAKE_SYSTEM_LOADED 1)
|
||||
@@ -0,0 +1,671 @@
|
||||
#ifdef __cplusplus
|
||||
# error "A C++ compiler has been selected for C."
|
||||
#endif
|
||||
|
||||
#if defined(__18CXX)
|
||||
# define ID_VOID_MAIN
|
||||
#endif
|
||||
#if defined(__CLASSIC_C__)
|
||||
/* cv-qualifiers did not exist in K&R C */
|
||||
# define const
|
||||
# define volatile
|
||||
#endif
|
||||
|
||||
|
||||
/* Version number components: V=Version, R=Revision, P=Patch
|
||||
Version date components: YYYY=Year, MM=Month, DD=Day */
|
||||
|
||||
#if defined(__INTEL_COMPILER) || defined(__ICC)
|
||||
# define COMPILER_ID "Intel"
|
||||
# if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
# endif
|
||||
# if defined(__GNUC__)
|
||||
# define SIMULATE_ID "GNU"
|
||||
# endif
|
||||
/* __INTEL_COMPILER = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
|
||||
# if defined(__INTEL_COMPILER_UPDATE)
|
||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
|
||||
# else
|
||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
|
||||
# endif
|
||||
# if defined(__INTEL_COMPILER_BUILD_DATE)
|
||||
/* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
|
||||
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
|
||||
# endif
|
||||
# if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# endif
|
||||
# if defined(__GNUC__)
|
||||
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
|
||||
# elif defined(__GNUG__)
|
||||
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
|
||||
# endif
|
||||
# if defined(__GNUC_MINOR__)
|
||||
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||
# endif
|
||||
# if defined(__GNUC_PATCHLEVEL__)
|
||||
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(__PATHCC__)
|
||||
# define COMPILER_ID "PathScale"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
|
||||
# if defined(__PATHCC_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
|
||||
# define COMPILER_ID "Embarcadero"
|
||||
# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
|
||||
# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
|
||||
# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
|
||||
|
||||
#elif defined(__BORLANDC__)
|
||||
# define COMPILER_ID "Borland"
|
||||
/* __BORLANDC__ = 0xVRR */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
|
||||
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
|
||||
|
||||
#elif defined(__WATCOMC__) && __WATCOMC__ < 1200
|
||||
# define COMPILER_ID "Watcom"
|
||||
/* __WATCOMC__ = VVRR */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||
# if (__WATCOMC__ % 10) > 0
|
||||
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||
# endif
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# define COMPILER_ID "OpenWatcom"
|
||||
/* __WATCOMC__ = VVRP + 1100 */
|
||||
# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||
# if (__WATCOMC__ % 10) > 0
|
||||
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||
# endif
|
||||
|
||||
#elif defined(__SUNPRO_C)
|
||||
# define COMPILER_ID "SunPro"
|
||||
# if __SUNPRO_C >= 0x5100
|
||||
/* __SUNPRO_C = 0xVRRP */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12)
|
||||
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF)
|
||||
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
|
||||
# else
|
||||
/* __SUNPRO_CC = 0xVRP */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8)
|
||||
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF)
|
||||
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
|
||||
# endif
|
||||
|
||||
#elif defined(__HP_cc)
|
||||
# define COMPILER_ID "HP"
|
||||
/* __HP_cc = VVRRPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100)
|
||||
|
||||
#elif defined(__DECC)
|
||||
# define COMPILER_ID "Compaq"
|
||||
/* __DECC_VER = VVRRTPPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000)
|
||||
|
||||
#elif defined(__IBMC__) && defined(__COMPILER_VER__)
|
||||
# define COMPILER_ID "zOS"
|
||||
/* __IBMC__ = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
|
||||
|
||||
#elif defined(__ibmxl__) && defined(__clang__)
|
||||
# define COMPILER_ID "XLClang"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
|
||||
# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
|
||||
|
||||
|
||||
#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800
|
||||
# define COMPILER_ID "XL"
|
||||
/* __IBMC__ = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
|
||||
|
||||
#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800
|
||||
# define COMPILER_ID "VisualAge"
|
||||
/* __IBMC__ = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
|
||||
|
||||
#elif defined(__PGI)
|
||||
# define COMPILER_ID "PGI"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
|
||||
# if defined(__PGIC_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(_CRAYC)
|
||||
# define COMPILER_ID "Cray"
|
||||
# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
|
||||
# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
|
||||
|
||||
#elif defined(__TI_COMPILER_VERSION__)
|
||||
# define COMPILER_ID "TI"
|
||||
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
|
||||
# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
|
||||
|
||||
#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version)
|
||||
# define COMPILER_ID "Fujitsu"
|
||||
|
||||
#elif defined(__ghs__)
|
||||
# define COMPILER_ID "GHS"
|
||||
/* __GHS_VERSION_NUMBER = VVVVRP */
|
||||
# ifdef __GHS_VERSION_NUMBER
|
||||
# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
|
||||
# endif
|
||||
|
||||
#elif defined(__TINYC__)
|
||||
# define COMPILER_ID "TinyCC"
|
||||
|
||||
#elif defined(__BCC__)
|
||||
# define COMPILER_ID "Bruce"
|
||||
|
||||
#elif defined(__SCO_VERSION__)
|
||||
# define COMPILER_ID "SCO"
|
||||
|
||||
#elif defined(__ARMCC_VERSION) && !defined(__clang__)
|
||||
# define COMPILER_ID "ARMCC"
|
||||
#if __ARMCC_VERSION >= 1000000
|
||||
/* __ARMCC_VERSION = VRRPPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
|
||||
#else
|
||||
/* __ARMCC_VERSION = VRPPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
|
||||
#endif
|
||||
|
||||
|
||||
#elif defined(__clang__) && defined(__apple_build_version__)
|
||||
# define COMPILER_ID "AppleClang"
|
||||
# if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
# endif
|
||||
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
|
||||
# if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# endif
|
||||
# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
|
||||
|
||||
#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
|
||||
# define COMPILER_ID "ARMClang"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
|
||||
|
||||
#elif defined(__clang__)
|
||||
# define COMPILER_ID "Clang"
|
||||
# if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
# endif
|
||||
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
|
||||
# if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# endif
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
# define COMPILER_ID "GNU"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
|
||||
# if defined(__GNUC_MINOR__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||
# endif
|
||||
# if defined(__GNUC_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
# define COMPILER_ID "MSVC"
|
||||
/* _MSC_VER = VVRR */
|
||||
# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# if defined(_MSC_FULL_VER)
|
||||
# if _MSC_VER >= 1400
|
||||
/* _MSC_FULL_VER = VVRRPPPPP */
|
||||
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
|
||||
# else
|
||||
/* _MSC_FULL_VER = VVRRPPPP */
|
||||
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
|
||||
# endif
|
||||
# endif
|
||||
# if defined(_MSC_BUILD)
|
||||
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
|
||||
# endif
|
||||
|
||||
#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
|
||||
# define COMPILER_ID "ADSP"
|
||||
#if defined(__VISUALDSPVERSION__)
|
||||
/* __VISUALDSPVERSION__ = 0xVVRRPP00 */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
|
||||
# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
|
||||
# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
|
||||
#endif
|
||||
|
||||
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
|
||||
# define COMPILER_ID "IAR"
|
||||
# if defined(__VER__) && defined(__ICCARM__)
|
||||
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
|
||||
# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
|
||||
# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__))
|
||||
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
|
||||
# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
|
||||
# endif
|
||||
|
||||
#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC)
|
||||
# define COMPILER_ID "SDCC"
|
||||
# if defined(__SDCC_VERSION_MAJOR)
|
||||
# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR)
|
||||
# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR)
|
||||
# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH)
|
||||
# else
|
||||
/* SDCC = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(SDCC/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(SDCC % 10)
|
||||
# endif
|
||||
|
||||
|
||||
/* These compilers are either not known or too old to define an
|
||||
identification macro. Try to identify the platform and guess that
|
||||
it is the native compiler. */
|
||||
#elif defined(__hpux) || defined(__hpua)
|
||||
# define COMPILER_ID "HP"
|
||||
|
||||
#else /* unknown compiler */
|
||||
# define COMPILER_ID ""
|
||||
#endif
|
||||
|
||||
/* Construct the string literal in pieces to prevent the source from
|
||||
getting matched. Store it in a pointer rather than an array
|
||||
because some compilers will just produce instructions to fill the
|
||||
array rather than assigning a pointer to a static array. */
|
||||
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
|
||||
#ifdef SIMULATE_ID
|
||||
char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
|
||||
#endif
|
||||
|
||||
#ifdef __QNXNTO__
|
||||
char const* qnxnto = "INFO" ":" "qnxnto[]";
|
||||
#endif
|
||||
|
||||
#if defined(__CRAYXE) || defined(__CRAYXC)
|
||||
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
|
||||
#endif
|
||||
|
||||
#define STRINGIFY_HELPER(X) #X
|
||||
#define STRINGIFY(X) STRINGIFY_HELPER(X)
|
||||
|
||||
/* Identify known platforms by name. */
|
||||
#if defined(__linux) || defined(__linux__) || defined(linux)
|
||||
# define PLATFORM_ID "Linux"
|
||||
|
||||
#elif defined(__CYGWIN__)
|
||||
# define PLATFORM_ID "Cygwin"
|
||||
|
||||
#elif defined(__MINGW32__)
|
||||
# define PLATFORM_ID "MinGW"
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
# define PLATFORM_ID "Darwin"
|
||||
|
||||
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
|
||||
# define PLATFORM_ID "Windows"
|
||||
|
||||
#elif defined(__FreeBSD__) || defined(__FreeBSD)
|
||||
# define PLATFORM_ID "FreeBSD"
|
||||
|
||||
#elif defined(__NetBSD__) || defined(__NetBSD)
|
||||
# define PLATFORM_ID "NetBSD"
|
||||
|
||||
#elif defined(__OpenBSD__) || defined(__OPENBSD)
|
||||
# define PLATFORM_ID "OpenBSD"
|
||||
|
||||
#elif defined(__sun) || defined(sun)
|
||||
# define PLATFORM_ID "SunOS"
|
||||
|
||||
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
|
||||
# define PLATFORM_ID "AIX"
|
||||
|
||||
#elif defined(__hpux) || defined(__hpux__)
|
||||
# define PLATFORM_ID "HP-UX"
|
||||
|
||||
#elif defined(__HAIKU__)
|
||||
# define PLATFORM_ID "Haiku"
|
||||
|
||||
#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
|
||||
# define PLATFORM_ID "BeOS"
|
||||
|
||||
#elif defined(__QNX__) || defined(__QNXNTO__)
|
||||
# define PLATFORM_ID "QNX"
|
||||
|
||||
#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
|
||||
# define PLATFORM_ID "Tru64"
|
||||
|
||||
#elif defined(__riscos) || defined(__riscos__)
|
||||
# define PLATFORM_ID "RISCos"
|
||||
|
||||
#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
|
||||
# define PLATFORM_ID "SINIX"
|
||||
|
||||
#elif defined(__UNIX_SV__)
|
||||
# define PLATFORM_ID "UNIX_SV"
|
||||
|
||||
#elif defined(__bsdos__)
|
||||
# define PLATFORM_ID "BSDOS"
|
||||
|
||||
#elif defined(_MPRAS) || defined(MPRAS)
|
||||
# define PLATFORM_ID "MP-RAS"
|
||||
|
||||
#elif defined(__osf) || defined(__osf__)
|
||||
# define PLATFORM_ID "OSF1"
|
||||
|
||||
#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
|
||||
# define PLATFORM_ID "SCO_SV"
|
||||
|
||||
#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
|
||||
# define PLATFORM_ID "ULTRIX"
|
||||
|
||||
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
|
||||
# define PLATFORM_ID "Xenix"
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# if defined(__LINUX__)
|
||||
# define PLATFORM_ID "Linux"
|
||||
|
||||
# elif defined(__DOS__)
|
||||
# define PLATFORM_ID "DOS"
|
||||
|
||||
# elif defined(__OS2__)
|
||||
# define PLATFORM_ID "OS2"
|
||||
|
||||
# elif defined(__WINDOWS__)
|
||||
# define PLATFORM_ID "Windows3x"
|
||||
|
||||
# else /* unknown platform */
|
||||
# define PLATFORM_ID
|
||||
# endif
|
||||
|
||||
#elif defined(__INTEGRITY)
|
||||
# if defined(INT_178B)
|
||||
# define PLATFORM_ID "Integrity178"
|
||||
|
||||
# else /* regular Integrity */
|
||||
# define PLATFORM_ID "Integrity"
|
||||
# endif
|
||||
|
||||
#else /* unknown platform */
|
||||
# define PLATFORM_ID
|
||||
|
||||
#endif
|
||||
|
||||
/* For windows compilers MSVC and Intel we can determine
|
||||
the architecture of the compiler being used. This is because
|
||||
the compilers do not have flags that can change the architecture,
|
||||
but rather depend on which compiler is being used
|
||||
*/
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
# if defined(_M_IA64)
|
||||
# define ARCHITECTURE_ID "IA64"
|
||||
|
||||
# elif defined(_M_X64) || defined(_M_AMD64)
|
||||
# define ARCHITECTURE_ID "x64"
|
||||
|
||||
# elif defined(_M_IX86)
|
||||
# define ARCHITECTURE_ID "X86"
|
||||
|
||||
# elif defined(_M_ARM64)
|
||||
# define ARCHITECTURE_ID "ARM64"
|
||||
|
||||
# elif defined(_M_ARM)
|
||||
# if _M_ARM == 4
|
||||
# define ARCHITECTURE_ID "ARMV4I"
|
||||
# elif _M_ARM == 5
|
||||
# define ARCHITECTURE_ID "ARMV5I"
|
||||
# else
|
||||
# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
|
||||
# endif
|
||||
|
||||
# elif defined(_M_MIPS)
|
||||
# define ARCHITECTURE_ID "MIPS"
|
||||
|
||||
# elif defined(_M_SH)
|
||||
# define ARCHITECTURE_ID "SHx"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# if defined(_M_I86)
|
||||
# define ARCHITECTURE_ID "I86"
|
||||
|
||||
# elif defined(_M_IX86)
|
||||
# define ARCHITECTURE_ID "X86"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
|
||||
# if defined(__ICCARM__)
|
||||
# define ARCHITECTURE_ID "ARM"
|
||||
|
||||
# elif defined(__ICCRX__)
|
||||
# define ARCHITECTURE_ID "RX"
|
||||
|
||||
# elif defined(__ICCRH850__)
|
||||
# define ARCHITECTURE_ID "RH850"
|
||||
|
||||
# elif defined(__ICCRL78__)
|
||||
# define ARCHITECTURE_ID "RL78"
|
||||
|
||||
# elif defined(__ICCRISCV__)
|
||||
# define ARCHITECTURE_ID "RISCV"
|
||||
|
||||
# elif defined(__ICCAVR__)
|
||||
# define ARCHITECTURE_ID "AVR"
|
||||
|
||||
# elif defined(__ICC430__)
|
||||
# define ARCHITECTURE_ID "MSP430"
|
||||
|
||||
# elif defined(__ICCV850__)
|
||||
# define ARCHITECTURE_ID "V850"
|
||||
|
||||
# elif defined(__ICC8051__)
|
||||
# define ARCHITECTURE_ID "8051"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__ghs__)
|
||||
# if defined(__PPC64__)
|
||||
# define ARCHITECTURE_ID "PPC64"
|
||||
|
||||
# elif defined(__ppc__)
|
||||
# define ARCHITECTURE_ID "PPC"
|
||||
|
||||
# elif defined(__ARM__)
|
||||
# define ARCHITECTURE_ID "ARM"
|
||||
|
||||
# elif defined(__x86_64__)
|
||||
# define ARCHITECTURE_ID "x64"
|
||||
|
||||
# elif defined(__i386__)
|
||||
# define ARCHITECTURE_ID "X86"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
#else
|
||||
# define ARCHITECTURE_ID
|
||||
#endif
|
||||
|
||||
/* Convert integer to decimal digit literals. */
|
||||
#define DEC(n) \
|
||||
('0' + (((n) / 10000000)%10)), \
|
||||
('0' + (((n) / 1000000)%10)), \
|
||||
('0' + (((n) / 100000)%10)), \
|
||||
('0' + (((n) / 10000)%10)), \
|
||||
('0' + (((n) / 1000)%10)), \
|
||||
('0' + (((n) / 100)%10)), \
|
||||
('0' + (((n) / 10)%10)), \
|
||||
('0' + ((n) % 10))
|
||||
|
||||
/* Convert integer to hex digit literals. */
|
||||
#define HEX(n) \
|
||||
('0' + ((n)>>28 & 0xF)), \
|
||||
('0' + ((n)>>24 & 0xF)), \
|
||||
('0' + ((n)>>20 & 0xF)), \
|
||||
('0' + ((n)>>16 & 0xF)), \
|
||||
('0' + ((n)>>12 & 0xF)), \
|
||||
('0' + ((n)>>8 & 0xF)), \
|
||||
('0' + ((n)>>4 & 0xF)), \
|
||||
('0' + ((n) & 0xF))
|
||||
|
||||
/* Construct a string literal encoding the version number components. */
|
||||
#ifdef COMPILER_VERSION_MAJOR
|
||||
char const info_version[] = {
|
||||
'I', 'N', 'F', 'O', ':',
|
||||
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
|
||||
COMPILER_VERSION_MAJOR,
|
||||
# ifdef COMPILER_VERSION_MINOR
|
||||
'.', COMPILER_VERSION_MINOR,
|
||||
# ifdef COMPILER_VERSION_PATCH
|
||||
'.', COMPILER_VERSION_PATCH,
|
||||
# ifdef COMPILER_VERSION_TWEAK
|
||||
'.', COMPILER_VERSION_TWEAK,
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
']','\0'};
|
||||
#endif
|
||||
|
||||
/* Construct a string literal encoding the internal version number. */
|
||||
#ifdef COMPILER_VERSION_INTERNAL
|
||||
char const info_version_internal[] = {
|
||||
'I', 'N', 'F', 'O', ':',
|
||||
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
|
||||
'i','n','t','e','r','n','a','l','[',
|
||||
COMPILER_VERSION_INTERNAL,']','\0'};
|
||||
#endif
|
||||
|
||||
/* Construct a string literal encoding the version number components. */
|
||||
#ifdef SIMULATE_VERSION_MAJOR
|
||||
char const info_simulate_version[] = {
|
||||
'I', 'N', 'F', 'O', ':',
|
||||
's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
|
||||
SIMULATE_VERSION_MAJOR,
|
||||
# ifdef SIMULATE_VERSION_MINOR
|
||||
'.', SIMULATE_VERSION_MINOR,
|
||||
# ifdef SIMULATE_VERSION_PATCH
|
||||
'.', SIMULATE_VERSION_PATCH,
|
||||
# ifdef SIMULATE_VERSION_TWEAK
|
||||
'.', SIMULATE_VERSION_TWEAK,
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
']','\0'};
|
||||
#endif
|
||||
|
||||
/* Construct the string literal in pieces to prevent the source from
|
||||
getting matched. Store it in a pointer rather than an array
|
||||
because some compilers will just produce instructions to fill the
|
||||
array rather than assigning a pointer to a static array. */
|
||||
char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
|
||||
char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
|
||||
|
||||
|
||||
|
||||
|
||||
#if !defined(__STDC__)
|
||||
# if (defined(_MSC_VER) && !defined(__clang__)) \
|
||||
|| (defined(__ibmxl__) || defined(__IBMC__))
|
||||
# define C_DIALECT "90"
|
||||
# else
|
||||
# define C_DIALECT
|
||||
# endif
|
||||
#elif __STDC_VERSION__ >= 201000L
|
||||
# define C_DIALECT "11"
|
||||
#elif __STDC_VERSION__ >= 199901L
|
||||
# define C_DIALECT "99"
|
||||
#else
|
||||
# define C_DIALECT "90"
|
||||
#endif
|
||||
const char* info_language_dialect_default =
|
||||
"INFO" ":" "dialect_default[" C_DIALECT "]";
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef ID_VOID_MAIN
|
||||
void main() {}
|
||||
#else
|
||||
# if defined(__CLASSIC_C__)
|
||||
int main(argc, argv) int argc; char *argv[];
|
||||
# else
|
||||
int main(int argc, char* argv[])
|
||||
# endif
|
||||
{
|
||||
int require = 0;
|
||||
require += info_compiler[argc];
|
||||
require += info_platform[argc];
|
||||
require += info_arch[argc];
|
||||
#ifdef COMPILER_VERSION_MAJOR
|
||||
require += info_version[argc];
|
||||
#endif
|
||||
#ifdef COMPILER_VERSION_INTERNAL
|
||||
require += info_version_internal[argc];
|
||||
#endif
|
||||
#ifdef SIMULATE_ID
|
||||
require += info_simulate[argc];
|
||||
#endif
|
||||
#ifdef SIMULATE_VERSION_MAJOR
|
||||
require += info_simulate_version[argc];
|
||||
#endif
|
||||
#if defined(__CRAYXE) || defined(__CRAYXC)
|
||||
require += info_cray[argc];
|
||||
#endif
|
||||
require += info_language_dialect_default[argc];
|
||||
(void)argv;
|
||||
return require;
|
||||
}
|
||||
#endif
|
||||
BIN
applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/3.16.3/CompilerIdC/a.out
vendored
Executable file
BIN
applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/3.16.3/CompilerIdC/a.out
vendored
Executable file
Binary file not shown.
@@ -0,0 +1,660 @@
|
||||
/* This source file must have a .cpp extension so that all C++ compilers
|
||||
recognize the extension without flags. Borland does not know .cxx for
|
||||
example. */
|
||||
#ifndef __cplusplus
|
||||
# error "A C compiler has been selected for C++."
|
||||
#endif
|
||||
|
||||
|
||||
/* Version number components: V=Version, R=Revision, P=Patch
|
||||
Version date components: YYYY=Year, MM=Month, DD=Day */
|
||||
|
||||
#if defined(__COMO__)
|
||||
# define COMPILER_ID "Comeau"
|
||||
/* __COMO_VERSION__ = VRR */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100)
|
||||
|
||||
#elif defined(__INTEL_COMPILER) || defined(__ICC)
|
||||
# define COMPILER_ID "Intel"
|
||||
# if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
# endif
|
||||
# if defined(__GNUC__)
|
||||
# define SIMULATE_ID "GNU"
|
||||
# endif
|
||||
/* __INTEL_COMPILER = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
|
||||
# if defined(__INTEL_COMPILER_UPDATE)
|
||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
|
||||
# else
|
||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
|
||||
# endif
|
||||
# if defined(__INTEL_COMPILER_BUILD_DATE)
|
||||
/* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
|
||||
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
|
||||
# endif
|
||||
# if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# endif
|
||||
# if defined(__GNUC__)
|
||||
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
|
||||
# elif defined(__GNUG__)
|
||||
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
|
||||
# endif
|
||||
# if defined(__GNUC_MINOR__)
|
||||
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||
# endif
|
||||
# if defined(__GNUC_PATCHLEVEL__)
|
||||
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(__PATHCC__)
|
||||
# define COMPILER_ID "PathScale"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
|
||||
# if defined(__PATHCC_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
|
||||
# define COMPILER_ID "Embarcadero"
|
||||
# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
|
||||
# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
|
||||
# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
|
||||
|
||||
#elif defined(__BORLANDC__)
|
||||
# define COMPILER_ID "Borland"
|
||||
/* __BORLANDC__ = 0xVRR */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
|
||||
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
|
||||
|
||||
#elif defined(__WATCOMC__) && __WATCOMC__ < 1200
|
||||
# define COMPILER_ID "Watcom"
|
||||
/* __WATCOMC__ = VVRR */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||
# if (__WATCOMC__ % 10) > 0
|
||||
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||
# endif
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# define COMPILER_ID "OpenWatcom"
|
||||
/* __WATCOMC__ = VVRP + 1100 */
|
||||
# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||
# if (__WATCOMC__ % 10) > 0
|
||||
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||
# endif
|
||||
|
||||
#elif defined(__SUNPRO_CC)
|
||||
# define COMPILER_ID "SunPro"
|
||||
# if __SUNPRO_CC >= 0x5100
|
||||
/* __SUNPRO_CC = 0xVRRP */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12)
|
||||
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF)
|
||||
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
|
||||
# else
|
||||
/* __SUNPRO_CC = 0xVRP */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8)
|
||||
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF)
|
||||
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
|
||||
# endif
|
||||
|
||||
#elif defined(__HP_aCC)
|
||||
# define COMPILER_ID "HP"
|
||||
/* __HP_aCC = VVRRPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100)
|
||||
|
||||
#elif defined(__DECCXX)
|
||||
# define COMPILER_ID "Compaq"
|
||||
/* __DECCXX_VER = VVRRTPPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000)
|
||||
|
||||
#elif defined(__IBMCPP__) && defined(__COMPILER_VER__)
|
||||
# define COMPILER_ID "zOS"
|
||||
/* __IBMCPP__ = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
|
||||
|
||||
#elif defined(__ibmxl__) && defined(__clang__)
|
||||
# define COMPILER_ID "XLClang"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
|
||||
# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
|
||||
|
||||
|
||||
#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800
|
||||
# define COMPILER_ID "XL"
|
||||
/* __IBMCPP__ = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
|
||||
|
||||
#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800
|
||||
# define COMPILER_ID "VisualAge"
|
||||
/* __IBMCPP__ = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
|
||||
|
||||
#elif defined(__PGI)
|
||||
# define COMPILER_ID "PGI"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
|
||||
# if defined(__PGIC_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(_CRAYC)
|
||||
# define COMPILER_ID "Cray"
|
||||
# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
|
||||
# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
|
||||
|
||||
#elif defined(__TI_COMPILER_VERSION__)
|
||||
# define COMPILER_ID "TI"
|
||||
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
|
||||
# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
|
||||
|
||||
#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version)
|
||||
# define COMPILER_ID "Fujitsu"
|
||||
|
||||
#elif defined(__ghs__)
|
||||
# define COMPILER_ID "GHS"
|
||||
/* __GHS_VERSION_NUMBER = VVVVRP */
|
||||
# ifdef __GHS_VERSION_NUMBER
|
||||
# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
|
||||
# endif
|
||||
|
||||
#elif defined(__SCO_VERSION__)
|
||||
# define COMPILER_ID "SCO"
|
||||
|
||||
#elif defined(__ARMCC_VERSION) && !defined(__clang__)
|
||||
# define COMPILER_ID "ARMCC"
|
||||
#if __ARMCC_VERSION >= 1000000
|
||||
/* __ARMCC_VERSION = VRRPPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
|
||||
#else
|
||||
/* __ARMCC_VERSION = VRPPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
|
||||
#endif
|
||||
|
||||
|
||||
#elif defined(__clang__) && defined(__apple_build_version__)
|
||||
# define COMPILER_ID "AppleClang"
|
||||
# if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
# endif
|
||||
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
|
||||
# if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# endif
|
||||
# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
|
||||
|
||||
#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
|
||||
# define COMPILER_ID "ARMClang"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
|
||||
|
||||
#elif defined(__clang__)
|
||||
# define COMPILER_ID "Clang"
|
||||
# if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
# endif
|
||||
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
|
||||
# if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# endif
|
||||
|
||||
#elif defined(__GNUC__) || defined(__GNUG__)
|
||||
# define COMPILER_ID "GNU"
|
||||
# if defined(__GNUC__)
|
||||
# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
|
||||
# else
|
||||
# define COMPILER_VERSION_MAJOR DEC(__GNUG__)
|
||||
# endif
|
||||
# if defined(__GNUC_MINOR__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||
# endif
|
||||
# if defined(__GNUC_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
# define COMPILER_ID "MSVC"
|
||||
/* _MSC_VER = VVRR */
|
||||
# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# if defined(_MSC_FULL_VER)
|
||||
# if _MSC_VER >= 1400
|
||||
/* _MSC_FULL_VER = VVRRPPPPP */
|
||||
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
|
||||
# else
|
||||
/* _MSC_FULL_VER = VVRRPPPP */
|
||||
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
|
||||
# endif
|
||||
# endif
|
||||
# if defined(_MSC_BUILD)
|
||||
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
|
||||
# endif
|
||||
|
||||
#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
|
||||
# define COMPILER_ID "ADSP"
|
||||
#if defined(__VISUALDSPVERSION__)
|
||||
/* __VISUALDSPVERSION__ = 0xVVRRPP00 */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
|
||||
# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
|
||||
# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
|
||||
#endif
|
||||
|
||||
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
|
||||
# define COMPILER_ID "IAR"
|
||||
# if defined(__VER__) && defined(__ICCARM__)
|
||||
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
|
||||
# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
|
||||
# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__))
|
||||
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
|
||||
# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
|
||||
# endif
|
||||
|
||||
|
||||
/* These compilers are either not known or too old to define an
|
||||
identification macro. Try to identify the platform and guess that
|
||||
it is the native compiler. */
|
||||
#elif defined(__hpux) || defined(__hpua)
|
||||
# define COMPILER_ID "HP"
|
||||
|
||||
#else /* unknown compiler */
|
||||
# define COMPILER_ID ""
|
||||
#endif
|
||||
|
||||
/* Construct the string literal in pieces to prevent the source from
|
||||
getting matched. Store it in a pointer rather than an array
|
||||
because some compilers will just produce instructions to fill the
|
||||
array rather than assigning a pointer to a static array. */
|
||||
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
|
||||
#ifdef SIMULATE_ID
|
||||
char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
|
||||
#endif
|
||||
|
||||
#ifdef __QNXNTO__
|
||||
char const* qnxnto = "INFO" ":" "qnxnto[]";
|
||||
#endif
|
||||
|
||||
#if defined(__CRAYXE) || defined(__CRAYXC)
|
||||
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
|
||||
#endif
|
||||
|
||||
#define STRINGIFY_HELPER(X) #X
|
||||
#define STRINGIFY(X) STRINGIFY_HELPER(X)
|
||||
|
||||
/* Identify known platforms by name. */
|
||||
#if defined(__linux) || defined(__linux__) || defined(linux)
|
||||
# define PLATFORM_ID "Linux"
|
||||
|
||||
#elif defined(__CYGWIN__)
|
||||
# define PLATFORM_ID "Cygwin"
|
||||
|
||||
#elif defined(__MINGW32__)
|
||||
# define PLATFORM_ID "MinGW"
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
# define PLATFORM_ID "Darwin"
|
||||
|
||||
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
|
||||
# define PLATFORM_ID "Windows"
|
||||
|
||||
#elif defined(__FreeBSD__) || defined(__FreeBSD)
|
||||
# define PLATFORM_ID "FreeBSD"
|
||||
|
||||
#elif defined(__NetBSD__) || defined(__NetBSD)
|
||||
# define PLATFORM_ID "NetBSD"
|
||||
|
||||
#elif defined(__OpenBSD__) || defined(__OPENBSD)
|
||||
# define PLATFORM_ID "OpenBSD"
|
||||
|
||||
#elif defined(__sun) || defined(sun)
|
||||
# define PLATFORM_ID "SunOS"
|
||||
|
||||
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
|
||||
# define PLATFORM_ID "AIX"
|
||||
|
||||
#elif defined(__hpux) || defined(__hpux__)
|
||||
# define PLATFORM_ID "HP-UX"
|
||||
|
||||
#elif defined(__HAIKU__)
|
||||
# define PLATFORM_ID "Haiku"
|
||||
|
||||
#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
|
||||
# define PLATFORM_ID "BeOS"
|
||||
|
||||
#elif defined(__QNX__) || defined(__QNXNTO__)
|
||||
# define PLATFORM_ID "QNX"
|
||||
|
||||
#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
|
||||
# define PLATFORM_ID "Tru64"
|
||||
|
||||
#elif defined(__riscos) || defined(__riscos__)
|
||||
# define PLATFORM_ID "RISCos"
|
||||
|
||||
#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
|
||||
# define PLATFORM_ID "SINIX"
|
||||
|
||||
#elif defined(__UNIX_SV__)
|
||||
# define PLATFORM_ID "UNIX_SV"
|
||||
|
||||
#elif defined(__bsdos__)
|
||||
# define PLATFORM_ID "BSDOS"
|
||||
|
||||
#elif defined(_MPRAS) || defined(MPRAS)
|
||||
# define PLATFORM_ID "MP-RAS"
|
||||
|
||||
#elif defined(__osf) || defined(__osf__)
|
||||
# define PLATFORM_ID "OSF1"
|
||||
|
||||
#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
|
||||
# define PLATFORM_ID "SCO_SV"
|
||||
|
||||
#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
|
||||
# define PLATFORM_ID "ULTRIX"
|
||||
|
||||
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
|
||||
# define PLATFORM_ID "Xenix"
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# if defined(__LINUX__)
|
||||
# define PLATFORM_ID "Linux"
|
||||
|
||||
# elif defined(__DOS__)
|
||||
# define PLATFORM_ID "DOS"
|
||||
|
||||
# elif defined(__OS2__)
|
||||
# define PLATFORM_ID "OS2"
|
||||
|
||||
# elif defined(__WINDOWS__)
|
||||
# define PLATFORM_ID "Windows3x"
|
||||
|
||||
# else /* unknown platform */
|
||||
# define PLATFORM_ID
|
||||
# endif
|
||||
|
||||
#elif defined(__INTEGRITY)
|
||||
# if defined(INT_178B)
|
||||
# define PLATFORM_ID "Integrity178"
|
||||
|
||||
# else /* regular Integrity */
|
||||
# define PLATFORM_ID "Integrity"
|
||||
# endif
|
||||
|
||||
#else /* unknown platform */
|
||||
# define PLATFORM_ID
|
||||
|
||||
#endif
|
||||
|
||||
/* For windows compilers MSVC and Intel we can determine
|
||||
the architecture of the compiler being used. This is because
|
||||
the compilers do not have flags that can change the architecture,
|
||||
but rather depend on which compiler is being used
|
||||
*/
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
# if defined(_M_IA64)
|
||||
# define ARCHITECTURE_ID "IA64"
|
||||
|
||||
# elif defined(_M_X64) || defined(_M_AMD64)
|
||||
# define ARCHITECTURE_ID "x64"
|
||||
|
||||
# elif defined(_M_IX86)
|
||||
# define ARCHITECTURE_ID "X86"
|
||||
|
||||
# elif defined(_M_ARM64)
|
||||
# define ARCHITECTURE_ID "ARM64"
|
||||
|
||||
# elif defined(_M_ARM)
|
||||
# if _M_ARM == 4
|
||||
# define ARCHITECTURE_ID "ARMV4I"
|
||||
# elif _M_ARM == 5
|
||||
# define ARCHITECTURE_ID "ARMV5I"
|
||||
# else
|
||||
# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
|
||||
# endif
|
||||
|
||||
# elif defined(_M_MIPS)
|
||||
# define ARCHITECTURE_ID "MIPS"
|
||||
|
||||
# elif defined(_M_SH)
|
||||
# define ARCHITECTURE_ID "SHx"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# if defined(_M_I86)
|
||||
# define ARCHITECTURE_ID "I86"
|
||||
|
||||
# elif defined(_M_IX86)
|
||||
# define ARCHITECTURE_ID "X86"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
|
||||
# if defined(__ICCARM__)
|
||||
# define ARCHITECTURE_ID "ARM"
|
||||
|
||||
# elif defined(__ICCRX__)
|
||||
# define ARCHITECTURE_ID "RX"
|
||||
|
||||
# elif defined(__ICCRH850__)
|
||||
# define ARCHITECTURE_ID "RH850"
|
||||
|
||||
# elif defined(__ICCRL78__)
|
||||
# define ARCHITECTURE_ID "RL78"
|
||||
|
||||
# elif defined(__ICCRISCV__)
|
||||
# define ARCHITECTURE_ID "RISCV"
|
||||
|
||||
# elif defined(__ICCAVR__)
|
||||
# define ARCHITECTURE_ID "AVR"
|
||||
|
||||
# elif defined(__ICC430__)
|
||||
# define ARCHITECTURE_ID "MSP430"
|
||||
|
||||
# elif defined(__ICCV850__)
|
||||
# define ARCHITECTURE_ID "V850"
|
||||
|
||||
# elif defined(__ICC8051__)
|
||||
# define ARCHITECTURE_ID "8051"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__ghs__)
|
||||
# if defined(__PPC64__)
|
||||
# define ARCHITECTURE_ID "PPC64"
|
||||
|
||||
# elif defined(__ppc__)
|
||||
# define ARCHITECTURE_ID "PPC"
|
||||
|
||||
# elif defined(__ARM__)
|
||||
# define ARCHITECTURE_ID "ARM"
|
||||
|
||||
# elif defined(__x86_64__)
|
||||
# define ARCHITECTURE_ID "x64"
|
||||
|
||||
# elif defined(__i386__)
|
||||
# define ARCHITECTURE_ID "X86"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
#else
|
||||
# define ARCHITECTURE_ID
|
||||
#endif
|
||||
|
||||
/* Convert integer to decimal digit literals. */
|
||||
#define DEC(n) \
|
||||
('0' + (((n) / 10000000)%10)), \
|
||||
('0' + (((n) / 1000000)%10)), \
|
||||
('0' + (((n) / 100000)%10)), \
|
||||
('0' + (((n) / 10000)%10)), \
|
||||
('0' + (((n) / 1000)%10)), \
|
||||
('0' + (((n) / 100)%10)), \
|
||||
('0' + (((n) / 10)%10)), \
|
||||
('0' + ((n) % 10))
|
||||
|
||||
/* Convert integer to hex digit literals. */
|
||||
#define HEX(n) \
|
||||
('0' + ((n)>>28 & 0xF)), \
|
||||
('0' + ((n)>>24 & 0xF)), \
|
||||
('0' + ((n)>>20 & 0xF)), \
|
||||
('0' + ((n)>>16 & 0xF)), \
|
||||
('0' + ((n)>>12 & 0xF)), \
|
||||
('0' + ((n)>>8 & 0xF)), \
|
||||
('0' + ((n)>>4 & 0xF)), \
|
||||
('0' + ((n) & 0xF))
|
||||
|
||||
/* Construct a string literal encoding the version number components. */
|
||||
#ifdef COMPILER_VERSION_MAJOR
|
||||
char const info_version[] = {
|
||||
'I', 'N', 'F', 'O', ':',
|
||||
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
|
||||
COMPILER_VERSION_MAJOR,
|
||||
# ifdef COMPILER_VERSION_MINOR
|
||||
'.', COMPILER_VERSION_MINOR,
|
||||
# ifdef COMPILER_VERSION_PATCH
|
||||
'.', COMPILER_VERSION_PATCH,
|
||||
# ifdef COMPILER_VERSION_TWEAK
|
||||
'.', COMPILER_VERSION_TWEAK,
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
']','\0'};
|
||||
#endif
|
||||
|
||||
/* Construct a string literal encoding the internal version number. */
|
||||
#ifdef COMPILER_VERSION_INTERNAL
|
||||
char const info_version_internal[] = {
|
||||
'I', 'N', 'F', 'O', ':',
|
||||
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
|
||||
'i','n','t','e','r','n','a','l','[',
|
||||
COMPILER_VERSION_INTERNAL,']','\0'};
|
||||
#endif
|
||||
|
||||
/* Construct a string literal encoding the version number components. */
|
||||
#ifdef SIMULATE_VERSION_MAJOR
|
||||
char const info_simulate_version[] = {
|
||||
'I', 'N', 'F', 'O', ':',
|
||||
's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
|
||||
SIMULATE_VERSION_MAJOR,
|
||||
# ifdef SIMULATE_VERSION_MINOR
|
||||
'.', SIMULATE_VERSION_MINOR,
|
||||
# ifdef SIMULATE_VERSION_PATCH
|
||||
'.', SIMULATE_VERSION_PATCH,
|
||||
# ifdef SIMULATE_VERSION_TWEAK
|
||||
'.', SIMULATE_VERSION_TWEAK,
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
']','\0'};
|
||||
#endif
|
||||
|
||||
/* Construct the string literal in pieces to prevent the source from
|
||||
getting matched. Store it in a pointer rather than an array
|
||||
because some compilers will just produce instructions to fill the
|
||||
array rather than assigning a pointer to a static array. */
|
||||
char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
|
||||
char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
|
||||
|
||||
|
||||
|
||||
|
||||
#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L
|
||||
# if defined(__INTEL_CXX11_MODE__)
|
||||
# if defined(__cpp_aggregate_nsdmi)
|
||||
# define CXX_STD 201402L
|
||||
# else
|
||||
# define CXX_STD 201103L
|
||||
# endif
|
||||
# else
|
||||
# define CXX_STD 199711L
|
||||
# endif
|
||||
#elif defined(_MSC_VER) && defined(_MSVC_LANG)
|
||||
# define CXX_STD _MSVC_LANG
|
||||
#else
|
||||
# define CXX_STD __cplusplus
|
||||
#endif
|
||||
|
||||
const char* info_language_dialect_default = "INFO" ":" "dialect_default["
|
||||
#if CXX_STD > 201703L
|
||||
"20"
|
||||
#elif CXX_STD >= 201703L
|
||||
"17"
|
||||
#elif CXX_STD >= 201402L
|
||||
"14"
|
||||
#elif CXX_STD >= 201103L
|
||||
"11"
|
||||
#else
|
||||
"98"
|
||||
#endif
|
||||
"]";
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int require = 0;
|
||||
require += info_compiler[argc];
|
||||
require += info_platform[argc];
|
||||
#ifdef COMPILER_VERSION_MAJOR
|
||||
require += info_version[argc];
|
||||
#endif
|
||||
#ifdef COMPILER_VERSION_INTERNAL
|
||||
require += info_version_internal[argc];
|
||||
#endif
|
||||
#ifdef SIMULATE_ID
|
||||
require += info_simulate[argc];
|
||||
#endif
|
||||
#ifdef SIMULATE_VERSION_MAJOR
|
||||
require += info_simulate_version[argc];
|
||||
#endif
|
||||
#if defined(__CRAYXE) || defined(__CRAYXC)
|
||||
require += info_cray[argc];
|
||||
#endif
|
||||
require += info_language_dialect_default[argc];
|
||||
(void)argv;
|
||||
return require;
|
||||
}
|
||||
BIN
applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/3.16.3/CompilerIdCXX/a.out
vendored
Executable file
BIN
applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/3.16.3/CompilerIdCXX/a.out
vendored
Executable file
Binary file not shown.
463
applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/CMakeOutput.log
vendored
Normal file
463
applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/CMakeOutput.log
vendored
Normal file
@@ -0,0 +1,463 @@
|
||||
The system is: Linux - 5.10.16.3-microsoft-standard-WSL2 - x86_64
|
||||
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
|
||||
Compiler: /usr/bin/cc
|
||||
Build flags:
|
||||
Id flags:
|
||||
|
||||
The output was:
|
||||
0
|
||||
|
||||
|
||||
Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out"
|
||||
|
||||
The C compiler identification is GNU, found in "/home/cococode/flipperzero-firmware/lib/esp-serial-flasher/CMakeFiles/3.16.3/CompilerIdC/a.out"
|
||||
|
||||
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
|
||||
Compiler: /usr/bin/c++
|
||||
Build flags:
|
||||
Id flags:
|
||||
|
||||
The output was:
|
||||
0
|
||||
|
||||
|
||||
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out"
|
||||
|
||||
The CXX compiler identification is GNU, found in "/home/cococode/flipperzero-firmware/lib/esp-serial-flasher/CMakeFiles/3.16.3/CompilerIdCXX/a.out"
|
||||
|
||||
Determining if the C compiler works passed with the following output:
|
||||
Change Dir: /home/cococode/flipperzero-firmware/lib/esp-serial-flasher/CMakeFiles/CMakeTmp
|
||||
|
||||
Run Build Command(s):/usr/bin/make cmTC_8695b/fast && /usr/bin/make -f CMakeFiles/cmTC_8695b.dir/build.make CMakeFiles/cmTC_8695b.dir/build
|
||||
make[1]: Entering directory '/home/cococode/flipperzero-firmware/lib/esp-serial-flasher/CMakeFiles/CMakeTmp'
|
||||
Building C object CMakeFiles/cmTC_8695b.dir/testCCompiler.c.o
|
||||
/usr/bin/cc -o CMakeFiles/cmTC_8695b.dir/testCCompiler.c.o -c /home/cococode/flipperzero-firmware/lib/esp-serial-flasher/CMakeFiles/CMakeTmp/testCCompiler.c
|
||||
Linking C executable cmTC_8695b
|
||||
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8695b.dir/link.txt --verbose=1
|
||||
/usr/bin/cc -rdynamic CMakeFiles/cmTC_8695b.dir/testCCompiler.c.o -o cmTC_8695b
|
||||
make[1]: Leaving directory '/home/cococode/flipperzero-firmware/lib/esp-serial-flasher/CMakeFiles/CMakeTmp'
|
||||
|
||||
|
||||
|
||||
Detecting C compiler ABI info compiled with the following output:
|
||||
Change Dir: /home/cococode/flipperzero-firmware/lib/esp-serial-flasher/CMakeFiles/CMakeTmp
|
||||
|
||||
Run Build Command(s):/usr/bin/make cmTC_8c7d9/fast && /usr/bin/make -f CMakeFiles/cmTC_8c7d9.dir/build.make CMakeFiles/cmTC_8c7d9.dir/build
|
||||
make[1]: Entering directory '/home/cococode/flipperzero-firmware/lib/esp-serial-flasher/CMakeFiles/CMakeTmp'
|
||||
Building C object CMakeFiles/cmTC_8c7d9.dir/CMakeCCompilerABI.c.o
|
||||
/usr/bin/cc -v -o CMakeFiles/cmTC_8c7d9.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c
|
||||
Using built-in specs.
|
||||
COLLECT_GCC=/usr/bin/cc
|
||||
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
|
||||
OFFLOAD_TARGET_DEFAULT=1
|
||||
Target: x86_64-linux-gnu
|
||||
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.1' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-Av3uEd/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
|
||||
Thread model: posix
|
||||
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
|
||||
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8c7d9.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'
|
||||
/usr/lib/gcc/x86_64-linux-gnu/9/cc1 -quiet -v -imultiarch x86_64-linux-gnu /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_8c7d9.dir/CMakeCCompilerABI.c.o -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/ccBr8JWY.s
|
||||
GNU C17 (Ubuntu 9.4.0-1ubuntu1~20.04.1) version 9.4.0 (x86_64-linux-gnu)
|
||||
compiled by GNU C version 9.4.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP
|
||||
|
||||
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
|
||||
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
|
||||
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed"
|
||||
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include"
|
||||
#include "..." search starts here:
|
||||
#include <...> search starts here:
|
||||
/usr/lib/gcc/x86_64-linux-gnu/9/include
|
||||
/usr/local/include
|
||||
/usr/include/x86_64-linux-gnu
|
||||
/usr/include
|
||||
End of search list.
|
||||
GNU C17 (Ubuntu 9.4.0-1ubuntu1~20.04.1) version 9.4.0 (x86_64-linux-gnu)
|
||||
compiled by GNU C version 9.4.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP
|
||||
|
||||
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
|
||||
Compiler executable checksum: c0c95c0b4209efec1c1892d5ff24030b
|
||||
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8c7d9.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'
|
||||
as -v --64 -o CMakeFiles/cmTC_8c7d9.dir/CMakeCCompilerABI.c.o /tmp/ccBr8JWY.s
|
||||
GNU assembler version 2.34 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34
|
||||
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/
|
||||
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/
|
||||
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8c7d9.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'
|
||||
Linking C executable cmTC_8c7d9
|
||||
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8c7d9.dir/link.txt --verbose=1
|
||||
/usr/bin/cc -v -rdynamic CMakeFiles/cmTC_8c7d9.dir/CMakeCCompilerABI.c.o -o cmTC_8c7d9
|
||||
Using built-in specs.
|
||||
COLLECT_GCC=/usr/bin/cc
|
||||
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
|
||||
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
|
||||
OFFLOAD_TARGET_DEFAULT=1
|
||||
Target: x86_64-linux-gnu
|
||||
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.1' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-Av3uEd/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
|
||||
Thread model: posix
|
||||
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
|
||||
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/
|
||||
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/
|
||||
COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_8c7d9' '-mtune=generic' '-march=x86-64'
|
||||
/usr/lib/gcc/x86_64-linux-gnu/9/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper -plugin-opt=-fresolution=/tmp/cc78SKyq.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_8c7d9 /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. CMakeFiles/cmTC_8c7d9.dir/CMakeCCompilerABI.c.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o
|
||||
COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_8c7d9' '-mtune=generic' '-march=x86-64'
|
||||
make[1]: Leaving directory '/home/cococode/flipperzero-firmware/lib/esp-serial-flasher/CMakeFiles/CMakeTmp'
|
||||
|
||||
|
||||
|
||||
Parsed C implicit include dir info from above output: rv=done
|
||||
found start of include info
|
||||
found start of implicit include info
|
||||
add: [/usr/lib/gcc/x86_64-linux-gnu/9/include]
|
||||
add: [/usr/local/include]
|
||||
add: [/usr/include/x86_64-linux-gnu]
|
||||
add: [/usr/include]
|
||||
end of search list found
|
||||
collapse include dir [/usr/lib/gcc/x86_64-linux-gnu/9/include] ==> [/usr/lib/gcc/x86_64-linux-gnu/9/include]
|
||||
collapse include dir [/usr/local/include] ==> [/usr/local/include]
|
||||
collapse include dir [/usr/include/x86_64-linux-gnu] ==> [/usr/include/x86_64-linux-gnu]
|
||||
collapse include dir [/usr/include] ==> [/usr/include]
|
||||
implicit include dirs: [/usr/lib/gcc/x86_64-linux-gnu/9/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include]
|
||||
|
||||
|
||||
Parsed C implicit link information from above output:
|
||||
link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)]
|
||||
ignore line: [Change Dir: /home/cococode/flipperzero-firmware/lib/esp-serial-flasher/CMakeFiles/CMakeTmp]
|
||||
ignore line: []
|
||||
ignore line: [Run Build Command(s):/usr/bin/make cmTC_8c7d9/fast && /usr/bin/make -f CMakeFiles/cmTC_8c7d9.dir/build.make CMakeFiles/cmTC_8c7d9.dir/build]
|
||||
ignore line: [make[1]: Entering directory '/home/cococode/flipperzero-firmware/lib/esp-serial-flasher/CMakeFiles/CMakeTmp']
|
||||
ignore line: [Building C object CMakeFiles/cmTC_8c7d9.dir/CMakeCCompilerABI.c.o]
|
||||
ignore line: [/usr/bin/cc -v -o CMakeFiles/cmTC_8c7d9.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c]
|
||||
ignore line: [Using built-in specs.]
|
||||
ignore line: [COLLECT_GCC=/usr/bin/cc]
|
||||
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none:hsa]
|
||||
ignore line: [OFFLOAD_TARGET_DEFAULT=1]
|
||||
ignore line: [Target: x86_64-linux-gnu]
|
||||
ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.1' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-Av3uEd/gcc-9-9.4.0/debian/tmp-nvptx/usr hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu]
|
||||
ignore line: [Thread model: posix]
|
||||
ignore line: [gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1) ]
|
||||
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8c7d9.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64']
|
||||
ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/9/cc1 -quiet -v -imultiarch x86_64-linux-gnu /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_8c7d9.dir/CMakeCCompilerABI.c.o -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/ccBr8JWY.s]
|
||||
ignore line: [GNU C17 (Ubuntu 9.4.0-1ubuntu1~20.04.1) version 9.4.0 (x86_64-linux-gnu)]
|
||||
ignore line: [ compiled by GNU C version 9.4.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP]
|
||||
ignore line: []
|
||||
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
|
||||
ignore line: [ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"]
|
||||
ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed"]
|
||||
ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include"]
|
||||
ignore line: [#include "..." search starts here:]
|
||||
ignore line: [#include <...> search starts here:]
|
||||
ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/9/include]
|
||||
ignore line: [ /usr/local/include]
|
||||
ignore line: [ /usr/include/x86_64-linux-gnu]
|
||||
ignore line: [ /usr/include]
|
||||
ignore line: [End of search list.]
|
||||
ignore line: [GNU C17 (Ubuntu 9.4.0-1ubuntu1~20.04.1) version 9.4.0 (x86_64-linux-gnu)]
|
||||
ignore line: [ compiled by GNU C version 9.4.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP]
|
||||
ignore line: []
|
||||
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
|
||||
ignore line: [Compiler executable checksum: c0c95c0b4209efec1c1892d5ff24030b]
|
||||
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8c7d9.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64']
|
||||
ignore line: [ as -v --64 -o CMakeFiles/cmTC_8c7d9.dir/CMakeCCompilerABI.c.o /tmp/ccBr8JWY.s]
|
||||
ignore line: [GNU assembler version 2.34 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34]
|
||||
ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/]
|
||||
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/]
|
||||
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8c7d9.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64']
|
||||
ignore line: [Linking C executable cmTC_8c7d9]
|
||||
ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8c7d9.dir/link.txt --verbose=1]
|
||||
ignore line: [/usr/bin/cc -v -rdynamic CMakeFiles/cmTC_8c7d9.dir/CMakeCCompilerABI.c.o -o cmTC_8c7d9 ]
|
||||
ignore line: [Using built-in specs.]
|
||||
ignore line: [COLLECT_GCC=/usr/bin/cc]
|
||||
ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper]
|
||||
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none:hsa]
|
||||
ignore line: [OFFLOAD_TARGET_DEFAULT=1]
|
||||
ignore line: [Target: x86_64-linux-gnu]
|
||||
ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.1' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-Av3uEd/gcc-9-9.4.0/debian/tmp-nvptx/usr hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu]
|
||||
ignore line: [Thread model: posix]
|
||||
ignore line: [gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1) ]
|
||||
ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/]
|
||||
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/]
|
||||
ignore line: [COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_8c7d9' '-mtune=generic' '-march=x86-64']
|
||||
link line: [ /usr/lib/gcc/x86_64-linux-gnu/9/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper -plugin-opt=-fresolution=/tmp/cc78SKyq.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_8c7d9 /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. CMakeFiles/cmTC_8c7d9.dir/CMakeCCompilerABI.c.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o]
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/9/collect2] ==> ignore
|
||||
arg [-plugin] ==> ignore
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so] ==> ignore
|
||||
arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper] ==> ignore
|
||||
arg [-plugin-opt=-fresolution=/tmp/cc78SKyq.res] ==> ignore
|
||||
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
|
||||
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
|
||||
arg [-plugin-opt=-pass-through=-lc] ==> ignore
|
||||
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
|
||||
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
|
||||
arg [--build-id] ==> ignore
|
||||
arg [--eh-frame-hdr] ==> ignore
|
||||
arg [-m] ==> ignore
|
||||
arg [elf_x86_64] ==> ignore
|
||||
arg [--hash-style=gnu] ==> ignore
|
||||
arg [--as-needed] ==> ignore
|
||||
arg [-export-dynamic] ==> ignore
|
||||
arg [-dynamic-linker] ==> ignore
|
||||
arg [/lib64/ld-linux-x86-64.so.2] ==> ignore
|
||||
arg [-pie] ==> ignore
|
||||
arg [-znow] ==> ignore
|
||||
arg [-zrelro] ==> ignore
|
||||
arg [-o] ==> ignore
|
||||
arg [cmTC_8c7d9] ==> ignore
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o] ==> ignore
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o] ==> ignore
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o] ==> ignore
|
||||
arg [-L/usr/lib/gcc/x86_64-linux-gnu/9] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9]
|
||||
arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu]
|
||||
arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib]
|
||||
arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu]
|
||||
arg [-L/lib/../lib] ==> dir [/lib/../lib]
|
||||
arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu]
|
||||
arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib]
|
||||
arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../..]
|
||||
arg [CMakeFiles/cmTC_8c7d9.dir/CMakeCCompilerABI.c.o] ==> ignore
|
||||
arg [-lgcc] ==> lib [gcc]
|
||||
arg [--push-state] ==> ignore
|
||||
arg [--as-needed] ==> ignore
|
||||
arg [-lgcc_s] ==> lib [gcc_s]
|
||||
arg [--pop-state] ==> ignore
|
||||
arg [-lc] ==> lib [c]
|
||||
arg [-lgcc] ==> lib [gcc]
|
||||
arg [--push-state] ==> ignore
|
||||
arg [--as-needed] ==> ignore
|
||||
arg [-lgcc_s] ==> lib [gcc_s]
|
||||
arg [--pop-state] ==> ignore
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o] ==> ignore
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o] ==> ignore
|
||||
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9] ==> [/usr/lib/gcc/x86_64-linux-gnu/9]
|
||||
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
|
||||
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib] ==> [/usr/lib]
|
||||
collapse library dir [/lib/x86_64-linux-gnu] ==> [/lib/x86_64-linux-gnu]
|
||||
collapse library dir [/lib/../lib] ==> [/lib]
|
||||
collapse library dir [/usr/lib/x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
|
||||
collapse library dir [/usr/lib/../lib] ==> [/usr/lib]
|
||||
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../..] ==> [/usr/lib]
|
||||
implicit libs: [gcc;gcc_s;c;gcc;gcc_s]
|
||||
implicit dirs: [/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib]
|
||||
implicit fwks: []
|
||||
|
||||
|
||||
Determining if the CXX compiler works passed with the following output:
|
||||
Change Dir: /home/cococode/flipperzero-firmware/lib/esp-serial-flasher/CMakeFiles/CMakeTmp
|
||||
|
||||
Run Build Command(s):/usr/bin/make cmTC_9b51d/fast && /usr/bin/make -f CMakeFiles/cmTC_9b51d.dir/build.make CMakeFiles/cmTC_9b51d.dir/build
|
||||
make[1]: Entering directory '/home/cococode/flipperzero-firmware/lib/esp-serial-flasher/CMakeFiles/CMakeTmp'
|
||||
Building CXX object CMakeFiles/cmTC_9b51d.dir/testCXXCompiler.cxx.o
|
||||
/usr/bin/c++ -o CMakeFiles/cmTC_9b51d.dir/testCXXCompiler.cxx.o -c /home/cococode/flipperzero-firmware/lib/esp-serial-flasher/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
|
||||
Linking CXX executable cmTC_9b51d
|
||||
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_9b51d.dir/link.txt --verbose=1
|
||||
/usr/bin/c++ -rdynamic CMakeFiles/cmTC_9b51d.dir/testCXXCompiler.cxx.o -o cmTC_9b51d
|
||||
make[1]: Leaving directory '/home/cococode/flipperzero-firmware/lib/esp-serial-flasher/CMakeFiles/CMakeTmp'
|
||||
|
||||
|
||||
|
||||
Detecting CXX compiler ABI info compiled with the following output:
|
||||
Change Dir: /home/cococode/flipperzero-firmware/lib/esp-serial-flasher/CMakeFiles/CMakeTmp
|
||||
|
||||
Run Build Command(s):/usr/bin/make cmTC_b76ad/fast && /usr/bin/make -f CMakeFiles/cmTC_b76ad.dir/build.make CMakeFiles/cmTC_b76ad.dir/build
|
||||
make[1]: Entering directory '/home/cococode/flipperzero-firmware/lib/esp-serial-flasher/CMakeFiles/CMakeTmp'
|
||||
Building CXX object CMakeFiles/cmTC_b76ad.dir/CMakeCXXCompilerABI.cpp.o
|
||||
/usr/bin/c++ -v -o CMakeFiles/cmTC_b76ad.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp
|
||||
Using built-in specs.
|
||||
COLLECT_GCC=/usr/bin/c++
|
||||
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
|
||||
OFFLOAD_TARGET_DEFAULT=1
|
||||
Target: x86_64-linux-gnu
|
||||
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.1' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-Av3uEd/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
|
||||
Thread model: posix
|
||||
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
|
||||
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_b76ad.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
|
||||
/usr/lib/gcc/x86_64-linux-gnu/9/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_b76ad.dir/CMakeCXXCompilerABI.cpp.o -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/ccTEwRoV.s
|
||||
GNU C++14 (Ubuntu 9.4.0-1ubuntu1~20.04.1) version 9.4.0 (x86_64-linux-gnu)
|
||||
compiled by GNU C version 9.4.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP
|
||||
|
||||
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
|
||||
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/9"
|
||||
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
|
||||
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed"
|
||||
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include"
|
||||
#include "..." search starts here:
|
||||
#include <...> search starts here:
|
||||
/usr/include/c++/9
|
||||
/usr/include/x86_64-linux-gnu/c++/9
|
||||
/usr/include/c++/9/backward
|
||||
/usr/lib/gcc/x86_64-linux-gnu/9/include
|
||||
/usr/local/include
|
||||
/usr/include/x86_64-linux-gnu
|
||||
/usr/include
|
||||
End of search list.
|
||||
GNU C++14 (Ubuntu 9.4.0-1ubuntu1~20.04.1) version 9.4.0 (x86_64-linux-gnu)
|
||||
compiled by GNU C version 9.4.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP
|
||||
|
||||
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
|
||||
Compiler executable checksum: 65fe925b83d3956b533de4aaba7dace0
|
||||
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_b76ad.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
|
||||
as -v --64 -o CMakeFiles/cmTC_b76ad.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccTEwRoV.s
|
||||
GNU assembler version 2.34 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34
|
||||
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/
|
||||
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/
|
||||
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_b76ad.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
|
||||
Linking CXX executable cmTC_b76ad
|
||||
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b76ad.dir/link.txt --verbose=1
|
||||
/usr/bin/c++ -v -rdynamic CMakeFiles/cmTC_b76ad.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_b76ad
|
||||
Using built-in specs.
|
||||
COLLECT_GCC=/usr/bin/c++
|
||||
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
|
||||
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
|
||||
OFFLOAD_TARGET_DEFAULT=1
|
||||
Target: x86_64-linux-gnu
|
||||
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.1' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-Av3uEd/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
|
||||
Thread model: posix
|
||||
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
|
||||
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/
|
||||
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/
|
||||
COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_b76ad' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
|
||||
/usr/lib/gcc/x86_64-linux-gnu/9/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper -plugin-opt=-fresolution=/tmp/ccnXxdBn.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_b76ad /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. CMakeFiles/cmTC_b76ad.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o
|
||||
COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_b76ad' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
|
||||
make[1]: Leaving directory '/home/cococode/flipperzero-firmware/lib/esp-serial-flasher/CMakeFiles/CMakeTmp'
|
||||
|
||||
|
||||
|
||||
Parsed CXX implicit include dir info from above output: rv=done
|
||||
found start of include info
|
||||
found start of implicit include info
|
||||
add: [/usr/include/c++/9]
|
||||
add: [/usr/include/x86_64-linux-gnu/c++/9]
|
||||
add: [/usr/include/c++/9/backward]
|
||||
add: [/usr/lib/gcc/x86_64-linux-gnu/9/include]
|
||||
add: [/usr/local/include]
|
||||
add: [/usr/include/x86_64-linux-gnu]
|
||||
add: [/usr/include]
|
||||
end of search list found
|
||||
collapse include dir [/usr/include/c++/9] ==> [/usr/include/c++/9]
|
||||
collapse include dir [/usr/include/x86_64-linux-gnu/c++/9] ==> [/usr/include/x86_64-linux-gnu/c++/9]
|
||||
collapse include dir [/usr/include/c++/9/backward] ==> [/usr/include/c++/9/backward]
|
||||
collapse include dir [/usr/lib/gcc/x86_64-linux-gnu/9/include] ==> [/usr/lib/gcc/x86_64-linux-gnu/9/include]
|
||||
collapse include dir [/usr/local/include] ==> [/usr/local/include]
|
||||
collapse include dir [/usr/include/x86_64-linux-gnu] ==> [/usr/include/x86_64-linux-gnu]
|
||||
collapse include dir [/usr/include] ==> [/usr/include]
|
||||
implicit include dirs: [/usr/include/c++/9;/usr/include/x86_64-linux-gnu/c++/9;/usr/include/c++/9/backward;/usr/lib/gcc/x86_64-linux-gnu/9/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include]
|
||||
|
||||
|
||||
Parsed CXX implicit link information from above output:
|
||||
link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)]
|
||||
ignore line: [Change Dir: /home/cococode/flipperzero-firmware/lib/esp-serial-flasher/CMakeFiles/CMakeTmp]
|
||||
ignore line: []
|
||||
ignore line: [Run Build Command(s):/usr/bin/make cmTC_b76ad/fast && /usr/bin/make -f CMakeFiles/cmTC_b76ad.dir/build.make CMakeFiles/cmTC_b76ad.dir/build]
|
||||
ignore line: [make[1]: Entering directory '/home/cococode/flipperzero-firmware/lib/esp-serial-flasher/CMakeFiles/CMakeTmp']
|
||||
ignore line: [Building CXX object CMakeFiles/cmTC_b76ad.dir/CMakeCXXCompilerABI.cpp.o]
|
||||
ignore line: [/usr/bin/c++ -v -o CMakeFiles/cmTC_b76ad.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp]
|
||||
ignore line: [Using built-in specs.]
|
||||
ignore line: [COLLECT_GCC=/usr/bin/c++]
|
||||
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none:hsa]
|
||||
ignore line: [OFFLOAD_TARGET_DEFAULT=1]
|
||||
ignore line: [Target: x86_64-linux-gnu]
|
||||
ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.1' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-Av3uEd/gcc-9-9.4.0/debian/tmp-nvptx/usr hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu]
|
||||
ignore line: [Thread model: posix]
|
||||
ignore line: [gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1) ]
|
||||
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_b76ad.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64']
|
||||
ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/9/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_b76ad.dir/CMakeCXXCompilerABI.cpp.o -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/ccTEwRoV.s]
|
||||
ignore line: [GNU C++14 (Ubuntu 9.4.0-1ubuntu1~20.04.1) version 9.4.0 (x86_64-linux-gnu)]
|
||||
ignore line: [ compiled by GNU C version 9.4.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP]
|
||||
ignore line: []
|
||||
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
|
||||
ignore line: [ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/9"]
|
||||
ignore line: [ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"]
|
||||
ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed"]
|
||||
ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include"]
|
||||
ignore line: [#include "..." search starts here:]
|
||||
ignore line: [#include <...> search starts here:]
|
||||
ignore line: [ /usr/include/c++/9]
|
||||
ignore line: [ /usr/include/x86_64-linux-gnu/c++/9]
|
||||
ignore line: [ /usr/include/c++/9/backward]
|
||||
ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/9/include]
|
||||
ignore line: [ /usr/local/include]
|
||||
ignore line: [ /usr/include/x86_64-linux-gnu]
|
||||
ignore line: [ /usr/include]
|
||||
ignore line: [End of search list.]
|
||||
ignore line: [GNU C++14 (Ubuntu 9.4.0-1ubuntu1~20.04.1) version 9.4.0 (x86_64-linux-gnu)]
|
||||
ignore line: [ compiled by GNU C version 9.4.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP]
|
||||
ignore line: []
|
||||
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
|
||||
ignore line: [Compiler executable checksum: 65fe925b83d3956b533de4aaba7dace0]
|
||||
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_b76ad.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64']
|
||||
ignore line: [ as -v --64 -o CMakeFiles/cmTC_b76ad.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccTEwRoV.s]
|
||||
ignore line: [GNU assembler version 2.34 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34]
|
||||
ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/]
|
||||
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/]
|
||||
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_b76ad.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64']
|
||||
ignore line: [Linking CXX executable cmTC_b76ad]
|
||||
ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b76ad.dir/link.txt --verbose=1]
|
||||
ignore line: [/usr/bin/c++ -v -rdynamic CMakeFiles/cmTC_b76ad.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_b76ad ]
|
||||
ignore line: [Using built-in specs.]
|
||||
ignore line: [COLLECT_GCC=/usr/bin/c++]
|
||||
ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper]
|
||||
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none:hsa]
|
||||
ignore line: [OFFLOAD_TARGET_DEFAULT=1]
|
||||
ignore line: [Target: x86_64-linux-gnu]
|
||||
ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.1' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-Av3uEd/gcc-9-9.4.0/debian/tmp-nvptx/usr hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu]
|
||||
ignore line: [Thread model: posix]
|
||||
ignore line: [gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1) ]
|
||||
ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/]
|
||||
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/]
|
||||
ignore line: [COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_b76ad' '-shared-libgcc' '-mtune=generic' '-march=x86-64']
|
||||
link line: [ /usr/lib/gcc/x86_64-linux-gnu/9/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper -plugin-opt=-fresolution=/tmp/ccnXxdBn.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_b76ad /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. CMakeFiles/cmTC_b76ad.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o]
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/9/collect2] ==> ignore
|
||||
arg [-plugin] ==> ignore
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so] ==> ignore
|
||||
arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper] ==> ignore
|
||||
arg [-plugin-opt=-fresolution=/tmp/ccnXxdBn.res] ==> ignore
|
||||
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
|
||||
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
|
||||
arg [-plugin-opt=-pass-through=-lc] ==> ignore
|
||||
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
|
||||
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
|
||||
arg [--build-id] ==> ignore
|
||||
arg [--eh-frame-hdr] ==> ignore
|
||||
arg [-m] ==> ignore
|
||||
arg [elf_x86_64] ==> ignore
|
||||
arg [--hash-style=gnu] ==> ignore
|
||||
arg [--as-needed] ==> ignore
|
||||
arg [-export-dynamic] ==> ignore
|
||||
arg [-dynamic-linker] ==> ignore
|
||||
arg [/lib64/ld-linux-x86-64.so.2] ==> ignore
|
||||
arg [-pie] ==> ignore
|
||||
arg [-znow] ==> ignore
|
||||
arg [-zrelro] ==> ignore
|
||||
arg [-o] ==> ignore
|
||||
arg [cmTC_b76ad] ==> ignore
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o] ==> ignore
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o] ==> ignore
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o] ==> ignore
|
||||
arg [-L/usr/lib/gcc/x86_64-linux-gnu/9] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9]
|
||||
arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu]
|
||||
arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib]
|
||||
arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu]
|
||||
arg [-L/lib/../lib] ==> dir [/lib/../lib]
|
||||
arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu]
|
||||
arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib]
|
||||
arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../..]
|
||||
arg [CMakeFiles/cmTC_b76ad.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore
|
||||
arg [-lstdc++] ==> lib [stdc++]
|
||||
arg [-lm] ==> lib [m]
|
||||
arg [-lgcc_s] ==> lib [gcc_s]
|
||||
arg [-lgcc] ==> lib [gcc]
|
||||
arg [-lc] ==> lib [c]
|
||||
arg [-lgcc_s] ==> lib [gcc_s]
|
||||
arg [-lgcc] ==> lib [gcc]
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o] ==> ignore
|
||||
arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o] ==> ignore
|
||||
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9] ==> [/usr/lib/gcc/x86_64-linux-gnu/9]
|
||||
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
|
||||
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib] ==> [/usr/lib]
|
||||
collapse library dir [/lib/x86_64-linux-gnu] ==> [/lib/x86_64-linux-gnu]
|
||||
collapse library dir [/lib/../lib] ==> [/lib]
|
||||
collapse library dir [/usr/lib/x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
|
||||
collapse library dir [/usr/lib/../lib] ==> [/usr/lib]
|
||||
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../..] ==> [/usr/lib]
|
||||
implicit libs: [stdc++;m;gcc_s;gcc;c;gcc_s;gcc]
|
||||
implicit dirs: [/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib]
|
||||
implicit fwks: []
|
||||
|
||||
|
||||
1
applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/cmake.check_cache
vendored
Normal file
1
applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/cmake.check_cache
vendored
Normal file
@@ -0,0 +1 @@
|
||||
# This file is generated by cmake for dependency checking of the CMakeCache.txt file
|
||||
119
applications/external/esp_flasher/lib/esp-serial-flasher/CMakeLists.txt
vendored
Normal file
119
applications/external/esp_flasher/lib/esp-serial-flasher/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(srcs
|
||||
src/esp_targets.c
|
||||
src/md5_hash.c
|
||||
src/esp_loader.c
|
||||
src/protocol_common.c
|
||||
)
|
||||
|
||||
if (DEFINED ESP_PLATFORM)
|
||||
if (${CONFIG_SERIAL_FLASHER_INTERFACE_UART})
|
||||
list(APPEND srcs
|
||||
src/protocol_uart.c
|
||||
src/slip.c
|
||||
port/esp32_port.c
|
||||
)
|
||||
elseif (${CONFIG_SERIAL_FLASHER_INTERFACE_SPI})
|
||||
list(APPEND srcs
|
||||
src/protocol_spi.c
|
||||
port/esp32_spi_port.c
|
||||
)
|
||||
endif()
|
||||
# Register component to esp-idf build system
|
||||
if ("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER "4.0")
|
||||
# esp_timer component was introduced in v4.2
|
||||
set(priv_requires driver)
|
||||
if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER "4.1")
|
||||
list(APPEND priv_requires esp_timer)
|
||||
endif()
|
||||
|
||||
idf_component_register(SRCS ${srcs}
|
||||
INCLUDE_DIRS include port
|
||||
PRIV_INCLUDE_DIRS private_include
|
||||
PRIV_REQUIRES ${priv_requires})
|
||||
|
||||
set(target ${COMPONENT_LIB})
|
||||
component_compile_options(-Wstrict-prototypes)
|
||||
else()
|
||||
# Remove when dropping support for IDF 3.3
|
||||
set(COMPONENT_SRCS ${srcs})
|
||||
set(COMPONENT_ADD_INCLUDEDIRS include port)
|
||||
set(COMPONENT_PRIV_INCLUDEDIRS private_include)
|
||||
register_component()
|
||||
set(target ${COMPONENT_TARGET})
|
||||
endif()
|
||||
|
||||
else()
|
||||
if (NOT DEFINED SERIAL_FLASHER_INTERFACE_UART AND NOT DEFINED SERIAL_FLASHER_INTERFACE_SPI)
|
||||
set(SERIAL_FLASHER_INTERFACE_UART true)
|
||||
endif()
|
||||
|
||||
if (DEFINED SERIAL_FLASHER_INTERFACE_UART)
|
||||
list(APPEND srcs
|
||||
src/protocol_uart.c
|
||||
src/slip.c
|
||||
)
|
||||
elseif (DEFINED SERIAL_FLASHER_INTERFACE_SPI)
|
||||
list(APPEND srcs src/protocol_spi.c)
|
||||
endif()
|
||||
|
||||
# Create traditional CMake target
|
||||
add_library(flasher ${srcs})
|
||||
|
||||
target_include_directories(flasher PUBLIC include port PRIVATE private_include)
|
||||
|
||||
if(PORT STREQUAL "STM32")
|
||||
target_link_libraries(flasher PUBLIC stm_cube)
|
||||
target_sources(flasher PRIVATE port/stm32_port.c)
|
||||
elseif(PORT STREQUAL "RASPBERRY_PI")
|
||||
find_library(pigpio_LIB pigpio)
|
||||
target_link_libraries(flasher PUBLIC ${pigpio_LIB})
|
||||
target_sources(flasher PRIVATE port/raspberry_port.c)
|
||||
else()
|
||||
message(FATAL_ERROR "Selected port is not supported")
|
||||
endif()
|
||||
|
||||
set(target flasher)
|
||||
|
||||
endif()
|
||||
|
||||
if (DEFINED SERIAL_FLASHER_INTERFACE_UART OR CONFIG_SERIAL_FLASHER_INTERFACE_UART STREQUAL "y")
|
||||
target_compile_definitions(${target}
|
||||
PUBLIC
|
||||
SERIAL_FLASHER_INTERFACE_UART
|
||||
)
|
||||
if (DEFINED MD5_ENABLED OR CONFIG_SERIAL_FLASHER_MD5_ENABLED)
|
||||
target_compile_definitions(${target} PUBLIC MD5_ENABLED=1)
|
||||
endif()
|
||||
elseif (DEFINED SERIAL_FLASHER_INTERFACE_SPI OR CONFIG_SERIAL_FLASHER_INTERFACE_SPI STREQUAL "y")
|
||||
target_compile_definitions(${target}
|
||||
PUBLIC
|
||||
SERIAL_FLASHER_INTERFACE_SPI
|
||||
)
|
||||
endif()
|
||||
|
||||
if(DEFINED SERIAL_FLASHER_DEBUG_TRACE OR CONFIG_SERIAL_FLASHER_DEBUG_TRACE)
|
||||
target_compile_definitions(${target} PUBLIC SERIAL_FLASHER_DEBUG_TRACE)
|
||||
endif()
|
||||
|
||||
if(DEFINED CONFIG_SERIAL_FLASHER_RESET_HOLD_TIME_MS AND DEFINED CONFIG_SERIAL_FLASHER_BOOT_HOLD_TIME_MS)
|
||||
target_compile_definitions(${target}
|
||||
PUBLIC
|
||||
SERIAL_FLASHER_RESET_HOLD_TIME_MS=${CONFIG_SERIAL_FLASHER_RESET_HOLD_TIME_MS}
|
||||
SERIAL_FLASHER_BOOT_HOLD_TIME_MS=${CONFIG_SERIAL_FLASHER_BOOT_HOLD_TIME_MS}
|
||||
)
|
||||
else()
|
||||
if(NOT DEFINED SERIAL_FLASHER_RESET_HOLD_TIME_MS)
|
||||
target_compile_definitions(${target}
|
||||
PUBLIC
|
||||
SERIAL_FLASHER_RESET_HOLD_TIME_MS=100
|
||||
)
|
||||
endif()
|
||||
if(NOT DEFINED SERIAL_FLASHER_BOOT_HOLD_TIME_MS)
|
||||
target_compile_definitions(${target}
|
||||
PUBLIC
|
||||
SERIAL_FLASHER_BOOT_HOLD_TIME_MS=50
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
34
applications/external/esp_flasher/lib/esp-serial-flasher/Kconfig
vendored
Normal file
34
applications/external/esp_flasher/lib/esp-serial-flasher/Kconfig
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
menu "ESP serial flasher"
|
||||
config SERIAL_FLASHER_MD5_ENABLED
|
||||
bool "Enable MD5 check"
|
||||
default y
|
||||
help
|
||||
Select this option to enable MD5 hashsum check after flashing.
|
||||
|
||||
choice SERIAL_FLASHER_INTERFACE
|
||||
prompt "Hardware interface to use for firmware download"
|
||||
default SERIAL_FLASHER_INTERFACE_UART
|
||||
help
|
||||
esp-serial-flasher can work with UART and SPI interfaces.
|
||||
|
||||
config SERIAL_FLASHER_INTERFACE_UART
|
||||
bool "UART"
|
||||
|
||||
config SERIAL_FLASHER_INTERFACE_SPI
|
||||
bool "SPI (Only supports downloading to RAM, experimental)"
|
||||
|
||||
endchoice
|
||||
|
||||
config SERIAL_FLASHER_RESET_HOLD_TIME_MS
|
||||
int "Time for which the reset pin is asserted when doing a hard reset"
|
||||
default 100
|
||||
|
||||
config SERIAL_FLASHER_BOOT_HOLD_TIME_MS
|
||||
int "Time for which the boot pin is asserted when doing a hard reset"
|
||||
default 50
|
||||
|
||||
config SERIAL_FLASHER_DEBUG_TRACE
|
||||
bool "Enable debug tracing output (only transfer data tracing is supported at the time)"
|
||||
default n
|
||||
|
||||
endmenu
|
||||
3
applications/external/esp_flasher/lib/esp-serial-flasher/idf_component.yml
vendored
Normal file
3
applications/external/esp_flasher/lib/esp-serial-flasher/idf_component.yml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
version: "0.2.0"
|
||||
description: Serial flasher component provides portable library for flashing or loading ram loadble app to Espressif SoCs from other host microcontroller
|
||||
url: https://github.com/espressif/esp-serial-flasher
|
||||
313
applications/external/esp_flasher/lib/esp-serial-flasher/include/esp_loader.h
vendored
Normal file
313
applications/external/esp_flasher/lib/esp-serial-flasher/include/esp_loader.h
vendored
Normal file
@@ -0,0 +1,313 @@
|
||||
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Used for backwards compatibility with the previous API */
|
||||
#define esp_loader_change_baudrate esp_loader_change_transmission_rate
|
||||
|
||||
/**
|
||||
* Macro which can be used to check the error code,
|
||||
* and return in case the code is not ESP_LOADER_SUCCESS.
|
||||
*/
|
||||
#define RETURN_ON_ERROR(x) do { \
|
||||
esp_loader_error_t _err_ = (x); \
|
||||
if (_err_ != ESP_LOADER_SUCCESS) { \
|
||||
return _err_; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
/**
|
||||
* @brief Error codes
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_LOADER_SUCCESS, /*!< Success */
|
||||
ESP_LOADER_ERROR_FAIL, /*!< Unspecified error */
|
||||
ESP_LOADER_ERROR_TIMEOUT, /*!< Timeout elapsed */
|
||||
ESP_LOADER_ERROR_IMAGE_SIZE, /*!< Image size to flash is larger than flash size */
|
||||
ESP_LOADER_ERROR_INVALID_MD5, /*!< Computed and received MD5 does not match */
|
||||
ESP_LOADER_ERROR_INVALID_PARAM, /*!< Invalid parameter passed to function */
|
||||
ESP_LOADER_ERROR_INVALID_TARGET, /*!< Connected target is invalid */
|
||||
ESP_LOADER_ERROR_UNSUPPORTED_CHIP, /*!< Attached chip is not supported */
|
||||
ESP_LOADER_ERROR_UNSUPPORTED_FUNC, /*!< Function is not supported on attached target */
|
||||
ESP_LOADER_ERROR_INVALID_RESPONSE /*!< Internal error */
|
||||
} esp_loader_error_t;
|
||||
|
||||
/**
|
||||
* @brief Supported targets
|
||||
*/
|
||||
typedef enum {
|
||||
ESP8266_CHIP = 0,
|
||||
ESP32_CHIP = 1,
|
||||
ESP32S2_CHIP = 2,
|
||||
ESP32C3_CHIP = 3,
|
||||
ESP32S3_CHIP = 4,
|
||||
ESP32C2_CHIP = 5,
|
||||
ESP32H4_CHIP = 6,
|
||||
ESP32H2_CHIP = 7,
|
||||
ESP_MAX_CHIP = 8,
|
||||
ESP_UNKNOWN_CHIP = 8
|
||||
} target_chip_t;
|
||||
|
||||
/**
|
||||
* @brief Application binary header
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t magic;
|
||||
uint8_t segments;
|
||||
uint8_t flash_mode;
|
||||
uint8_t flash_size_freq;
|
||||
uint32_t entrypoint;
|
||||
} esp_loader_bin_header_t;
|
||||
|
||||
/**
|
||||
* @brief Segment binary header
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t addr;
|
||||
uint32_t size;
|
||||
uint8_t *data;
|
||||
} esp_loader_bin_segment_t;
|
||||
|
||||
/**
|
||||
* @brief SPI pin configuration arguments
|
||||
*/
|
||||
typedef union {
|
||||
struct {
|
||||
uint32_t pin_clk: 6;
|
||||
uint32_t pin_q: 6;
|
||||
uint32_t pin_d: 6;
|
||||
uint32_t pin_cs: 6;
|
||||
uint32_t pin_hd: 6;
|
||||
uint32_t zero: 2;
|
||||
};
|
||||
uint32_t val;
|
||||
} esp_loader_spi_config_t;
|
||||
|
||||
/**
|
||||
* @brief Connection arguments
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t sync_timeout; /*!< Maximum time to wait for response from serial interface. */
|
||||
int32_t trials; /*!< Number of trials to connect to target. If greater than 1,
|
||||
100 millisecond delay is inserted after each try. */
|
||||
} esp_loader_connect_args_t;
|
||||
|
||||
#define ESP_LOADER_CONNECT_DEFAULT() { \
|
||||
.sync_timeout = 100, \
|
||||
.trials = 10, \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Connects to the target
|
||||
*
|
||||
* @param connect_args[in] Timing parameters to be used for connecting to target.
|
||||
*
|
||||
* @return
|
||||
* - ESP_LOADER_SUCCESS Success
|
||||
* - ESP_LOADER_ERROR_TIMEOUT Timeout
|
||||
* - ESP_LOADER_ERROR_INVALID_RESPONSE Internal error
|
||||
*/
|
||||
esp_loader_error_t esp_loader_connect(esp_loader_connect_args_t *connect_args);
|
||||
|
||||
/**
|
||||
* @brief Returns attached target chip.
|
||||
*
|
||||
* @warning This function can only be called after connection with target
|
||||
* has been successfully established by calling esp_loader_connect().
|
||||
*
|
||||
* @return One of target_chip_t
|
||||
*/
|
||||
target_chip_t esp_loader_get_target(void);
|
||||
|
||||
|
||||
#ifdef SERIAL_FLASHER_INTERFACE_UART
|
||||
/**
|
||||
* @brief Initiates flash operation
|
||||
*
|
||||
* @param offset[in] Address from which flash operation will be performed.
|
||||
* @param image_size[in] Size of the whole binary to be loaded into flash.
|
||||
* @param block_size[in] Size of buffer used in subsequent calls to esp_loader_flash_write.
|
||||
*
|
||||
* @note image_size is size of the whole image, whereas, block_size is chunk of data sent
|
||||
* to the target, each time esp_loader_flash_write function is called.
|
||||
*
|
||||
* @return
|
||||
* - ESP_LOADER_SUCCESS Success
|
||||
* - ESP_LOADER_ERROR_TIMEOUT Timeout
|
||||
* - ESP_LOADER_ERROR_INVALID_RESPONSE Internal error
|
||||
*/
|
||||
esp_loader_error_t esp_loader_flash_start(uint32_t offset, uint32_t image_size, uint32_t block_size);
|
||||
|
||||
/**
|
||||
* @brief Writes supplied data to target's flash memory.
|
||||
*
|
||||
* @param payload[in] Data to be flashed into target's memory.
|
||||
* @param size[in] Size of payload in bytes.
|
||||
*
|
||||
* @note size must not be greater that block_size supplied to previously called
|
||||
* esp_loader_flash_start function. If size is less than block_size,
|
||||
* remaining bytes of payload buffer will be padded with 0xff.
|
||||
* Therefore, size of payload buffer has to be equal or greater than block_size.
|
||||
*
|
||||
* @return
|
||||
* - ESP_LOADER_SUCCESS Success
|
||||
* - ESP_LOADER_ERROR_TIMEOUT Timeout
|
||||
* - ESP_LOADER_ERROR_INVALID_RESPONSE Internal error
|
||||
*/
|
||||
esp_loader_error_t esp_loader_flash_write(void *payload, uint32_t size);
|
||||
|
||||
/**
|
||||
* @brief Ends flash operation.
|
||||
*
|
||||
* @param reboot[in] reboot the target if true.
|
||||
*
|
||||
* @return
|
||||
* - ESP_LOADER_SUCCESS Success
|
||||
* - ESP_LOADER_ERROR_TIMEOUT Timeout
|
||||
* - ESP_LOADER_ERROR_INVALID_RESPONSE Internal error
|
||||
*/
|
||||
esp_loader_error_t esp_loader_flash_finish(bool reboot);
|
||||
#endif /* SERIAL_FLASHER_INTERFACE_UART */
|
||||
|
||||
|
||||
/**
|
||||
* @brief Initiates mem operation, initiates loading for program into target RAM
|
||||
*
|
||||
* @param offset[in] Address from which mem operation will be performed.
|
||||
* @param size[in] Size of the whole binary to be loaded into mem.
|
||||
* @param block_size[in] Size of buffer used in subsequent calls to esp_loader_mem_write.
|
||||
*
|
||||
* @note image_size is size of the whole image, whereas, block_size is chunk of data sent
|
||||
* to the target, each time esp_mem_flash_write function is called.
|
||||
*
|
||||
* @return
|
||||
* - ESP_LOADER_SUCCESS Success
|
||||
* - ESP_LOADER_ERROR_TIMEOUT Timeout
|
||||
* - ESP_LOADER_ERROR_INVALID_RESPONSE Internal error
|
||||
*/
|
||||
esp_loader_error_t esp_loader_mem_start(uint32_t offset, uint32_t size, uint32_t block_size);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Writes supplied data to target's mem memory.
|
||||
*
|
||||
* @param payload[in] Data to be loaded into target's memory.
|
||||
* @param size[in] Size of data in bytes.
|
||||
*
|
||||
* @note size must not be greater that block_size supplied to previously called
|
||||
* esp_loader_mem_start function.
|
||||
* Therefore, size of data buffer has to be equal or greater than block_size.
|
||||
*
|
||||
* @return
|
||||
* - ESP_LOADER_SUCCESS Success
|
||||
* - ESP_LOADER_ERROR_TIMEOUT Timeout
|
||||
* - ESP_LOADER_ERROR_INVALID_RESPONSE Internal error
|
||||
*/
|
||||
esp_loader_error_t esp_loader_mem_write(const void *payload, uint32_t size);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Ends mem operation, finish loading for program into target RAM
|
||||
* and send the entrypoint of ram_loadable app
|
||||
*
|
||||
* @param entrypoint[in] entrypoint of ram program.
|
||||
*
|
||||
* @return
|
||||
* - ESP_LOADER_SUCCESS Success
|
||||
* - ESP_LOADER_ERROR_TIMEOUT Timeout
|
||||
* - ESP_LOADER_ERROR_INVALID_RESPONSE Internal error
|
||||
*/
|
||||
esp_loader_error_t esp_loader_mem_finish(uint32_t entrypoint);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Writes register.
|
||||
*
|
||||
* @param address[in] Address of register.
|
||||
* @param reg_value[in] New register value.
|
||||
*
|
||||
* @return
|
||||
* - ESP_LOADER_SUCCESS Success
|
||||
* - ESP_LOADER_ERROR_TIMEOUT Timeout
|
||||
* - ESP_LOADER_ERROR_INVALID_RESPONSE Internal error
|
||||
*/
|
||||
esp_loader_error_t esp_loader_write_register(uint32_t address, uint32_t reg_value);
|
||||
|
||||
/**
|
||||
* @brief Reads register.
|
||||
*
|
||||
* @param address[in] Address of register.
|
||||
* @param reg_value[out] Register value.
|
||||
*
|
||||
* @return
|
||||
* - ESP_LOADER_SUCCESS Success
|
||||
* - ESP_LOADER_ERROR_TIMEOUT Timeout
|
||||
* - ESP_LOADER_ERROR_INVALID_RESPONSE Internal error
|
||||
*/
|
||||
esp_loader_error_t esp_loader_read_register(uint32_t address, uint32_t *reg_value);
|
||||
|
||||
/**
|
||||
* @brief Change baud rate.
|
||||
*
|
||||
* @note Baud rate has to be also adjusted accordingly on host MCU, as
|
||||
* target's baud rate is changed upon return from this function.
|
||||
*
|
||||
* @param transmission_rate[in] new baud rate to be set.
|
||||
*
|
||||
* @return
|
||||
* - ESP_LOADER_SUCCESS Success
|
||||
* - ESP_LOADER_ERROR_TIMEOUT Timeout
|
||||
* - ESP_LOADER_ERROR_INVALID_RESPONSE Internal error
|
||||
* - ESP_LOADER_ERROR_UNSUPPORTED_FUNC Unsupported on the target
|
||||
*/
|
||||
esp_loader_error_t esp_loader_change_transmission_rate(uint32_t transmission_rate);
|
||||
|
||||
/**
|
||||
* @brief Verify target's flash integrity by checking MD5.
|
||||
* MD5 checksum is computed from data pushed to target's memory by calling
|
||||
* esp_loader_flash_write() function and compared against target's MD5.
|
||||
* Target computes checksum based on offset and image_size passed to
|
||||
* esp_loader_flash_start() function.
|
||||
*
|
||||
* @note This function is only available if MD5_ENABLED is set.
|
||||
*
|
||||
* @return
|
||||
* - ESP_LOADER_SUCCESS Success
|
||||
* - ESP_LOADER_ERROR_INVALID_MD5 MD5 does not match
|
||||
* - ESP_LOADER_ERROR_TIMEOUT Timeout
|
||||
* - ESP_LOADER_ERROR_INVALID_RESPONSE Internal error
|
||||
* - ESP_LOADER_ERROR_UNSUPPORTED_FUNC Unsupported on the target
|
||||
*/
|
||||
#if MD5_ENABLED
|
||||
esp_loader_error_t esp_loader_flash_verify(void);
|
||||
#endif
|
||||
/**
|
||||
* @brief Toggles reset pin.
|
||||
*/
|
||||
void esp_loader_reset_target(void);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
112
applications/external/esp_flasher/lib/esp-serial-flasher/include/esp_loader_io.h
vendored
Normal file
112
applications/external/esp_flasher/lib/esp-serial-flasher/include/esp_loader_io.h
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include "esp_loader.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Changes the transmission rate of the used peripheral.
|
||||
*/
|
||||
esp_loader_error_t loader_port_change_transmission_rate(uint32_t transmission_rate);
|
||||
|
||||
/**
|
||||
* @brief Writes data over the io interface.
|
||||
*
|
||||
* @param data[in] Buffer with data to be written.
|
||||
* @param size[in] Size of data in bytes.
|
||||
* @param timeout[in] Timeout in milliseconds.
|
||||
*
|
||||
* @return
|
||||
* - ESP_LOADER_SUCCESS Success
|
||||
* - ESP_LOADER_ERROR_TIMEOUT Timeout elapsed
|
||||
*/
|
||||
esp_loader_error_t loader_port_write(const uint8_t *data, uint16_t size, uint32_t timeout);
|
||||
|
||||
/**
|
||||
* @brief Reads data from the io interface.
|
||||
*
|
||||
* @param data[out] Buffer into which received data will be written.
|
||||
* @param size[in] Number of bytes to read.
|
||||
* @param timeout[in] Timeout in milliseconds.
|
||||
*
|
||||
* @return
|
||||
* - ESP_LOADER_SUCCESS Success
|
||||
* - ESP_LOADER_ERROR_TIMEOUT Timeout elapsed
|
||||
*/
|
||||
esp_loader_error_t loader_port_read(uint8_t *data, uint16_t size, uint32_t timeout);
|
||||
|
||||
/**
|
||||
* @brief Delay in milliseconds.
|
||||
*
|
||||
* @param ms[in] Number of milliseconds.
|
||||
*
|
||||
*/
|
||||
void loader_port_delay_ms(uint32_t ms);
|
||||
|
||||
/**
|
||||
* @brief Starts timeout timer.
|
||||
*
|
||||
* @param ms[in] Number of milliseconds.
|
||||
*
|
||||
*/
|
||||
void loader_port_start_timer(uint32_t ms);
|
||||
|
||||
/**
|
||||
* @brief Returns remaining time since timer was started by calling esp_loader_start_timer.
|
||||
* 0 if timer has elapsed.
|
||||
*
|
||||
* @return Number of milliseconds.
|
||||
*
|
||||
*/
|
||||
uint32_t loader_port_remaining_time(void);
|
||||
|
||||
/**
|
||||
* @brief Asserts bootstrap pins to enter boot mode and toggles reset pin.
|
||||
*
|
||||
* @note Reset pin should stay asserted for at least 20 milliseconds.
|
||||
*/
|
||||
void loader_port_enter_bootloader(void);
|
||||
|
||||
/**
|
||||
* @brief Toggles reset pin.
|
||||
*
|
||||
* @note Reset pin should stay asserted for at least 20 milliseconds.
|
||||
*/
|
||||
void loader_port_reset_target(void);
|
||||
|
||||
/**
|
||||
* @brief Function can be defined by user to print debug message.
|
||||
*
|
||||
* @note Empty weak function is used, otherwise.
|
||||
*
|
||||
*/
|
||||
void loader_port_debug_print(const char *str);
|
||||
|
||||
#ifdef SERIAL_FLASHER_INTERFACE_SPI
|
||||
/**
|
||||
* @brief Sets the chip select to a defined level
|
||||
*/
|
||||
void loader_port_spi_set_cs(uint32_t level);
|
||||
#endif /* SERIAL_FLASHER_INTERFACE_SPI */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
24
applications/external/esp_flasher/lib/esp-serial-flasher/include/serial_io.h
vendored
Normal file
24
applications/external/esp_flasher/lib/esp-serial-flasher/include/serial_io.h
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#warning Please replace serial_io.h with esp_loader_io.h and change the function names \
|
||||
to match the new API
|
||||
|
||||
/* Defines used to avoid breaking existing ports */
|
||||
#define loader_port_change_baudrate loader_port_change_transmission_rate
|
||||
#define loader_port_serial_write loader_port_write
|
||||
#define loader_port_serial_read loader_port_read
|
||||
|
||||
#include "esp_loader_io.h"
|
||||
181
applications/external/esp_flasher/lib/esp-serial-flasher/port/esp32_port.c
vendored
Normal file
181
applications/external/esp_flasher/lib/esp-serial-flasher/port/esp32_port.c
vendored
Normal file
@@ -0,0 +1,181 @@
|
||||
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "esp32_port.h"
|
||||
#include "driver/uart.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "esp_timer.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_idf_version.h"
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef SERIAL_FLASHER_DEBUG_TRACE
|
||||
static void transfer_debug_print(const uint8_t *data, uint16_t size, bool write)
|
||||
{
|
||||
static bool write_prev = false;
|
||||
|
||||
if (write_prev != write) {
|
||||
write_prev = write;
|
||||
printf("\n--- %s ---\n", write ? "WRITE" : "READ");
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < size; i++) {
|
||||
printf("%02x ", data[i]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static int64_t s_time_end;
|
||||
static int32_t s_uart_port;
|
||||
static int32_t s_reset_trigger_pin;
|
||||
static int32_t s_gpio0_trigger_pin;
|
||||
|
||||
esp_loader_error_t loader_port_esp32_init(const loader_esp32_config_t *config)
|
||||
{
|
||||
s_uart_port = config->uart_port;
|
||||
s_reset_trigger_pin = config->reset_trigger_pin;
|
||||
s_gpio0_trigger_pin = config->gpio0_trigger_pin;
|
||||
|
||||
// Initialize UART
|
||||
uart_config_t uart_config = {
|
||||
.baud_rate = config->baud_rate,
|
||||
.data_bits = UART_DATA_8_BITS,
|
||||
.parity = UART_PARITY_DISABLE,
|
||||
.stop_bits = UART_STOP_BITS_1,
|
||||
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
|
||||
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
|
||||
.source_clk = UART_SCLK_DEFAULT,
|
||||
#endif
|
||||
};
|
||||
|
||||
int rx_buffer_size = config->rx_buffer_size ? config->rx_buffer_size : 400;
|
||||
int tx_buffer_size = config->tx_buffer_size ? config->tx_buffer_size : 400;
|
||||
QueueHandle_t *uart_queue = config->uart_queue ? config->uart_queue : NULL;
|
||||
int queue_size = config->queue_size ? config->queue_size : 0;
|
||||
|
||||
if ( uart_param_config(s_uart_port, &uart_config) != ESP_OK ) {
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
}
|
||||
if ( uart_set_pin(s_uart_port, config->uart_tx_pin, config->uart_rx_pin, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE) != ESP_OK ) {
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
}
|
||||
if ( uart_driver_install(s_uart_port, rx_buffer_size, tx_buffer_size, queue_size, uart_queue, 0) != ESP_OK ) {
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
}
|
||||
|
||||
// Initialize boot pin selection pins
|
||||
gpio_reset_pin(s_reset_trigger_pin);
|
||||
gpio_set_pull_mode(s_reset_trigger_pin, GPIO_PULLUP_ONLY);
|
||||
gpio_set_direction(s_reset_trigger_pin, GPIO_MODE_OUTPUT);
|
||||
|
||||
gpio_reset_pin(s_gpio0_trigger_pin);
|
||||
gpio_set_pull_mode(s_gpio0_trigger_pin, GPIO_PULLUP_ONLY);
|
||||
gpio_set_direction(s_gpio0_trigger_pin, GPIO_MODE_OUTPUT);
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
void loader_port_esp32_deinit(void)
|
||||
{
|
||||
uart_driver_delete(s_uart_port);
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t loader_port_write(const uint8_t *data, uint16_t size, uint32_t timeout)
|
||||
{
|
||||
uart_write_bytes(s_uart_port, (const char *)data, size);
|
||||
esp_err_t err = uart_wait_tx_done(s_uart_port, pdMS_TO_TICKS(timeout));
|
||||
|
||||
if (err == ESP_OK) {
|
||||
#ifdef SERIAL_FLASHER_DEBUG_TRACE
|
||||
transfer_debug_print(data, size, true);
|
||||
#endif
|
||||
return ESP_LOADER_SUCCESS;
|
||||
} else if (err == ESP_ERR_TIMEOUT) {
|
||||
return ESP_LOADER_ERROR_TIMEOUT;
|
||||
} else {
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t loader_port_read(uint8_t *data, uint16_t size, uint32_t timeout)
|
||||
{
|
||||
int read = uart_read_bytes(s_uart_port, data, size, pdMS_TO_TICKS(timeout));
|
||||
|
||||
if (read < 0) {
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
} else if (read < size) {
|
||||
#ifdef SERIAL_FLASHER_DEBUG_TRACE
|
||||
transfer_debug_print(data, read, false);
|
||||
#endif
|
||||
return ESP_LOADER_ERROR_TIMEOUT;
|
||||
} else {
|
||||
#ifdef SERIAL_FLASHER_DEBUG_TRACE
|
||||
transfer_debug_print(data, read, false);
|
||||
#endif
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Set GPIO0 LOW, then
|
||||
// assert reset pin for 50 milliseconds.
|
||||
void loader_port_enter_bootloader(void)
|
||||
{
|
||||
gpio_set_level(s_gpio0_trigger_pin, 0);
|
||||
loader_port_reset_target();
|
||||
loader_port_delay_ms(SERIAL_FLASHER_BOOT_HOLD_TIME_MS);
|
||||
gpio_set_level(s_gpio0_trigger_pin, 1);
|
||||
}
|
||||
|
||||
|
||||
void loader_port_reset_target(void)
|
||||
{
|
||||
gpio_set_level(s_reset_trigger_pin, 0);
|
||||
loader_port_delay_ms(SERIAL_FLASHER_RESET_HOLD_TIME_MS);
|
||||
gpio_set_level(s_reset_trigger_pin, 1);
|
||||
}
|
||||
|
||||
|
||||
void loader_port_delay_ms(uint32_t ms)
|
||||
{
|
||||
usleep(ms * 1000);
|
||||
}
|
||||
|
||||
|
||||
void loader_port_start_timer(uint32_t ms)
|
||||
{
|
||||
s_time_end = esp_timer_get_time() + ms * 1000;
|
||||
}
|
||||
|
||||
|
||||
uint32_t loader_port_remaining_time(void)
|
||||
{
|
||||
int64_t remaining = (s_time_end - esp_timer_get_time()) / 1000;
|
||||
return (remaining > 0) ? (uint32_t)remaining : 0;
|
||||
}
|
||||
|
||||
|
||||
void loader_port_debug_print(const char *str)
|
||||
{
|
||||
printf("DEBUG: %s\n", str);
|
||||
}
|
||||
|
||||
esp_loader_error_t loader_port_change_transmission_rate(uint32_t baudrate)
|
||||
{
|
||||
esp_err_t err = uart_set_baudrate(s_uart_port, baudrate);
|
||||
return (err == ESP_OK) ? ESP_LOADER_SUCCESS : ESP_LOADER_ERROR_FAIL;
|
||||
}
|
||||
59
applications/external/esp_flasher/lib/esp-serial-flasher/port/esp32_port.h
vendored
Normal file
59
applications/external/esp_flasher/lib/esp-serial-flasher/port/esp32_port.h
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "esp_loader_io.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/queue.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t baud_rate; /*!< Initial baud rate, can be changed later */
|
||||
uint32_t uart_port; /*!< UART port */
|
||||
uint32_t uart_rx_pin; /*!< This pin will be configured as UART Rx pin */
|
||||
uint32_t uart_tx_pin; /*!< This pin will be configured as UART Tx pin */
|
||||
uint32_t reset_trigger_pin; /*!< This pin will be used to reset target chip */
|
||||
uint32_t gpio0_trigger_pin; /*!< This pin will be used to toggle set IO0 of target chip */
|
||||
uint32_t rx_buffer_size; /*!< Set to zero for default RX buffer size */
|
||||
uint32_t tx_buffer_size; /*!< Set to zero for default TX buffer size */
|
||||
uint32_t queue_size; /*!< Set to zero for default UART queue size */
|
||||
QueueHandle_t *uart_queue; /*!< Set to NULL, if UART queue handle is not
|
||||
necessary. Otherwise, it will be assigned here */
|
||||
} loader_esp32_config_t;
|
||||
|
||||
/**
|
||||
* @brief Initializes serial interface.
|
||||
*
|
||||
* @param baud_rate[in] Communication speed.
|
||||
*
|
||||
* @return
|
||||
* - ESP_LOADER_SUCCESS Success
|
||||
* - ESP_LOADER_ERROR_FAIL Initialization failure
|
||||
*/
|
||||
esp_loader_error_t loader_port_esp32_init(const loader_esp32_config_t *config);
|
||||
|
||||
/**
|
||||
* @brief Deinitialize serial interface.
|
||||
*/
|
||||
void loader_port_esp32_deinit(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
298
applications/external/esp_flasher/lib/esp-serial-flasher/port/esp32_spi_port.c
vendored
Normal file
298
applications/external/esp_flasher/lib/esp-serial-flasher/port/esp32_spi_port.c
vendored
Normal file
@@ -0,0 +1,298 @@
|
||||
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "esp32_spi_port.h"
|
||||
#include "esp_log.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "esp_timer.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_idf_version.h"
|
||||
#include <unistd.h>
|
||||
|
||||
// #define SERIAL_DEBUG_ENABLE
|
||||
|
||||
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 0)
|
||||
#define DMA_CHAN SPI_DMA_CH_AUTO
|
||||
#else
|
||||
#define DMA_CHAN 1
|
||||
#endif
|
||||
|
||||
#define WORD_ALIGNED(ptr) ((size_t)ptr % sizeof(size_t) == 0)
|
||||
|
||||
#ifdef SERIAL_DEBUG_ENABLE
|
||||
|
||||
static void dec_to_hex_str(const uint8_t dec, uint8_t hex_str[3])
|
||||
{
|
||||
static const uint8_t dec_to_hex[] = {
|
||||
'0', '1', '2', '3', '4', '5', '6', '7',
|
||||
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
|
||||
};
|
||||
|
||||
hex_str[0] = dec_to_hex[dec >> 4];
|
||||
hex_str[1] = dec_to_hex[dec & 0xF];
|
||||
hex_str[2] = '\0';
|
||||
}
|
||||
|
||||
static void serial_debug_print(const uint8_t *data, uint16_t size, bool write)
|
||||
{
|
||||
static bool write_prev = false;
|
||||
uint8_t hex_str[3];
|
||||
|
||||
if(write_prev != write) {
|
||||
write_prev = write;
|
||||
printf("\n--- %s ---\n", write ? "WRITE" : "READ");
|
||||
}
|
||||
|
||||
for(uint32_t i = 0; i < size; i++) {
|
||||
dec_to_hex_str(data[i], hex_str);
|
||||
printf("%s ", hex_str);
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
static void serial_debug_print(const uint8_t *data, uint16_t size, bool write) { }
|
||||
#endif
|
||||
|
||||
static spi_host_device_t s_spi_bus;
|
||||
static spi_bus_config_t s_spi_config;
|
||||
static spi_device_handle_t s_device_h;
|
||||
static spi_device_interface_config_t s_device_config;
|
||||
static int64_t s_time_end;
|
||||
static uint32_t s_reset_trigger_pin;
|
||||
static uint32_t s_strap_bit0_pin;
|
||||
static uint32_t s_strap_bit1_pin;
|
||||
static uint32_t s_strap_bit2_pin;
|
||||
static uint32_t s_strap_bit3_pin;
|
||||
static uint32_t s_spi_cs_pin;
|
||||
|
||||
esp_loader_error_t loader_port_esp32_spi_init(const loader_esp32_spi_config_t *config)
|
||||
{
|
||||
/* Initialize the global static variables*/
|
||||
s_spi_bus = config->spi_bus;
|
||||
s_reset_trigger_pin = config->reset_trigger_pin;
|
||||
s_strap_bit0_pin = config->strap_bit0_pin;
|
||||
s_strap_bit1_pin = config->strap_bit1_pin;
|
||||
s_strap_bit2_pin = config->strap_bit2_pin;
|
||||
s_strap_bit3_pin = config->strap_bit3_pin;
|
||||
s_spi_cs_pin = config->spi_cs_pin;
|
||||
|
||||
/* Configure and initialize the SPI bus*/
|
||||
s_spi_config.mosi_io_num = config->spi_mosi_pin;
|
||||
s_spi_config.miso_io_num = config->spi_miso_pin;
|
||||
s_spi_config.sclk_io_num = config->spi_clk_pin;
|
||||
s_spi_config.quadwp_io_num = config->spi_quadwp_pin;
|
||||
s_spi_config.quadhd_io_num = config->spi_quadhd_pin;
|
||||
s_spi_config.max_transfer_sz = 4096 * 4;
|
||||
|
||||
if (spi_bus_initialize(s_spi_bus, &s_spi_config, DMA_CHAN) != ESP_OK) {
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
}
|
||||
|
||||
/* Configure and add the device */
|
||||
s_device_config.clock_speed_hz = config->frequency;
|
||||
s_device_config.spics_io_num = -1; /* We're using the chip select pin as GPIO as we need to
|
||||
chain multiple transactions with CS pulled down */
|
||||
s_device_config.flags = SPI_DEVICE_HALFDUPLEX;
|
||||
s_device_config.queue_size = 16;
|
||||
|
||||
if (spi_bus_add_device(s_spi_bus, &s_device_config, &s_device_h) != ESP_OK) {
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
}
|
||||
|
||||
/* Initialize the pins except for the strapping ones */
|
||||
gpio_reset_pin(s_reset_trigger_pin);
|
||||
gpio_set_pull_mode(s_reset_trigger_pin, GPIO_PULLUP_ONLY);
|
||||
gpio_set_direction(s_reset_trigger_pin, GPIO_MODE_OUTPUT);
|
||||
gpio_set_level(s_reset_trigger_pin, 1);
|
||||
|
||||
gpio_reset_pin(s_spi_cs_pin);
|
||||
gpio_set_pull_mode(s_spi_cs_pin, GPIO_PULLUP_ONLY);
|
||||
gpio_set_direction(s_spi_cs_pin, GPIO_MODE_OUTPUT);
|
||||
gpio_set_level(s_spi_cs_pin, 1);
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
void loader_port_esp32_spi_deinit(void)
|
||||
{
|
||||
gpio_reset_pin(s_reset_trigger_pin);
|
||||
gpio_reset_pin(s_spi_cs_pin);
|
||||
spi_bus_remove_device(s_device_h);
|
||||
spi_bus_free(s_spi_bus);
|
||||
}
|
||||
|
||||
|
||||
void loader_port_spi_set_cs(const uint32_t level) {
|
||||
gpio_set_level(s_spi_cs_pin, level);
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t loader_port_write(const uint8_t *data, const uint16_t size, const uint32_t timeout)
|
||||
{
|
||||
/* Due to the fact that the SPI driver uses DMA for larger transfers,
|
||||
and the DMA requirements, the buffer must be word aligned */
|
||||
if (data == NULL || !WORD_ALIGNED(data)) {
|
||||
return ESP_LOADER_ERROR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
serial_debug_print(data, size, true);
|
||||
|
||||
spi_transaction_t transaction = {
|
||||
.tx_buffer = data,
|
||||
.rx_buffer = NULL,
|
||||
.length = size * 8U,
|
||||
.rxlength = 0,
|
||||
};
|
||||
|
||||
esp_err_t err = spi_device_transmit(s_device_h, &transaction);
|
||||
|
||||
if (err == ESP_OK) {
|
||||
serial_debug_print(data, size, false);
|
||||
return ESP_LOADER_SUCCESS;
|
||||
} else if (err == ESP_ERR_TIMEOUT) {
|
||||
return ESP_LOADER_ERROR_TIMEOUT;
|
||||
} else {
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t loader_port_read(uint8_t *data, const uint16_t size, const uint32_t timeout)
|
||||
{
|
||||
/* Due to the fact that the SPI driver uses DMA for larger transfers,
|
||||
and the DMA requirements, the buffer must be word aligned */
|
||||
if (data == NULL || !WORD_ALIGNED(data)) {
|
||||
return ESP_LOADER_ERROR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
serial_debug_print(data, size, true);
|
||||
|
||||
spi_transaction_t transaction = {
|
||||
.tx_buffer = NULL,
|
||||
.rx_buffer = data,
|
||||
.rxlength = size * 8,
|
||||
};
|
||||
|
||||
esp_err_t err = spi_device_transmit(s_device_h, &transaction);
|
||||
|
||||
if (err == ESP_OK) {
|
||||
serial_debug_print(data, size, false);
|
||||
return ESP_LOADER_SUCCESS;
|
||||
} else if (err == ESP_ERR_TIMEOUT) {
|
||||
return ESP_LOADER_ERROR_TIMEOUT;
|
||||
} else {
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void loader_port_enter_bootloader(void)
|
||||
{
|
||||
/*
|
||||
We have to initialize the GPIO pins for the target strapping pins here,
|
||||
as they may overlap with target SPI pins.
|
||||
For instance in the case of ESP32C3 MISO and strapping bit 0 pins overlap.
|
||||
*/
|
||||
spi_bus_remove_device(s_device_h);
|
||||
spi_bus_free(s_spi_bus);
|
||||
|
||||
gpio_reset_pin(s_strap_bit0_pin);
|
||||
gpio_set_pull_mode(s_strap_bit0_pin, GPIO_PULLUP_ONLY);
|
||||
gpio_set_direction(s_strap_bit0_pin, GPIO_MODE_OUTPUT);
|
||||
|
||||
gpio_reset_pin(s_strap_bit1_pin);
|
||||
gpio_set_pull_mode(s_strap_bit1_pin, GPIO_PULLUP_ONLY);
|
||||
gpio_set_direction(s_strap_bit1_pin, GPIO_MODE_OUTPUT);
|
||||
|
||||
gpio_reset_pin(s_strap_bit2_pin);
|
||||
gpio_set_pull_mode(s_strap_bit2_pin, GPIO_PULLUP_ONLY);
|
||||
gpio_set_direction(s_strap_bit2_pin, GPIO_MODE_OUTPUT);
|
||||
|
||||
gpio_reset_pin(s_strap_bit3_pin);
|
||||
gpio_set_pull_mode(s_strap_bit3_pin, GPIO_PULLUP_ONLY);
|
||||
gpio_set_direction(s_strap_bit3_pin, GPIO_MODE_OUTPUT);
|
||||
|
||||
/* Set the strapping pins and perform the reset sequence */
|
||||
gpio_set_level(s_strap_bit0_pin, 1);
|
||||
gpio_set_level(s_strap_bit1_pin, 0);
|
||||
gpio_set_level(s_strap_bit2_pin, 0);
|
||||
gpio_set_level(s_strap_bit3_pin, 0);
|
||||
loader_port_reset_target();
|
||||
loader_port_delay_ms(SERIAL_FLASHER_BOOT_HOLD_TIME_MS);
|
||||
gpio_set_level(s_strap_bit3_pin, 1);
|
||||
gpio_set_level(s_strap_bit0_pin, 0);
|
||||
|
||||
/* Disable the strapping pins so they can be used by the slave later */
|
||||
gpio_reset_pin(s_strap_bit0_pin);
|
||||
gpio_reset_pin(s_strap_bit1_pin);
|
||||
gpio_reset_pin(s_strap_bit2_pin);
|
||||
gpio_reset_pin(s_strap_bit3_pin);
|
||||
|
||||
/* Restore the SPI bus pins */
|
||||
spi_bus_initialize(s_spi_bus, &s_spi_config, DMA_CHAN);
|
||||
spi_bus_add_device(s_spi_bus, &s_device_config, &s_device_h);
|
||||
}
|
||||
|
||||
|
||||
void loader_port_reset_target(void)
|
||||
{
|
||||
gpio_set_level(s_reset_trigger_pin, 0);
|
||||
loader_port_delay_ms(SERIAL_FLASHER_RESET_HOLD_TIME_MS);
|
||||
gpio_set_level(s_reset_trigger_pin, 1);
|
||||
}
|
||||
|
||||
|
||||
void loader_port_delay_ms(const uint32_t ms)
|
||||
{
|
||||
usleep(ms * 1000);
|
||||
}
|
||||
|
||||
|
||||
void loader_port_start_timer(const uint32_t ms)
|
||||
{
|
||||
s_time_end = esp_timer_get_time() + ms * 1000;
|
||||
}
|
||||
|
||||
|
||||
uint32_t loader_port_remaining_time(void)
|
||||
{
|
||||
int64_t remaining = (s_time_end - esp_timer_get_time()) / 1000;
|
||||
return (remaining > 0) ? (uint32_t)remaining : 0;
|
||||
}
|
||||
|
||||
|
||||
void loader_port_debug_print(const char *str)
|
||||
{
|
||||
printf("DEBUG: %s\n", str);
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t loader_port_change_transmission_rate(const uint32_t frequency)
|
||||
{
|
||||
if (spi_bus_remove_device(s_device_h) != ESP_OK) {
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
}
|
||||
|
||||
uint32_t old_frequency = s_device_config.clock_speed_hz;
|
||||
s_device_config.clock_speed_hz = frequency;
|
||||
|
||||
if (spi_bus_add_device(s_spi_bus, &s_device_config, &s_device_h) != ESP_OK) {
|
||||
s_device_config.clock_speed_hz = old_frequency;
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
}
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
60
applications/external/esp_flasher/lib/esp-serial-flasher/port/esp32_spi_port.h
vendored
Normal file
60
applications/external/esp_flasher/lib/esp-serial-flasher/port/esp32_spi_port.h
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "esp_loader_io.h"
|
||||
#include "driver/spi_master.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
spi_host_device_t spi_bus;
|
||||
uint32_t frequency;
|
||||
uint32_t spi_clk_pin;
|
||||
uint32_t spi_miso_pin;
|
||||
uint32_t spi_mosi_pin;
|
||||
uint32_t spi_cs_pin;
|
||||
uint32_t spi_quadwp_pin;
|
||||
uint32_t spi_quadhd_pin;
|
||||
uint32_t reset_trigger_pin;
|
||||
uint32_t strap_bit0_pin;
|
||||
uint32_t strap_bit1_pin;
|
||||
uint32_t strap_bit2_pin;
|
||||
uint32_t strap_bit3_pin;
|
||||
} loader_esp32_spi_config_t;
|
||||
|
||||
/**
|
||||
* @brief Initializes the SPI interface.
|
||||
*
|
||||
* @param config[in] Configuration structure
|
||||
*
|
||||
* @return
|
||||
* - ESP_LOADER_SUCCESS Success
|
||||
* - ESP_LOADER_ERROR_FAIL Initialization failure
|
||||
*/
|
||||
esp_loader_error_t loader_port_esp32_spi_init(const loader_esp32_spi_config_t *config);
|
||||
|
||||
/**
|
||||
* @brief Deinitializes the SPI interface.
|
||||
*/
|
||||
void loader_port_esp32_spi_deinit(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
302
applications/external/esp_flasher/lib/esp-serial-flasher/port/raspberry_port.c
vendored
Normal file
302
applications/external/esp_flasher/lib/esp-serial-flasher/port/raspberry_port.c
vendored
Normal file
@@ -0,0 +1,302 @@
|
||||
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "esp_loader_io.h"
|
||||
#include "protocol.h"
|
||||
#include <pigpio.h>
|
||||
#include "raspberry_port.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <termios.h>
|
||||
#include <time.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <stdarg.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
#ifdef SERIAL_FLASHER_DEBUG_TRACE
|
||||
static void transfer_debug_print(const uint8_t *data, uint16_t size, bool write)
|
||||
{
|
||||
static bool write_prev = false;
|
||||
|
||||
if (write_prev != write) {
|
||||
write_prev = write;
|
||||
printf("\n--- %s ---\n", write ? "WRITE" : "READ");
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < size; i++) {
|
||||
printf("%02x ", data[i]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static int serial;
|
||||
static int64_t s_time_end;
|
||||
static int32_t s_reset_trigger_pin;
|
||||
static int32_t s_gpio0_trigger_pin;
|
||||
|
||||
|
||||
static speed_t convert_baudrate(int baud)
|
||||
{
|
||||
switch (baud) {
|
||||
case 50: return B50;
|
||||
case 75: return B75;
|
||||
case 110: return B110;
|
||||
case 134: return B134;
|
||||
case 150: return B150;
|
||||
case 200: return B200;
|
||||
case 300: return B300;
|
||||
case 600: return B600;
|
||||
case 1200: return B1200;
|
||||
case 1800: return B1800;
|
||||
case 2400: return B2400;
|
||||
case 4800: return B4800;
|
||||
case 9600: return B9600;
|
||||
case 19200: return B19200;
|
||||
case 38400: return B38400;
|
||||
case 57600: return B57600;
|
||||
case 115200: return B115200;
|
||||
case 230400: return B230400;
|
||||
case 460800: return B460800;
|
||||
case 500000: return B500000;
|
||||
case 576000: return B576000;
|
||||
case 921600: return B921600;
|
||||
case 1000000: return B1000000;
|
||||
case 1152000: return B1152000;
|
||||
case 1500000: return B1500000;
|
||||
case 2000000: return B2000000;
|
||||
case 2500000: return B2500000;
|
||||
case 3000000: return B3000000;
|
||||
case 3500000: return B3500000;
|
||||
case 4000000: return B4000000;
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
|
||||
static int serialOpen (const char *device, uint32_t baudrate)
|
||||
{
|
||||
struct termios options;
|
||||
int status, fd;
|
||||
|
||||
if ((fd = open (device, O_RDWR | O_NOCTTY | O_NDELAY | O_NONBLOCK)) == -1) {
|
||||
printf("Error occured while opening serial port !\n");
|
||||
return -1 ;
|
||||
}
|
||||
|
||||
fcntl (fd, F_SETFL, O_RDWR) ;
|
||||
|
||||
// Get and modify current options:
|
||||
|
||||
tcgetattr (fd, &options);
|
||||
speed_t baud = convert_baudrate(baudrate);
|
||||
|
||||
if(baud < 0) {
|
||||
printf("Invalid baudrate!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
cfmakeraw (&options) ;
|
||||
cfsetispeed (&options, baud) ;
|
||||
cfsetospeed (&options, baud) ;
|
||||
|
||||
options.c_cflag |= (CLOCAL | CREAD) ;
|
||||
options.c_cflag &= ~(PARENB | CSTOPB | CSIZE) ;
|
||||
options.c_cflag |= CS8 ;
|
||||
options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG) ;
|
||||
options.c_oflag &= ~OPOST ;
|
||||
options.c_iflag &= ~(IXON | IXOFF | IXANY); // Turn off s/w flow ctrl
|
||||
options.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL); // Disable any special handling of received bytes
|
||||
|
||||
options.c_cc [VMIN] = 0 ;
|
||||
options.c_cc [VTIME] = 10 ; // 1 Second
|
||||
|
||||
tcsetattr (fd, TCSANOW, &options) ;
|
||||
|
||||
ioctl (fd, TIOCMGET, &status);
|
||||
|
||||
status |= TIOCM_DTR ;
|
||||
status |= TIOCM_RTS ;
|
||||
|
||||
ioctl (fd, TIOCMSET, &status);
|
||||
|
||||
usleep (10000) ; // 10mS
|
||||
|
||||
return fd ;
|
||||
}
|
||||
|
||||
static esp_loader_error_t change_baudrate(int file_desc, int baudrate)
|
||||
{
|
||||
struct termios options;
|
||||
speed_t baud = convert_baudrate(baudrate);
|
||||
|
||||
if(baud < 0) {
|
||||
return ESP_LOADER_ERROR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
tcgetattr (file_desc, &options);
|
||||
|
||||
cfmakeraw (&options) ;
|
||||
cfsetispeed (&options, baud);
|
||||
cfsetospeed (&options, baud);
|
||||
|
||||
tcsetattr (file_desc, TCSANOW, &options);
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
static void set_timeout(uint32_t timeout)
|
||||
{
|
||||
struct termios options;
|
||||
|
||||
timeout /= 100;
|
||||
timeout = MAX(timeout, 1);
|
||||
|
||||
tcgetattr(serial, &options);
|
||||
options.c_cc[VTIME] = timeout;
|
||||
tcsetattr(serial, TCSANOW, &options);
|
||||
}
|
||||
|
||||
static esp_loader_error_t read_char(char *c, uint32_t timeout)
|
||||
{
|
||||
set_timeout(timeout);
|
||||
int read_bytes = read(serial, c, 1);
|
||||
|
||||
if (read_bytes == 1) {
|
||||
return ESP_LOADER_SUCCESS;
|
||||
} else if (read_bytes == 0) {
|
||||
return ESP_LOADER_ERROR_TIMEOUT;
|
||||
} else {
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
static esp_loader_error_t read_data(char *buffer, uint32_t size)
|
||||
{
|
||||
for (int i = 0; i < size; i++) {
|
||||
uint32_t remaining_time = loader_port_remaining_time();
|
||||
RETURN_ON_ERROR( read_char(&buffer[i], remaining_time) );
|
||||
}
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
esp_loader_error_t loader_port_raspberry_init(const loader_raspberry_config_t *config)
|
||||
{
|
||||
s_reset_trigger_pin = config->reset_trigger_pin;
|
||||
s_gpio0_trigger_pin = config->gpio0_trigger_pin;
|
||||
|
||||
serial = serialOpen(config->device, config->baudrate);
|
||||
if (serial < 0) {
|
||||
printf("Serial port could not be opened!\n");
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
}
|
||||
|
||||
if (gpioInitialise() < 0) {
|
||||
printf("pigpio initialisation failed\n");
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
}
|
||||
|
||||
gpioSetMode(config->reset_trigger_pin, PI_OUTPUT);
|
||||
gpioSetMode(config->gpio0_trigger_pin, PI_OUTPUT);
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t loader_port_write(const uint8_t *data, uint16_t size, uint32_t timeout)
|
||||
{
|
||||
int written = write(serial, data, size);
|
||||
|
||||
if (written < 0) {
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
} else if (written < size) {
|
||||
#ifdef SERIAL_FLASHER_DEBUG_TRACE
|
||||
transfer_debug_print(data, written, true);
|
||||
#endif
|
||||
return ESP_LOADER_ERROR_TIMEOUT;
|
||||
} else {
|
||||
#ifdef SERIAL_FLASHER_DEBUG_TRACE
|
||||
transfer_debug_print(data, written, true);
|
||||
#endif
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t loader_port_read(uint8_t *data, uint16_t size, uint32_t timeout)
|
||||
{
|
||||
RETURN_ON_ERROR( read_data(data, size) );
|
||||
|
||||
#ifdef SERIAL_FLASHER_DEBUG_TRACE
|
||||
transfer_debug_print(data, size, false);
|
||||
#endif
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
// Set GPIO0 LOW, then assert reset pin for 50 milliseconds.
|
||||
void loader_port_enter_bootloader(void)
|
||||
{
|
||||
gpioWrite(s_gpio0_trigger_pin, 0);
|
||||
loader_port_reset_target();
|
||||
loader_port_delay_ms(SERIAL_FLASHER_BOOT_HOLD_TIME_MS);
|
||||
gpioWrite(s_gpio0_trigger_pin, 1);
|
||||
}
|
||||
|
||||
|
||||
void loader_port_reset_target(void)
|
||||
{
|
||||
gpioWrite(s_reset_trigger_pin, 0);
|
||||
loader_port_delay_ms(SERIAL_FLASHER_RESET_HOLD_TIME_MS);
|
||||
gpioWrite(s_reset_trigger_pin, 1);
|
||||
}
|
||||
|
||||
|
||||
void loader_port_delay_ms(uint32_t ms)
|
||||
{
|
||||
usleep(ms * 1000);
|
||||
}
|
||||
|
||||
|
||||
void loader_port_start_timer(uint32_t ms)
|
||||
{
|
||||
s_time_end = clock() + (ms * (CLOCKS_PER_SEC / 1000));
|
||||
}
|
||||
|
||||
|
||||
uint32_t loader_port_remaining_time(void)
|
||||
{
|
||||
int64_t remaining = (s_time_end - clock()) / 1000;
|
||||
return (remaining > 0) ? (uint32_t)remaining : 0;
|
||||
}
|
||||
|
||||
|
||||
void loader_port_debug_print(const char *str)
|
||||
{
|
||||
printf("DEBUG: %s\n", str);
|
||||
}
|
||||
|
||||
esp_loader_error_t loader_port_change_transmission_rate(uint32_t baudrate)
|
||||
{
|
||||
return change_baudrate(serial, baudrate);
|
||||
}
|
||||
36
applications/external/esp_flasher/lib/esp-serial-flasher/port/raspberry_port.h
vendored
Normal file
36
applications/external/esp_flasher/lib/esp-serial-flasher/port/raspberry_port.h
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include "esp_loader_io.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
const char *device;
|
||||
uint32_t baudrate;
|
||||
uint32_t reset_trigger_pin;
|
||||
uint32_t gpio0_trigger_pin;
|
||||
} loader_raspberry_config_t;
|
||||
|
||||
esp_loader_error_t loader_port_raspberry_init(const loader_raspberry_config_t *config);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
140
applications/external/esp_flasher/lib/esp-serial-flasher/port/stm32_port.c
vendored
Normal file
140
applications/external/esp_flasher/lib/esp-serial-flasher/port/stm32_port.c
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/param.h>
|
||||
#include <stdio.h>
|
||||
#include "stm32_port.h"
|
||||
|
||||
static UART_HandleTypeDef *uart;
|
||||
static GPIO_TypeDef* gpio_port_io0, *gpio_port_rst;
|
||||
static uint16_t gpio_num_io0, gpio_num_rst;
|
||||
|
||||
#ifdef SERIAL_FLASHER_DEBUG_TRACE
|
||||
static void transfer_debug_print(const uint8_t *data, uint16_t size, bool write)
|
||||
{
|
||||
static bool write_prev = false;
|
||||
|
||||
if (write_prev != write) {
|
||||
write_prev = write;
|
||||
printf("\n--- %s ---\n", write ? "WRITE" : "READ");
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < size; i++) {
|
||||
printf("%02x ", data[i]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static uint32_t s_time_end;
|
||||
|
||||
esp_loader_error_t loader_port_write(const uint8_t *data, uint16_t size, uint32_t timeout)
|
||||
{
|
||||
HAL_StatusTypeDef err = HAL_UART_Transmit(uart, (uint8_t *)data, size, timeout);
|
||||
|
||||
if (err == HAL_OK) {
|
||||
#ifdef SERIAL_FLASHER_DEBUG_TRACE
|
||||
transfer_debug_print(data, size, true);
|
||||
#endif
|
||||
return ESP_LOADER_SUCCESS;
|
||||
} else if (err == HAL_TIMEOUT) {
|
||||
return ESP_LOADER_ERROR_TIMEOUT;
|
||||
} else {
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t loader_port_read(uint8_t *data, uint16_t size, uint32_t timeout)
|
||||
{
|
||||
HAL_StatusTypeDef err = HAL_UART_Receive(uart, data, size, timeout);
|
||||
|
||||
if (err == HAL_OK) {
|
||||
#ifdef SERIAL_FLASHER_DEBUG_TRACE
|
||||
transfer_debug_print(data, size, false);
|
||||
#endif
|
||||
return ESP_LOADER_SUCCESS;
|
||||
} else if (err == HAL_TIMEOUT) {
|
||||
return ESP_LOADER_ERROR_TIMEOUT;
|
||||
} else {
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
void loader_port_stm32_init(loader_stm32_config_t *config)
|
||||
|
||||
{
|
||||
uart = config->huart;
|
||||
gpio_port_io0 = config->port_io0;
|
||||
gpio_port_rst = config->port_rst;
|
||||
gpio_num_io0 = config->pin_num_io0;
|
||||
gpio_num_rst = config->pin_num_rst;
|
||||
}
|
||||
|
||||
// Set GPIO0 LOW, then
|
||||
// assert reset pin for 100 milliseconds.
|
||||
void loader_port_enter_bootloader(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(gpio_port_io0, gpio_num_io0, GPIO_PIN_RESET);
|
||||
loader_port_reset_target();
|
||||
HAL_Delay(SERIAL_FLASHER_BOOT_HOLD_TIME_MS);
|
||||
HAL_GPIO_WritePin(gpio_port_io0, gpio_num_io0, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
|
||||
void loader_port_reset_target(void)
|
||||
{
|
||||
HAL_GPIO_WritePin(gpio_port_rst, gpio_num_rst, GPIO_PIN_RESET);
|
||||
HAL_Delay(SERIAL_FLASHER_RESET_HOLD_TIME_MS);
|
||||
HAL_GPIO_WritePin(gpio_port_rst, gpio_num_rst, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
|
||||
void loader_port_delay_ms(uint32_t ms)
|
||||
{
|
||||
HAL_Delay(ms);
|
||||
}
|
||||
|
||||
|
||||
void loader_port_start_timer(uint32_t ms)
|
||||
{
|
||||
s_time_end = HAL_GetTick() + ms;
|
||||
}
|
||||
|
||||
|
||||
uint32_t loader_port_remaining_time(void)
|
||||
{
|
||||
int32_t remaining = s_time_end - HAL_GetTick();
|
||||
return (remaining > 0) ? (uint32_t)remaining : 0;
|
||||
}
|
||||
|
||||
|
||||
void loader_port_debug_print(const char *str)
|
||||
{
|
||||
printf("DEBUG: %s", str);
|
||||
}
|
||||
|
||||
esp_loader_error_t loader_port_change_transmission_rate(uint32_t baudrate)
|
||||
{
|
||||
uart->Init.BaudRate = baudrate;
|
||||
|
||||
if( HAL_UART_Init(uart) != HAL_OK ) {
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
}
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
38
applications/external/esp_flasher/lib/esp-serial-flasher/port/stm32_port.h
vendored
Normal file
38
applications/external/esp_flasher/lib/esp-serial-flasher/port/stm32_port.h
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include "esp_loader_io.h"
|
||||
#include "stm32f4xx_hal.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
UART_HandleTypeDef *huart;
|
||||
GPIO_TypeDef *port_io0;
|
||||
uint16_t pin_num_io0;
|
||||
GPIO_TypeDef *port_rst;
|
||||
uint16_t pin_num_rst;
|
||||
} loader_stm32_config_t;
|
||||
|
||||
void loader_port_stm32_init(loader_stm32_config_t *config);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
170
applications/external/esp_flasher/lib/esp-serial-flasher/port/zephyr_port.c
vendored
Normal file
170
applications/external/esp_flasher/lib/esp-serial-flasher/port/zephyr_port.c
vendored
Normal file
@@ -0,0 +1,170 @@
|
||||
/*
|
||||
* Copyright (c) 2022 KT-Elektronik, Klaucke und Partner GmbH
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "zephyr_port.h"
|
||||
#include <zephyr/drivers/uart.h>
|
||||
#include <zephyr/console/tty.h>
|
||||
|
||||
static const struct device *uart_dev;
|
||||
static struct gpio_dt_spec enable_spec;
|
||||
static struct gpio_dt_spec boot_spec;
|
||||
|
||||
static struct tty_serial tty;
|
||||
static char tty_rx_buf[CONFIG_ESP_SERIAL_FLASHER_UART_BUFSIZE];
|
||||
static char tty_tx_buf[CONFIG_ESP_SERIAL_FLASHER_UART_BUFSIZE];
|
||||
|
||||
#ifdef SERIAL_FLASHER_DEBUG_TRACE
|
||||
static void transfer_debug_print(const uint8_t *data, uint16_t size, bool write)
|
||||
{
|
||||
static bool write_prev = false;
|
||||
|
||||
if (write_prev != write) {
|
||||
write_prev = write;
|
||||
printk("\n--- %s ---\n", write ? "WRITE" : "READ");
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < size; i++) {
|
||||
printk("%02x ", data[i]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
esp_loader_error_t configure_tty()
|
||||
{
|
||||
if (tty_init(&tty, uart_dev) < 0 ||
|
||||
tty_set_rx_buf(&tty, tty_rx_buf, sizeof(tty_rx_buf)) < 0 ||
|
||||
tty_set_tx_buf(&tty, tty_tx_buf, sizeof(tty_tx_buf)) < 0) {
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
}
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
esp_loader_error_t loader_port_read(uint8_t *data, const uint16_t size, const uint32_t timeout)
|
||||
{
|
||||
if (!device_is_ready(uart_dev) || data == NULL || size == 0) {
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
}
|
||||
|
||||
ssize_t total_read = 0;
|
||||
ssize_t remaining = size;
|
||||
|
||||
tty_set_rx_timeout(&tty, timeout);
|
||||
while (remaining > 0) {
|
||||
const uint16_t chunk_size = remaining < CONFIG_ESP_SERIAL_FLASHER_UART_BUFSIZE ?
|
||||
remaining : CONFIG_ESP_SERIAL_FLASHER_UART_BUFSIZE;
|
||||
ssize_t read = tty_read(&tty, &data[total_read], chunk_size);
|
||||
if (read < 0) {
|
||||
return ESP_LOADER_ERROR_TIMEOUT;
|
||||
}
|
||||
#ifdef SERIAL_FLASHER_DEBUG_TRACE
|
||||
transfer_debug_print(data, read, false);
|
||||
#endif
|
||||
total_read += read;
|
||||
remaining -= read;
|
||||
}
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
esp_loader_error_t loader_port_write(const uint8_t *data, const uint16_t size, const uint32_t timeout)
|
||||
{
|
||||
if (!device_is_ready(uart_dev) || data == NULL || size == 0) {
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
}
|
||||
|
||||
ssize_t total_written = 0;
|
||||
ssize_t remaining = size;
|
||||
|
||||
tty_set_tx_timeout(&tty, timeout);
|
||||
while (remaining > 0) {
|
||||
const uint16_t chunk_size = remaining < CONFIG_ESP_SERIAL_FLASHER_UART_BUFSIZE ?
|
||||
remaining : CONFIG_ESP_SERIAL_FLASHER_UART_BUFSIZE;
|
||||
ssize_t written = tty_write(&tty, &data[total_written], chunk_size);
|
||||
if (written < 0) {
|
||||
return ESP_LOADER_ERROR_TIMEOUT;
|
||||
}
|
||||
#ifdef SERIAL_FLASHER_DEBUG_TRACE
|
||||
transfer_debug_print(data, written, true);
|
||||
#endif
|
||||
total_written += written;
|
||||
remaining -= written;
|
||||
}
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
esp_loader_error_t loader_port_zephyr_init(const loader_zephyr_config_t *config)
|
||||
{
|
||||
uart_dev = config->uart_dev;
|
||||
enable_spec = config->enable_spec;
|
||||
boot_spec = config->boot_spec;
|
||||
return configure_tty();
|
||||
}
|
||||
|
||||
void loader_port_reset_target(void)
|
||||
{
|
||||
gpio_pin_set_dt(&enable_spec, false);
|
||||
loader_port_delay_ms(CONFIG_SERIAL_FLASHER_RESET_HOLD_TIME_MS);
|
||||
gpio_pin_set_dt(&enable_spec, true);
|
||||
}
|
||||
|
||||
void loader_port_enter_bootloader(void)
|
||||
{
|
||||
gpio_pin_set_dt(&boot_spec, false);
|
||||
loader_port_reset_target();
|
||||
loader_port_delay_ms(CONFIG_SERIAL_FLASHER_BOOT_HOLD_TIME_MS);
|
||||
gpio_pin_set_dt(&boot_spec, true);
|
||||
}
|
||||
|
||||
void loader_port_delay_ms(uint32_t ms)
|
||||
{
|
||||
k_msleep(ms);
|
||||
}
|
||||
|
||||
static uint64_t s_time_end;
|
||||
|
||||
void loader_port_start_timer(uint32_t ms)
|
||||
{
|
||||
s_time_end = sys_clock_timeout_end_calc(Z_TIMEOUT_MS(ms));
|
||||
}
|
||||
|
||||
uint32_t loader_port_remaining_time(void)
|
||||
{
|
||||
int64_t remaining = k_ticks_to_ms_floor64(s_time_end - k_uptime_ticks());
|
||||
return (remaining > 0) ? (uint32_t)remaining : 0;
|
||||
}
|
||||
|
||||
esp_loader_error_t loader_port_change_transmission_rate(uint32_t baudrate)
|
||||
{
|
||||
struct uart_config uart_config;
|
||||
|
||||
if (!device_is_ready(uart_dev)) {
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
}
|
||||
|
||||
if (uart_config_get(uart_dev, &uart_config) != 0) {
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
}
|
||||
uart_config.baudrate = baudrate;
|
||||
|
||||
if (uart_configure(uart_dev, &uart_config) != 0) {
|
||||
return ESP_LOADER_ERROR_FAIL;
|
||||
}
|
||||
|
||||
/* bitrate-change can require tty re-configuration */
|
||||
return configure_tty();
|
||||
}
|
||||
39
applications/external/esp_flasher/lib/esp-serial-flasher/port/zephyr_port.h
vendored
Normal file
39
applications/external/esp_flasher/lib/esp-serial-flasher/port/zephyr_port.h
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (c) 2022 KT-Elektronik, Klaucke und Partner GmbH
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "esp_loader_io.h"
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/drivers/gpio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
const struct device *uart_dev;
|
||||
const struct gpio_dt_spec enable_spec;
|
||||
const struct gpio_dt_spec boot_spec;
|
||||
} loader_zephyr_config_t;
|
||||
|
||||
esp_loader_error_t loader_port_zephyr_init(const loader_zephyr_config_t *config);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
33
applications/external/esp_flasher/lib/esp-serial-flasher/private_include/esp_targets.h
vendored
Normal file
33
applications/external/esp_flasher/lib/esp-serial-flasher/private_include/esp_targets.h
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
/* Copyright 2020 Espressif Systems (Shanghai) PTE LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include "esp_loader.h"
|
||||
|
||||
typedef struct {
|
||||
uint32_t cmd;
|
||||
uint32_t usr;
|
||||
uint32_t usr1;
|
||||
uint32_t usr2;
|
||||
uint32_t w0;
|
||||
uint32_t mosi_dlen;
|
||||
uint32_t miso_dlen;
|
||||
} target_registers_t;
|
||||
|
||||
esp_loader_error_t loader_detect_chip(target_chip_t *target, const target_registers_t **regs);
|
||||
esp_loader_error_t loader_read_spi_config(target_chip_t target_chip, uint32_t *spi_config);
|
||||
bool encryption_in_begin_flash_cmd(target_chip_t target);
|
||||
28
applications/external/esp_flasher/lib/esp-serial-flasher/private_include/md5_hash.h
vendored
Normal file
28
applications/external/esp_flasher/lib/esp-serial-flasher/private_include/md5_hash.h
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* MD5 hash implementation and interface functions
|
||||
* Copyright (c) 2003-2005, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
struct MD5Context {
|
||||
uint32_t buf[4];
|
||||
uint32_t bits[2];
|
||||
uint8_t in[64];
|
||||
};
|
||||
|
||||
void MD5Init(struct MD5Context *context);
|
||||
void MD5Update(struct MD5Context *context, unsigned char const *buf, unsigned len);
|
||||
void MD5Final(unsigned char digest[16], struct MD5Context *context);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
230
applications/external/esp_flasher/lib/esp-serial-flasher/private_include/protocol.h
vendored
Normal file
230
applications/external/esp_flasher/lib/esp-serial-flasher/private_include/protocol.h
vendored
Normal file
@@ -0,0 +1,230 @@
|
||||
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "esp_loader.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define STATUS_FAILURE 1
|
||||
#define STATUS_SUCCESS 0
|
||||
|
||||
#define READ_DIRECTION 1
|
||||
#define WRITE_DIRECTION 0
|
||||
|
||||
#define MD5_SIZE 32
|
||||
|
||||
typedef enum __attribute__((packed))
|
||||
{
|
||||
FLASH_BEGIN = 0x02,
|
||||
FLASH_DATA = 0x03,
|
||||
FLASH_END = 0x04,
|
||||
MEM_BEGIN = 0x05,
|
||||
MEM_END = 0x06,
|
||||
MEM_DATA = 0x07,
|
||||
SYNC = 0x08,
|
||||
WRITE_REG = 0x09,
|
||||
READ_REG = 0x0a,
|
||||
|
||||
SPI_SET_PARAMS = 0x0b,
|
||||
SPI_ATTACH = 0x0d,
|
||||
CHANGE_BAUDRATE = 0x0f,
|
||||
FLASH_DEFL_BEGIN = 0x10,
|
||||
FLASH_DEFL_DATA = 0x11,
|
||||
FLASH_DEFL_END = 0x12,
|
||||
SPI_FLASH_MD5 = 0x13,
|
||||
} command_t;
|
||||
|
||||
typedef enum __attribute__((packed))
|
||||
{
|
||||
RESPONSE_OK = 0x00,
|
||||
INVALID_COMMAND = 0x05, // parameters or length field is invalid
|
||||
COMMAND_FAILED = 0x06, // Failed to act on received message
|
||||
INVALID_CRC = 0x07, // Invalid CRC in message
|
||||
FLASH_WRITE_ERR = 0x08, // After writing a block of data to flash, the ROM loader reads the value back and the 8-bit CRC is compared to the data read from flash. If they don't match, this error is returned.
|
||||
FLASH_READ_ERR = 0x09, // SPI read failed
|
||||
READ_LENGTH_ERR = 0x0a, // SPI read request length is too long
|
||||
DEFLATE_ERROR = 0x0b, // ESP32 compressed uploads only
|
||||
} error_code_t;
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint8_t direction;
|
||||
uint8_t command; // One of command_t
|
||||
uint16_t size;
|
||||
uint32_t checksum;
|
||||
} command_common_t;
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
command_common_t common;
|
||||
uint32_t erase_size;
|
||||
uint32_t packet_count;
|
||||
uint32_t packet_size;
|
||||
uint32_t offset;
|
||||
uint32_t encrypted;
|
||||
} flash_begin_command_t;
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
command_common_t common;
|
||||
uint32_t data_size;
|
||||
uint32_t sequence_number;
|
||||
uint32_t zero_0;
|
||||
uint32_t zero_1;
|
||||
} data_command_t;
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
command_common_t common;
|
||||
uint32_t stay_in_loader;
|
||||
} flash_end_command_t;
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
command_common_t common;
|
||||
uint32_t total_size;
|
||||
uint32_t blocks;
|
||||
uint32_t block_size;
|
||||
uint32_t offset;
|
||||
} mem_begin_command_t;
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
command_common_t common;
|
||||
uint32_t stay_in_loader;
|
||||
uint32_t entry_point_address;
|
||||
} mem_end_command_t;
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
command_common_t common;
|
||||
uint8_t sync_sequence[36];
|
||||
} sync_command_t;
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
command_common_t common;
|
||||
uint32_t address;
|
||||
uint32_t value;
|
||||
uint32_t mask;
|
||||
uint32_t delay_us;
|
||||
} write_reg_command_t;
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
command_common_t common;
|
||||
uint32_t address;
|
||||
} read_reg_command_t;
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
command_common_t common;
|
||||
uint32_t configuration;
|
||||
uint32_t zero; // ESP32 ROM only
|
||||
} spi_attach_command_t;
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
command_common_t common;
|
||||
uint32_t new_baudrate;
|
||||
uint32_t old_baudrate;
|
||||
} change_baudrate_command_t;
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
command_common_t common;
|
||||
uint32_t address;
|
||||
uint32_t size;
|
||||
uint32_t reserved_0;
|
||||
uint32_t reserved_1;
|
||||
} spi_flash_md5_command_t;
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint8_t direction;
|
||||
uint8_t command; // One of command_t
|
||||
uint16_t size;
|
||||
uint32_t value;
|
||||
} common_response_t;
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint8_t failed;
|
||||
uint8_t error;
|
||||
} response_status_t;
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
common_response_t common;
|
||||
response_status_t status;
|
||||
} response_t;
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
common_response_t common;
|
||||
uint8_t md5[MD5_SIZE]; // ROM only
|
||||
response_status_t status;
|
||||
} rom_md5_response_t;
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
command_common_t common;
|
||||
uint32_t id;
|
||||
uint32_t total_size;
|
||||
uint32_t block_size;
|
||||
uint32_t sector_size;
|
||||
uint32_t page_size;
|
||||
uint32_t status_mask;
|
||||
} write_spi_command_t;
|
||||
|
||||
esp_loader_error_t loader_initialize_conn(esp_loader_connect_args_t *connect_args);
|
||||
|
||||
#ifdef SERIAL_FLASHER_INTERFACE_UART
|
||||
esp_loader_error_t loader_flash_begin_cmd(uint32_t offset, uint32_t erase_size, uint32_t block_size, uint32_t blocks_to_write, bool encryption);
|
||||
|
||||
esp_loader_error_t loader_flash_data_cmd(const uint8_t *data, uint32_t size);
|
||||
|
||||
esp_loader_error_t loader_flash_end_cmd(bool stay_in_loader);
|
||||
|
||||
esp_loader_error_t loader_sync_cmd(void);
|
||||
|
||||
esp_loader_error_t loader_spi_attach_cmd(uint32_t config);
|
||||
|
||||
esp_loader_error_t loader_md5_cmd(uint32_t address, uint32_t size, uint8_t *md5_out);
|
||||
|
||||
esp_loader_error_t loader_spi_parameters(uint32_t total_size);
|
||||
#endif /* SERIAL_FLASHER_INTERFACE_UART */
|
||||
|
||||
esp_loader_error_t loader_mem_begin_cmd(uint32_t offset, uint32_t size, uint32_t blocks_to_write, uint32_t block_size);
|
||||
|
||||
esp_loader_error_t loader_mem_data_cmd(const uint8_t *data, uint32_t size);
|
||||
|
||||
esp_loader_error_t loader_mem_end_cmd(uint32_t entrypoint);
|
||||
|
||||
esp_loader_error_t loader_write_reg_cmd(uint32_t address, uint32_t value, uint32_t mask, uint32_t delay_us);
|
||||
|
||||
esp_loader_error_t loader_read_reg_cmd(uint32_t address, uint32_t *reg);
|
||||
|
||||
esp_loader_error_t loader_change_baudrate_cmd(uint32_t baudrate);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
31
applications/external/esp_flasher/lib/esp-serial-flasher/private_include/protocol_prv.h
vendored
Normal file
31
applications/external/esp_flasher/lib/esp-serial-flasher/private_include/protocol_prv.h
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include "esp_loader.h"
|
||||
#include "protocol.h"
|
||||
|
||||
void log_loader_internal_error(error_code_t error);
|
||||
|
||||
esp_loader_error_t send_cmd(const void *cmd_data, uint32_t size, uint32_t *reg_value);
|
||||
|
||||
esp_loader_error_t send_cmd_with_data(const void *cmd_data, size_t cmd_size,
|
||||
const void *data, size_t data_size);
|
||||
|
||||
esp_loader_error_t send_cmd_md5(const void *cmd_data, size_t cmd_size, uint8_t md5_out[MD5_SIZE]);
|
||||
28
applications/external/esp_flasher/lib/esp-serial-flasher/private_include/slip.h
vendored
Normal file
28
applications/external/esp_flasher/lib/esp-serial-flasher/private_include/slip.h
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "esp_loader.h"
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
esp_loader_error_t SLIP_receive_data(uint8_t *buff, size_t size);
|
||||
|
||||
esp_loader_error_t SLIP_receive_packet(uint8_t *buff, size_t size);
|
||||
|
||||
esp_loader_error_t SLIP_send(const uint8_t *data, size_t size);
|
||||
|
||||
esp_loader_error_t SLIP_send_delimiter(void);
|
||||
415
applications/external/esp_flasher/lib/esp-serial-flasher/src/esp_loader.c
vendored
Normal file
415
applications/external/esp_flasher/lib/esp-serial-flasher/src/esp_loader.c
vendored
Normal file
@@ -0,0 +1,415 @@
|
||||
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "protocol.h"
|
||||
#include "esp_loader_io.h"
|
||||
#include "esp_loader.h"
|
||||
#include "esp_targets.h"
|
||||
#include "md5_hash.h"
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifndef MAX
|
||||
#define MAX(a, b) ((a) > (b)) ? (a) : (b)
|
||||
#endif
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(a, b) ((a) < (b)) ? (a) : (b)
|
||||
#endif
|
||||
|
||||
#ifndef ROUNDUP
|
||||
#define ROUNDUP(a, b) (((int)a + (int)b - 1) / (int)b)
|
||||
#endif
|
||||
|
||||
static const uint32_t DEFAULT_TIMEOUT = 1000;
|
||||
static const uint32_t DEFAULT_FLASH_TIMEOUT = 3000; // timeout for most flash operations
|
||||
static const uint32_t LOAD_RAM_TIMEOUT_PER_MB = 2000000; // timeout (per megabyte) for erasing a region
|
||||
|
||||
typedef enum {
|
||||
SPI_FLASH_READ_ID = 0x9F
|
||||
} spi_flash_cmd_t;
|
||||
|
||||
static const target_registers_t *s_reg = NULL;
|
||||
static target_chip_t s_target = ESP_UNKNOWN_CHIP;
|
||||
|
||||
#if MD5_ENABLED
|
||||
|
||||
static const uint32_t MD5_TIMEOUT_PER_MB = 800;
|
||||
static struct MD5Context s_md5_context;
|
||||
static uint32_t s_start_address;
|
||||
static uint32_t s_image_size;
|
||||
|
||||
static inline void init_md5(uint32_t address, uint32_t size)
|
||||
{
|
||||
s_start_address = address;
|
||||
s_image_size = size;
|
||||
MD5Init(&s_md5_context);
|
||||
}
|
||||
|
||||
static inline void md5_update(const uint8_t *data, uint32_t size)
|
||||
{
|
||||
MD5Update(&s_md5_context, data, size);
|
||||
}
|
||||
|
||||
static inline void md5_final(uint8_t digets[16])
|
||||
{
|
||||
MD5Final(digets, &s_md5_context);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static inline void init_md5(uint32_t address, uint32_t size) { }
|
||||
static inline void md5_update(const uint8_t *data, uint32_t size) { }
|
||||
static inline void md5_final(uint8_t digets[16]) { }
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
static uint32_t timeout_per_mb(uint32_t size_bytes, uint32_t time_per_mb)
|
||||
{
|
||||
uint32_t timeout = time_per_mb * (size_bytes / 1e6);
|
||||
return MAX(timeout, DEFAULT_FLASH_TIMEOUT);
|
||||
}
|
||||
|
||||
esp_loader_error_t esp_loader_connect(esp_loader_connect_args_t *connect_args)
|
||||
{
|
||||
loader_port_enter_bootloader();
|
||||
|
||||
RETURN_ON_ERROR(loader_initialize_conn(connect_args));
|
||||
|
||||
RETURN_ON_ERROR(loader_detect_chip(&s_target, &s_reg));
|
||||
|
||||
#ifdef SERIAL_FLASHER_INTERFACE_UART
|
||||
esp_loader_error_t err;
|
||||
uint32_t spi_config;
|
||||
if (s_target == ESP8266_CHIP) {
|
||||
err = loader_flash_begin_cmd(0, 0, 0, 0, s_target);
|
||||
} else {
|
||||
RETURN_ON_ERROR( loader_read_spi_config(s_target, &spi_config) );
|
||||
loader_port_start_timer(DEFAULT_TIMEOUT);
|
||||
err = loader_spi_attach_cmd(spi_config);
|
||||
}
|
||||
return err;
|
||||
#endif /* SERIAL_FLASHER_INTERFACE_UART */
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
target_chip_t esp_loader_get_target(void)
|
||||
{
|
||||
return s_target;
|
||||
}
|
||||
|
||||
#ifdef SERIAL_FLASHER_INTERFACE_UART
|
||||
static uint32_t s_flash_write_size = 0;
|
||||
|
||||
static esp_loader_error_t spi_set_data_lengths(size_t mosi_bits, size_t miso_bits)
|
||||
{
|
||||
if (mosi_bits > 0) {
|
||||
RETURN_ON_ERROR( esp_loader_write_register(s_reg->mosi_dlen, mosi_bits - 1) );
|
||||
}
|
||||
if (miso_bits > 0) {
|
||||
RETURN_ON_ERROR( esp_loader_write_register(s_reg->miso_dlen, miso_bits - 1) );
|
||||
}
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
static esp_loader_error_t spi_set_data_lengths_8266(size_t mosi_bits, size_t miso_bits)
|
||||
{
|
||||
uint32_t mosi_mask = (mosi_bits == 0) ? 0 : mosi_bits - 1;
|
||||
uint32_t miso_mask = (miso_bits == 0) ? 0 : miso_bits - 1;
|
||||
return esp_loader_write_register(s_reg->usr1, (miso_mask << 8) | (mosi_mask << 17));
|
||||
}
|
||||
|
||||
static esp_loader_error_t spi_flash_command(spi_flash_cmd_t cmd, void *data_tx, size_t tx_size, void *data_rx, size_t rx_size)
|
||||
{
|
||||
assert(rx_size <= 32); // Reading more than 32 bits back from a SPI flash operation is unsupported
|
||||
assert(tx_size <= 64); // Writing more than 64 bytes of data with one SPI command is unsupported
|
||||
|
||||
uint32_t SPI_USR_CMD = (1 << 31);
|
||||
uint32_t SPI_USR_MISO = (1 << 28);
|
||||
uint32_t SPI_USR_MOSI = (1 << 27);
|
||||
uint32_t SPI_CMD_USR = (1 << 18);
|
||||
uint32_t CMD_LEN_SHIFT = 28;
|
||||
|
||||
// Save SPI configuration
|
||||
uint32_t old_spi_usr;
|
||||
uint32_t old_spi_usr2;
|
||||
RETURN_ON_ERROR( esp_loader_read_register(s_reg->usr, &old_spi_usr) );
|
||||
RETURN_ON_ERROR( esp_loader_read_register(s_reg->usr2, &old_spi_usr2) );
|
||||
|
||||
if (s_target == ESP8266_CHIP) {
|
||||
RETURN_ON_ERROR( spi_set_data_lengths_8266(tx_size, rx_size) );
|
||||
} else {
|
||||
RETURN_ON_ERROR( spi_set_data_lengths(tx_size, rx_size) );
|
||||
}
|
||||
|
||||
uint32_t usr_reg_2 = (7 << CMD_LEN_SHIFT) | cmd;
|
||||
uint32_t usr_reg = SPI_USR_CMD;
|
||||
if (rx_size > 0) {
|
||||
usr_reg |= SPI_USR_MISO;
|
||||
}
|
||||
if (tx_size > 0) {
|
||||
usr_reg |= SPI_USR_MOSI;
|
||||
}
|
||||
|
||||
RETURN_ON_ERROR( esp_loader_write_register(s_reg->usr, usr_reg) );
|
||||
RETURN_ON_ERROR( esp_loader_write_register(s_reg->usr2, usr_reg_2 ) );
|
||||
|
||||
if (tx_size == 0) {
|
||||
// clear data register before we read it
|
||||
RETURN_ON_ERROR( esp_loader_write_register(s_reg->w0, 0) );
|
||||
} else {
|
||||
uint32_t *data = (uint32_t *)data_tx;
|
||||
uint32_t words_to_write = (tx_size + 31) / (8 * 4);
|
||||
uint32_t data_reg_addr = s_reg->w0;
|
||||
|
||||
while (words_to_write--) {
|
||||
uint32_t word = *data++;
|
||||
RETURN_ON_ERROR( esp_loader_write_register(data_reg_addr, word) );
|
||||
data_reg_addr += 4;
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_ON_ERROR( esp_loader_write_register(s_reg->cmd, SPI_CMD_USR) );
|
||||
|
||||
uint32_t trials = 10;
|
||||
while (trials--) {
|
||||
uint32_t cmd_reg;
|
||||
RETURN_ON_ERROR( esp_loader_read_register(s_reg->cmd, &cmd_reg) );
|
||||
if ((cmd_reg & SPI_CMD_USR) == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (trials == 0) {
|
||||
return ESP_LOADER_ERROR_TIMEOUT;
|
||||
}
|
||||
|
||||
RETURN_ON_ERROR( esp_loader_read_register(s_reg->w0, data_rx) );
|
||||
|
||||
// Restore SPI configuration
|
||||
RETURN_ON_ERROR( esp_loader_write_register(s_reg->usr, old_spi_usr) );
|
||||
RETURN_ON_ERROR( esp_loader_write_register(s_reg->usr2, old_spi_usr2) );
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
static esp_loader_error_t detect_flash_size(size_t *flash_size)
|
||||
{
|
||||
uint32_t flash_id = 0;
|
||||
|
||||
RETURN_ON_ERROR( spi_flash_command(SPI_FLASH_READ_ID, NULL, 0, &flash_id, 24) );
|
||||
uint32_t size_id = flash_id >> 16;
|
||||
|
||||
if (size_id < 0x12 || size_id > 0x18) {
|
||||
return ESP_LOADER_ERROR_UNSUPPORTED_CHIP;
|
||||
}
|
||||
|
||||
*flash_size = 1 << size_id;
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
static uint32_t calc_erase_size(const target_chip_t target, const uint32_t offset,
|
||||
const uint32_t image_size)
|
||||
{
|
||||
if (target != ESP8266_CHIP) {
|
||||
return image_size;
|
||||
} else {
|
||||
/* Needed to fix a bug in the ESP8266 ROM */
|
||||
const uint32_t sectors_per_block = 16U;
|
||||
const uint32_t sector_size = 4096U;
|
||||
|
||||
const uint32_t num_sectors = (image_size + sector_size - 1) / sector_size;
|
||||
const uint32_t start_sector = offset / sector_size;
|
||||
|
||||
uint32_t head_sectors = sectors_per_block - (start_sector % sectors_per_block);
|
||||
|
||||
/* The ROM bug deletes extra num_sectors if we don't cross the block boundary
|
||||
and extra head_sectors if we do */
|
||||
if (num_sectors <= head_sectors) {
|
||||
return ((num_sectors + 1) / 2) * sector_size;
|
||||
} else {
|
||||
return (num_sectors - head_sectors) * sector_size;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
esp_loader_error_t esp_loader_flash_start(uint32_t offset, uint32_t image_size, uint32_t block_size)
|
||||
{
|
||||
s_flash_write_size = block_size;
|
||||
|
||||
size_t flash_size = 0;
|
||||
if (detect_flash_size(&flash_size) == ESP_LOADER_SUCCESS) {
|
||||
if (image_size > flash_size) {
|
||||
return ESP_LOADER_ERROR_IMAGE_SIZE;
|
||||
}
|
||||
loader_port_start_timer(DEFAULT_TIMEOUT);
|
||||
RETURN_ON_ERROR( loader_spi_parameters(flash_size) );
|
||||
} else {
|
||||
loader_port_debug_print("Flash size detection failed, falling back to default");
|
||||
}
|
||||
|
||||
init_md5(offset, image_size);
|
||||
|
||||
bool encryption_in_cmd = encryption_in_begin_flash_cmd(s_target);
|
||||
const uint32_t erase_size = calc_erase_size(esp_loader_get_target(), offset, image_size);
|
||||
const uint32_t blocks_to_write = (image_size + block_size - 1) / block_size;
|
||||
|
||||
const uint32_t erase_region_timeout_per_mb = 10000;
|
||||
loader_port_start_timer(timeout_per_mb(erase_size, erase_region_timeout_per_mb));
|
||||
return loader_flash_begin_cmd(offset, erase_size, block_size, blocks_to_write, encryption_in_cmd);
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t esp_loader_flash_write(void *payload, uint32_t size)
|
||||
{
|
||||
uint32_t padding_bytes = s_flash_write_size - size;
|
||||
uint8_t *data = (uint8_t *)payload;
|
||||
uint32_t padding_index = size;
|
||||
|
||||
if (size > s_flash_write_size) {
|
||||
return ESP_LOADER_ERROR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
const uint8_t padding_pattern = 0xFF;
|
||||
while (padding_bytes--) {
|
||||
data[padding_index++] = padding_pattern;
|
||||
}
|
||||
|
||||
md5_update(payload, (size + 3) & ~3);
|
||||
|
||||
loader_port_start_timer(DEFAULT_TIMEOUT);
|
||||
|
||||
return loader_flash_data_cmd(data, s_flash_write_size);
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t esp_loader_flash_finish(bool reboot)
|
||||
{
|
||||
loader_port_start_timer(DEFAULT_TIMEOUT);
|
||||
|
||||
return loader_flash_end_cmd(!reboot);
|
||||
}
|
||||
#endif /* SERIAL_FLASHER_INTERFACE_UART */
|
||||
|
||||
esp_loader_error_t esp_loader_mem_start(uint32_t offset, uint32_t size, uint32_t block_size)
|
||||
{
|
||||
uint32_t blocks_to_write = ROUNDUP(size, block_size);
|
||||
loader_port_start_timer(timeout_per_mb(size, LOAD_RAM_TIMEOUT_PER_MB));
|
||||
return loader_mem_begin_cmd(offset, size, blocks_to_write, block_size);
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t esp_loader_mem_write(const void *payload, uint32_t size)
|
||||
{
|
||||
const uint8_t *data = (const uint8_t *)payload;
|
||||
loader_port_start_timer(timeout_per_mb(size, LOAD_RAM_TIMEOUT_PER_MB));
|
||||
return loader_mem_data_cmd(data, size);
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t esp_loader_mem_finish(uint32_t entrypoint)
|
||||
{
|
||||
loader_port_start_timer(DEFAULT_TIMEOUT);
|
||||
return loader_mem_end_cmd(entrypoint);
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t esp_loader_read_register(uint32_t address, uint32_t *reg_value)
|
||||
{
|
||||
loader_port_start_timer(DEFAULT_TIMEOUT);
|
||||
|
||||
return loader_read_reg_cmd(address, reg_value);
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t esp_loader_write_register(uint32_t address, uint32_t reg_value)
|
||||
{
|
||||
loader_port_start_timer(DEFAULT_TIMEOUT);
|
||||
|
||||
return loader_write_reg_cmd(address, reg_value, 0xFFFFFFFF, 0);
|
||||
}
|
||||
|
||||
esp_loader_error_t esp_loader_change_transmission_rate(uint32_t transmission_rate)
|
||||
{
|
||||
if (s_target == ESP8266_CHIP) {
|
||||
return ESP_LOADER_ERROR_UNSUPPORTED_FUNC;
|
||||
}
|
||||
|
||||
loader_port_start_timer(DEFAULT_TIMEOUT);
|
||||
|
||||
return loader_change_baudrate_cmd(transmission_rate);
|
||||
}
|
||||
|
||||
#if MD5_ENABLED
|
||||
|
||||
static void hexify(const uint8_t raw_md5[16], uint8_t hex_md5_out[32])
|
||||
{
|
||||
static const uint8_t dec_to_hex[] = {
|
||||
'0', '1', '2', '3', '4', '5', '6', '7',
|
||||
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
|
||||
};
|
||||
for (int i = 0; i < 16; i++) {
|
||||
*hex_md5_out++ = dec_to_hex[raw_md5[i] >> 4];
|
||||
*hex_md5_out++ = dec_to_hex[raw_md5[i] & 0xF];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t esp_loader_flash_verify(void)
|
||||
{
|
||||
if (s_target == ESP8266_CHIP) {
|
||||
return ESP_LOADER_ERROR_UNSUPPORTED_FUNC;
|
||||
}
|
||||
|
||||
uint8_t raw_md5[16] = {0};
|
||||
|
||||
/* Zero termination and new line character require 2 bytes */
|
||||
uint8_t hex_md5[MD5_SIZE + 2] = {0};
|
||||
uint8_t received_md5[MD5_SIZE + 2] = {0};
|
||||
|
||||
md5_final(raw_md5);
|
||||
hexify(raw_md5, hex_md5);
|
||||
|
||||
loader_port_start_timer(timeout_per_mb(s_image_size, MD5_TIMEOUT_PER_MB));
|
||||
|
||||
RETURN_ON_ERROR( loader_md5_cmd(s_start_address, s_image_size, received_md5) );
|
||||
|
||||
bool md5_match = memcmp(hex_md5, received_md5, MD5_SIZE) == 0;
|
||||
|
||||
if (!md5_match) {
|
||||
hex_md5[MD5_SIZE] = '\n';
|
||||
received_md5[MD5_SIZE] = '\n';
|
||||
|
||||
loader_port_debug_print("Error: MD5 checksum does not match:\n");
|
||||
loader_port_debug_print("Expected:\n");
|
||||
loader_port_debug_print((char *)received_md5);
|
||||
loader_port_debug_print("Actual:\n");
|
||||
loader_port_debug_print((char *)hex_md5);
|
||||
|
||||
return ESP_LOADER_ERROR_INVALID_MD5;
|
||||
}
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void esp_loader_reset_target(void)
|
||||
{
|
||||
loader_port_reset_target();
|
||||
}
|
||||
263
applications/external/esp_flasher/lib/esp-serial-flasher/src/esp_targets.c
vendored
Normal file
263
applications/external/esp_flasher/lib/esp-serial-flasher/src/esp_targets.c
vendored
Normal file
@@ -0,0 +1,263 @@
|
||||
/* Copyright 2020 Espressif Systems (Shanghai) PTE LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "esp_targets.h"
|
||||
#include <stddef.h>
|
||||
|
||||
#define MAX_MAGIC_VALUES 2
|
||||
|
||||
typedef esp_loader_error_t (*read_spi_config_t)(uint32_t efuse_base, uint32_t *spi_config);
|
||||
|
||||
typedef struct {
|
||||
target_registers_t regs;
|
||||
uint32_t efuse_base;
|
||||
uint32_t chip_magic_value[MAX_MAGIC_VALUES];
|
||||
read_spi_config_t read_spi_config;
|
||||
bool encryption_in_begin_flash_cmd;
|
||||
} esp_target_t;
|
||||
|
||||
// This ROM address has a different value on each chip model
|
||||
#define CHIP_DETECT_MAGIC_REG_ADDR 0x40001000
|
||||
|
||||
#define ESP8266_SPI_REG_BASE 0x60000200
|
||||
#define ESP32S2_SPI_REG_BASE 0x3f402000
|
||||
#define ESP32xx_SPI_REG_BASE 0x60002000
|
||||
#define ESP32_SPI_REG_BASE 0x3ff42000
|
||||
|
||||
static esp_loader_error_t spi_config_esp32(uint32_t efuse_base, uint32_t *spi_config);
|
||||
static esp_loader_error_t spi_config_esp32xx(uint32_t efuse_base, uint32_t *spi_config);
|
||||
|
||||
static const esp_target_t esp_target[ESP_MAX_CHIP] = {
|
||||
|
||||
// ESP8266
|
||||
{
|
||||
.regs = {
|
||||
.cmd = ESP8266_SPI_REG_BASE + 0x00,
|
||||
.usr = ESP8266_SPI_REG_BASE + 0x1c,
|
||||
.usr1 = ESP8266_SPI_REG_BASE + 0x20,
|
||||
.usr2 = ESP8266_SPI_REG_BASE + 0x24,
|
||||
.w0 = ESP8266_SPI_REG_BASE + 0x40,
|
||||
.mosi_dlen = 0,
|
||||
.miso_dlen = 0,
|
||||
},
|
||||
.efuse_base = 0, // Not used
|
||||
.chip_magic_value = { 0xfff0c101, 0 },
|
||||
.read_spi_config = NULL, // Not used
|
||||
},
|
||||
|
||||
// ESP32
|
||||
{
|
||||
.regs = {
|
||||
.cmd = ESP32_SPI_REG_BASE + 0x00,
|
||||
.usr = ESP32_SPI_REG_BASE + 0x1c,
|
||||
.usr1 = ESP32_SPI_REG_BASE + 0x20,
|
||||
.usr2 = ESP32_SPI_REG_BASE + 0x24,
|
||||
.w0 = ESP32_SPI_REG_BASE + 0x80,
|
||||
.mosi_dlen = ESP32_SPI_REG_BASE + 0x28,
|
||||
.miso_dlen = ESP32_SPI_REG_BASE + 0x2c,
|
||||
},
|
||||
.efuse_base = 0x3ff5A000,
|
||||
.chip_magic_value = { 0x00f01d83, 0 },
|
||||
.read_spi_config = spi_config_esp32,
|
||||
},
|
||||
|
||||
// ESP32S2
|
||||
{
|
||||
.regs = {
|
||||
.cmd = ESP32S2_SPI_REG_BASE + 0x00,
|
||||
.usr = ESP32S2_SPI_REG_BASE + 0x18,
|
||||
.usr1 = ESP32S2_SPI_REG_BASE + 0x1c,
|
||||
.usr2 = ESP32S2_SPI_REG_BASE + 0x20,
|
||||
.w0 = ESP32S2_SPI_REG_BASE + 0x58,
|
||||
.mosi_dlen = ESP32S2_SPI_REG_BASE + 0x24,
|
||||
.miso_dlen = ESP32S2_SPI_REG_BASE + 0x28,
|
||||
},
|
||||
.efuse_base = 0x3f41A000,
|
||||
.chip_magic_value = { 0x000007c6, 0 },
|
||||
.read_spi_config = spi_config_esp32xx,
|
||||
},
|
||||
|
||||
// ESP32C3
|
||||
{
|
||||
.regs = {
|
||||
.cmd = ESP32xx_SPI_REG_BASE + 0x00,
|
||||
.usr = ESP32xx_SPI_REG_BASE + 0x18,
|
||||
.usr1 = ESP32xx_SPI_REG_BASE + 0x1c,
|
||||
.usr2 = ESP32xx_SPI_REG_BASE + 0x20,
|
||||
.w0 = ESP32xx_SPI_REG_BASE + 0x58,
|
||||
.mosi_dlen = ESP32xx_SPI_REG_BASE + 0x24,
|
||||
.miso_dlen = ESP32xx_SPI_REG_BASE + 0x28,
|
||||
},
|
||||
.efuse_base = 0x60008800,
|
||||
.chip_magic_value = { 0x6921506f, 0x1b31506f },
|
||||
.read_spi_config = spi_config_esp32xx,
|
||||
},
|
||||
|
||||
// ESP32S3
|
||||
{
|
||||
.regs = {
|
||||
.cmd = ESP32xx_SPI_REG_BASE + 0x00,
|
||||
.usr = ESP32xx_SPI_REG_BASE + 0x18,
|
||||
.usr1 = ESP32xx_SPI_REG_BASE + 0x1c,
|
||||
.usr2 = ESP32xx_SPI_REG_BASE + 0x20,
|
||||
.w0 = ESP32xx_SPI_REG_BASE + 0x58,
|
||||
.mosi_dlen = ESP32xx_SPI_REG_BASE + 0x24,
|
||||
.miso_dlen = ESP32xx_SPI_REG_BASE + 0x28,
|
||||
},
|
||||
.efuse_base = 0x60007000,
|
||||
.chip_magic_value = { 0x00000009, 0 },
|
||||
.read_spi_config = spi_config_esp32xx,
|
||||
},
|
||||
|
||||
// ESP32C2
|
||||
{
|
||||
.regs = {
|
||||
.cmd = ESP32xx_SPI_REG_BASE + 0x00,
|
||||
.usr = ESP32xx_SPI_REG_BASE + 0x18,
|
||||
.usr1 = ESP32xx_SPI_REG_BASE + 0x1c,
|
||||
.usr2 = ESP32xx_SPI_REG_BASE + 0x20,
|
||||
.w0 = ESP32xx_SPI_REG_BASE + 0x58,
|
||||
.mosi_dlen = ESP32xx_SPI_REG_BASE + 0x24,
|
||||
.miso_dlen = ESP32xx_SPI_REG_BASE + 0x28,
|
||||
},
|
||||
.efuse_base = 0x60008800,
|
||||
.chip_magic_value = { 0x6f51306f, 0x7c41a06f },
|
||||
.read_spi_config = spi_config_esp32xx,
|
||||
},
|
||||
// ESP32H4
|
||||
{
|
||||
.regs = {
|
||||
.cmd = ESP32xx_SPI_REG_BASE + 0x00,
|
||||
.usr = ESP32xx_SPI_REG_BASE + 0x18,
|
||||
.usr1 = ESP32xx_SPI_REG_BASE + 0x1c,
|
||||
.usr2 = ESP32xx_SPI_REG_BASE + 0x20,
|
||||
.w0 = ESP32xx_SPI_REG_BASE + 0x58,
|
||||
.mosi_dlen = ESP32xx_SPI_REG_BASE + 0x24,
|
||||
.miso_dlen = ESP32xx_SPI_REG_BASE + 0x28,
|
||||
},
|
||||
.efuse_base = 0x6001A000,
|
||||
.chip_magic_value = {0xca26cc22, 0x6881b06f}, // ESP32H4-BETA1, ESP32H4-BETA2
|
||||
.read_spi_config = spi_config_esp32xx,
|
||||
},
|
||||
// ESP32H2
|
||||
{
|
||||
.regs = {
|
||||
.cmd = ESP32xx_SPI_REG_BASE + 0x00,
|
||||
.usr = ESP32xx_SPI_REG_BASE + 0x18,
|
||||
.usr1 = ESP32xx_SPI_REG_BASE + 0x1c,
|
||||
.usr2 = ESP32xx_SPI_REG_BASE + 0x20,
|
||||
.w0 = ESP32xx_SPI_REG_BASE + 0x58,
|
||||
.mosi_dlen = ESP32xx_SPI_REG_BASE + 0x24,
|
||||
.miso_dlen = ESP32xx_SPI_REG_BASE + 0x28,
|
||||
},
|
||||
.efuse_base = 0x6001A000,
|
||||
.chip_magic_value = {0xd7b73e80, 0},
|
||||
.read_spi_config = spi_config_esp32xx,
|
||||
},
|
||||
};
|
||||
|
||||
const target_registers_t *get_esp_target_data(target_chip_t chip)
|
||||
{
|
||||
return (const target_registers_t *)&esp_target[chip];
|
||||
}
|
||||
|
||||
esp_loader_error_t loader_detect_chip(target_chip_t *target_chip, const target_registers_t **target_data)
|
||||
{
|
||||
uint32_t magic_value;
|
||||
RETURN_ON_ERROR( esp_loader_read_register(CHIP_DETECT_MAGIC_REG_ADDR, &magic_value) );
|
||||
|
||||
for (int chip = 0; chip < ESP_MAX_CHIP; chip++) {
|
||||
for(int index = 0; index < MAX_MAGIC_VALUES; index++) {
|
||||
if (magic_value == esp_target[chip].chip_magic_value[index]) {
|
||||
*target_chip = (target_chip_t)chip;
|
||||
*target_data = (target_registers_t *)&esp_target[chip];
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ESP_LOADER_ERROR_INVALID_TARGET;
|
||||
}
|
||||
|
||||
esp_loader_error_t loader_read_spi_config(target_chip_t target_chip, uint32_t *spi_config)
|
||||
{
|
||||
const esp_target_t *target = &esp_target[target_chip];
|
||||
return target->read_spi_config(target->efuse_base, spi_config);
|
||||
}
|
||||
|
||||
static inline uint32_t efuse_word_addr(uint32_t efuse_base, uint32_t n)
|
||||
{
|
||||
return efuse_base + (n * 4);
|
||||
}
|
||||
|
||||
// 30->GPIO32 | 31->GPIO33
|
||||
static inline uint8_t adjust_pin_number(uint8_t num)
|
||||
{
|
||||
return (num >= 30) ? num + 2 : num;
|
||||
}
|
||||
|
||||
|
||||
static esp_loader_error_t spi_config_esp32(uint32_t efuse_base, uint32_t *spi_config)
|
||||
{
|
||||
*spi_config = 0;
|
||||
|
||||
uint32_t reg5, reg3;
|
||||
RETURN_ON_ERROR( esp_loader_read_register(efuse_word_addr(efuse_base, 5), ®5) );
|
||||
RETURN_ON_ERROR( esp_loader_read_register(efuse_word_addr(efuse_base, 3), ®3) );
|
||||
|
||||
uint32_t pins = reg5 & 0xfffff;
|
||||
|
||||
if (pins == 0 || pins == 0xfffff) {
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
uint8_t clk = adjust_pin_number( (pins >> 0) & 0x1f );
|
||||
uint8_t q = adjust_pin_number( (pins >> 5) & 0x1f );
|
||||
uint8_t d = adjust_pin_number( (pins >> 10) & 0x1f );
|
||||
uint8_t cs = adjust_pin_number( (pins >> 15) & 0x1f );
|
||||
uint8_t hd = adjust_pin_number( (reg3 >> 4) & 0x1f );
|
||||
|
||||
if (clk == cs || clk == d || clk == q || q == cs || q == d || q == d) {
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
*spi_config = (hd << 24) | (cs << 18) | (d << 12) | (q << 6) | clk;
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
// Applies for esp32s2, esp32c3 and esp32c3
|
||||
static esp_loader_error_t spi_config_esp32xx(uint32_t efuse_base, uint32_t *spi_config)
|
||||
{
|
||||
*spi_config = 0;
|
||||
|
||||
uint32_t reg1, reg2;
|
||||
RETURN_ON_ERROR( esp_loader_read_register(efuse_word_addr(efuse_base, 18), ®1) );
|
||||
RETURN_ON_ERROR( esp_loader_read_register(efuse_word_addr(efuse_base, 19), ®2) );
|
||||
|
||||
uint32_t pins = ((reg1 >> 16) | ((reg2 & 0xfffff) << 16)) & 0x3fffffff;
|
||||
|
||||
if (pins == 0 || pins == 0xffffffff) {
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
*spi_config = pins;
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
bool encryption_in_begin_flash_cmd(target_chip_t target)
|
||||
{
|
||||
return target == ESP32_CHIP || target == ESP8266_CHIP;
|
||||
}
|
||||
262
applications/external/esp_flasher/lib/esp-serial-flasher/src/md5_hash.c
vendored
Normal file
262
applications/external/esp_flasher/lib/esp-serial-flasher/src/md5_hash.c
vendored
Normal file
@@ -0,0 +1,262 @@
|
||||
/*
|
||||
* MD5 hash implementation and interface functions
|
||||
* Copyright (c) 2003-2005, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
|
||||
#include "md5_hash.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
static void MD5Transform(uint32_t buf[4], uint32_t const in[16]);
|
||||
|
||||
|
||||
/* ===== start - public domain MD5 implementation ===== */
|
||||
/*
|
||||
* This code implements the MD5 message-digest algorithm.
|
||||
* The algorithm is due to Ron Rivest. This code was
|
||||
* written by Colin Plumb in 1993, no copyright is claimed.
|
||||
* This code is in the public domain; do with it what you wish.
|
||||
*
|
||||
* Equivalent code is available from RSA Data Security, Inc.
|
||||
* This code has been tested against that, and is equivalent,
|
||||
* except that you don't need to include two pages of legalese
|
||||
* with every copy.
|
||||
*
|
||||
* To compute the message digest of a chunk of bytes, declare an
|
||||
* MD5Context structure, pass it to MD5Init, call MD5Update as
|
||||
* needed on buffers full of bytes, and then call MD5Final, which
|
||||
* will fill a supplied 16-byte array with the digest.
|
||||
*/
|
||||
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
#define byteReverse(buf, len) /* Nothing */
|
||||
#else
|
||||
/*
|
||||
* Note: this code is harmless on little-endian machines.
|
||||
*/
|
||||
static void byteReverse(unsigned char *buf, unsigned longs)
|
||||
{
|
||||
uint32_t t;
|
||||
do {
|
||||
t = (uint32_t) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
|
||||
((unsigned) buf[1] << 8 | buf[0]);
|
||||
*(uint32_t *) buf = t;
|
||||
buf += 4;
|
||||
} while (--longs);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Start MD5 accumulation. Set bit count to 0 and buffer to mysterious
|
||||
* initialization constants.
|
||||
*/
|
||||
void MD5Init(struct MD5Context *ctx)
|
||||
{
|
||||
ctx->buf[0] = 0x67452301;
|
||||
ctx->buf[1] = 0xefcdab89;
|
||||
ctx->buf[2] = 0x98badcfe;
|
||||
ctx->buf[3] = 0x10325476;
|
||||
|
||||
ctx->bits[0] = 0;
|
||||
ctx->bits[1] = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Update context to reflect the concatenation of another buffer full
|
||||
* of bytes.
|
||||
*/
|
||||
void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
|
||||
{
|
||||
uint32_t t;
|
||||
|
||||
/* Update bitcount */
|
||||
|
||||
t = ctx->bits[0];
|
||||
if ((ctx->bits[0] = t + ((uint32_t) len << 3)) < t) {
|
||||
ctx->bits[1]++; /* Carry from low to high */
|
||||
}
|
||||
ctx->bits[1] += len >> 29;
|
||||
|
||||
t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */
|
||||
|
||||
/* Handle any leading odd-sized chunks */
|
||||
|
||||
if (t) {
|
||||
unsigned char *p = (unsigned char *) ctx->in + t;
|
||||
|
||||
t = 64 - t;
|
||||
if (len < t) {
|
||||
memcpy(p, buf, len);
|
||||
return;
|
||||
}
|
||||
memcpy(p, buf, t);
|
||||
byteReverse(ctx->in, 16);
|
||||
MD5Transform((uint32_t *)ctx->buf, (uint32_t *) ctx->in);
|
||||
buf += t;
|
||||
len -= t;
|
||||
}
|
||||
/* Process data in 64-byte chunks */
|
||||
|
||||
while (len >= 64) {
|
||||
memcpy(ctx->in, buf, 64);
|
||||
byteReverse(ctx->in, 16);
|
||||
MD5Transform((uint32_t *)ctx->buf, (uint32_t *) ctx->in);
|
||||
buf += 64;
|
||||
len -= 64;
|
||||
}
|
||||
|
||||
/* Handle any remaining bytes of data. */
|
||||
|
||||
memcpy(ctx->in, buf, len);
|
||||
}
|
||||
|
||||
/*
|
||||
* Final wrapup - pad to 64-byte boundary with the bit pattern
|
||||
* 1 0* (64-bit count of bits processed, MSB-first)
|
||||
*/
|
||||
void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
|
||||
{
|
||||
unsigned count;
|
||||
unsigned char *p;
|
||||
|
||||
/* Compute number of bytes mod 64 */
|
||||
count = (ctx->bits[0] >> 3) & 0x3F;
|
||||
|
||||
/* Set the first char of padding to 0x80. This is safe since there is
|
||||
always at least one byte free */
|
||||
p = ctx->in + count;
|
||||
*p++ = 0x80;
|
||||
|
||||
/* Bytes of padding needed to make 64 bytes */
|
||||
count = 64 - 1 - count;
|
||||
|
||||
/* Pad out to 56 mod 64 */
|
||||
if (count < 8) {
|
||||
/* Two lots of padding: Pad the first block to 64 bytes */
|
||||
memset(p, 0, count);
|
||||
byteReverse(ctx->in, 16);
|
||||
MD5Transform((uint32_t *)ctx->buf, (uint32_t *) ctx->in);
|
||||
|
||||
/* Now fill the next block with 56 bytes */
|
||||
memset(ctx->in, 0, 56);
|
||||
} else {
|
||||
/* Pad block to 56 bytes */
|
||||
memset(p, 0, count - 8);
|
||||
}
|
||||
byteReverse(ctx->in, 14);
|
||||
|
||||
/* Append length in bits and transform */
|
||||
((uint32_t *) ctx->in)[14] = ctx->bits[0];
|
||||
((uint32_t *) ctx->in)[15] = ctx->bits[1];
|
||||
|
||||
MD5Transform((uint32_t *)ctx->buf, (uint32_t *) ctx->in);
|
||||
byteReverse((unsigned char *) ctx->buf, 4);
|
||||
memcpy(digest, ctx->buf, 16);
|
||||
memset(ctx, 0, sizeof(struct MD5Context)); /* In case it's sensitive */
|
||||
}
|
||||
|
||||
/* The four core functions - F1 is optimized somewhat */
|
||||
|
||||
/* #define F1(x, y, z) (x & y | ~x & z) */
|
||||
#define F1(x, y, z) (z ^ (x & (y ^ z)))
|
||||
#define F2(x, y, z) F1(z, x, y)
|
||||
#define F3(x, y, z) (x ^ y ^ z)
|
||||
#define F4(x, y, z) (y ^ (x | ~z))
|
||||
|
||||
/* This is the central step in the MD5 algorithm. */
|
||||
#define MD5STEP(f, w, x, y, z, data, s) \
|
||||
( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
|
||||
|
||||
/*
|
||||
* The core of the MD5 algorithm, this alters an existing MD5 hash to
|
||||
* reflect the addition of 16 longwords of new data. MD5Update blocks
|
||||
* the data and converts bytes into longwords for this routine.
|
||||
*/
|
||||
static void MD5Transform(uint32_t buf[4], uint32_t const in[16])
|
||||
{
|
||||
register uint32_t a, b, c, d;
|
||||
|
||||
a = buf[0];
|
||||
b = buf[1];
|
||||
c = buf[2];
|
||||
d = buf[3];
|
||||
|
||||
MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
|
||||
MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
|
||||
MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
|
||||
MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
|
||||
MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
|
||||
MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
|
||||
MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
|
||||
MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
|
||||
MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
|
||||
MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
|
||||
MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
|
||||
MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
|
||||
MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
|
||||
MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
|
||||
MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
|
||||
MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
|
||||
|
||||
MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
|
||||
MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
|
||||
MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
|
||||
MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
|
||||
MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
|
||||
MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
|
||||
MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
|
||||
MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
|
||||
MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
|
||||
MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
|
||||
MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
|
||||
MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
|
||||
MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
|
||||
MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
|
||||
MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
|
||||
MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
|
||||
|
||||
MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
|
||||
MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
|
||||
MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
|
||||
MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
|
||||
MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
|
||||
MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
|
||||
MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
|
||||
MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
|
||||
MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
|
||||
MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
|
||||
MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
|
||||
MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
|
||||
MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
|
||||
MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
|
||||
MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
|
||||
MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
|
||||
|
||||
MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
|
||||
MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
|
||||
MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
|
||||
MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
|
||||
MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
|
||||
MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
|
||||
MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
|
||||
MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
|
||||
MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
|
||||
MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
|
||||
MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
|
||||
MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
|
||||
MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
|
||||
MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
|
||||
MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
|
||||
MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
|
||||
|
||||
buf[0] += a;
|
||||
buf[1] += b;
|
||||
buf[2] += c;
|
||||
buf[3] += d;
|
||||
}
|
||||
/* ===== end - public domain MD5 implementation ===== */
|
||||
301
applications/external/esp_flasher/lib/esp-serial-flasher/src/protocol_common.c
vendored
Normal file
301
applications/external/esp_flasher/lib/esp-serial-flasher/src/protocol_common.c
vendored
Normal file
@@ -0,0 +1,301 @@
|
||||
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "protocol.h"
|
||||
#include "protocol_prv.h"
|
||||
#include "esp_loader_io.h"
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#define CMD_SIZE(cmd) ( sizeof(cmd) - sizeof(command_common_t) )
|
||||
|
||||
static uint32_t s_sequence_number = 0;
|
||||
|
||||
static uint8_t compute_checksum(const uint8_t *data, uint32_t size)
|
||||
{
|
||||
uint8_t checksum = 0xEF;
|
||||
|
||||
while (size--) {
|
||||
checksum ^= *data++;
|
||||
}
|
||||
|
||||
return checksum;
|
||||
}
|
||||
|
||||
void log_loader_internal_error(error_code_t error)
|
||||
{
|
||||
loader_port_debug_print("Error: ");
|
||||
|
||||
switch (error) {
|
||||
case INVALID_CRC: loader_port_debug_print("INVALID_CRC"); break;
|
||||
case INVALID_COMMAND: loader_port_debug_print("INVALID_COMMAND"); break;
|
||||
case COMMAND_FAILED: loader_port_debug_print("COMMAND_FAILED"); break;
|
||||
case FLASH_WRITE_ERR: loader_port_debug_print("FLASH_WRITE_ERR"); break;
|
||||
case FLASH_READ_ERR: loader_port_debug_print("FLASH_READ_ERR"); break;
|
||||
case READ_LENGTH_ERR: loader_port_debug_print("READ_LENGTH_ERR"); break;
|
||||
case DEFLATE_ERROR: loader_port_debug_print("DEFLATE_ERROR"); break;
|
||||
default: loader_port_debug_print("UNKNOWN ERROR"); break;
|
||||
}
|
||||
|
||||
loader_port_debug_print("\n");
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t loader_flash_begin_cmd(uint32_t offset,
|
||||
uint32_t erase_size,
|
||||
uint32_t block_size,
|
||||
uint32_t blocks_to_write,
|
||||
bool encryption)
|
||||
{
|
||||
uint32_t encryption_size = encryption ? sizeof(uint32_t) : 0;
|
||||
|
||||
flash_begin_command_t flash_begin_cmd = {
|
||||
.common = {
|
||||
.direction = WRITE_DIRECTION,
|
||||
.command = FLASH_BEGIN,
|
||||
.size = CMD_SIZE(flash_begin_cmd) - encryption_size,
|
||||
.checksum = 0
|
||||
},
|
||||
.erase_size = erase_size,
|
||||
.packet_count = blocks_to_write,
|
||||
.packet_size = block_size,
|
||||
.offset = offset,
|
||||
.encrypted = 0
|
||||
};
|
||||
|
||||
s_sequence_number = 0;
|
||||
|
||||
return send_cmd(&flash_begin_cmd, sizeof(flash_begin_cmd) - encryption_size, NULL);
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t loader_flash_data_cmd(const uint8_t *data, uint32_t size)
|
||||
{
|
||||
data_command_t data_cmd = {
|
||||
.common = {
|
||||
.direction = WRITE_DIRECTION,
|
||||
.command = FLASH_DATA,
|
||||
.size = CMD_SIZE(data_cmd) + size,
|
||||
.checksum = compute_checksum(data, size)
|
||||
},
|
||||
.data_size = size,
|
||||
.sequence_number = s_sequence_number++,
|
||||
};
|
||||
|
||||
return send_cmd_with_data(&data_cmd, sizeof(data_cmd), data, size);
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t loader_flash_end_cmd(bool stay_in_loader)
|
||||
{
|
||||
flash_end_command_t end_cmd = {
|
||||
.common = {
|
||||
.direction = WRITE_DIRECTION,
|
||||
.command = FLASH_END,
|
||||
.size = CMD_SIZE(end_cmd),
|
||||
.checksum = 0
|
||||
},
|
||||
.stay_in_loader = stay_in_loader
|
||||
};
|
||||
|
||||
return send_cmd(&end_cmd, sizeof(end_cmd), NULL);
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t loader_mem_begin_cmd(uint32_t offset, uint32_t size, uint32_t blocks_to_write, uint32_t block_size)
|
||||
{
|
||||
|
||||
mem_begin_command_t mem_begin_cmd = {
|
||||
.common = {
|
||||
.direction = WRITE_DIRECTION,
|
||||
.command = MEM_BEGIN,
|
||||
.size = CMD_SIZE(mem_begin_cmd),
|
||||
.checksum = 0
|
||||
},
|
||||
.total_size = size,
|
||||
.blocks = blocks_to_write,
|
||||
.block_size = block_size,
|
||||
.offset = offset
|
||||
};
|
||||
|
||||
s_sequence_number = 0;
|
||||
|
||||
return send_cmd(&mem_begin_cmd, sizeof(mem_begin_cmd), NULL);
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t loader_mem_data_cmd(const uint8_t *data, uint32_t size)
|
||||
{
|
||||
data_command_t data_cmd = {
|
||||
.common = {
|
||||
.direction = WRITE_DIRECTION,
|
||||
.command = MEM_DATA,
|
||||
.size = CMD_SIZE(data_cmd) + size,
|
||||
.checksum = compute_checksum(data, size)
|
||||
},
|
||||
.data_size = size,
|
||||
.sequence_number = s_sequence_number++,
|
||||
};
|
||||
return send_cmd_with_data(&data_cmd, sizeof(data_cmd), data, size);
|
||||
}
|
||||
|
||||
esp_loader_error_t loader_mem_end_cmd(uint32_t entrypoint)
|
||||
{
|
||||
mem_end_command_t end_cmd = {
|
||||
.common = {
|
||||
.direction = WRITE_DIRECTION,
|
||||
.command = MEM_END,
|
||||
.size = CMD_SIZE(end_cmd),
|
||||
},
|
||||
.stay_in_loader = (entrypoint == 0),
|
||||
.entry_point_address = entrypoint
|
||||
};
|
||||
|
||||
return send_cmd(&end_cmd, sizeof(end_cmd), NULL);
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t loader_sync_cmd(void)
|
||||
{
|
||||
sync_command_t sync_cmd = {
|
||||
.common = {
|
||||
.direction = WRITE_DIRECTION,
|
||||
.command = SYNC,
|
||||
.size = CMD_SIZE(sync_cmd),
|
||||
.checksum = 0
|
||||
},
|
||||
.sync_sequence = {
|
||||
0x07, 0x07, 0x12, 0x20,
|
||||
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
|
||||
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
|
||||
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
|
||||
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
|
||||
}
|
||||
};
|
||||
|
||||
return send_cmd(&sync_cmd, sizeof(sync_cmd), NULL);
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t loader_write_reg_cmd(uint32_t address, uint32_t value,
|
||||
uint32_t mask, uint32_t delay_us)
|
||||
{
|
||||
write_reg_command_t write_cmd = {
|
||||
.common = {
|
||||
.direction = WRITE_DIRECTION,
|
||||
.command = WRITE_REG,
|
||||
.size = CMD_SIZE(write_cmd),
|
||||
.checksum = 0
|
||||
},
|
||||
.address = address,
|
||||
.value = value,
|
||||
.mask = mask,
|
||||
.delay_us = delay_us
|
||||
};
|
||||
|
||||
return send_cmd(&write_cmd, sizeof(write_cmd), NULL);
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t loader_read_reg_cmd(uint32_t address, uint32_t *reg)
|
||||
{
|
||||
read_reg_command_t read_cmd = {
|
||||
.common = {
|
||||
.direction = WRITE_DIRECTION,
|
||||
.command = READ_REG,
|
||||
.size = CMD_SIZE(read_cmd),
|
||||
.checksum = 0
|
||||
},
|
||||
.address = address,
|
||||
};
|
||||
|
||||
return send_cmd(&read_cmd, sizeof(read_cmd), reg);
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t loader_spi_attach_cmd(uint32_t config)
|
||||
{
|
||||
spi_attach_command_t attach_cmd = {
|
||||
.common = {
|
||||
.direction = WRITE_DIRECTION,
|
||||
.command = SPI_ATTACH,
|
||||
.size = CMD_SIZE(attach_cmd),
|
||||
.checksum = 0
|
||||
},
|
||||
.configuration = config,
|
||||
.zero = 0
|
||||
};
|
||||
|
||||
return send_cmd(&attach_cmd, sizeof(attach_cmd), NULL);
|
||||
}
|
||||
|
||||
esp_loader_error_t loader_change_baudrate_cmd(uint32_t baudrate)
|
||||
{
|
||||
change_baudrate_command_t baudrate_cmd = {
|
||||
.common = {
|
||||
.direction = WRITE_DIRECTION,
|
||||
.command = CHANGE_BAUDRATE,
|
||||
.size = CMD_SIZE(baudrate_cmd),
|
||||
.checksum = 0
|
||||
},
|
||||
.new_baudrate = baudrate,
|
||||
.old_baudrate = 0 // ESP32 ROM only
|
||||
};
|
||||
|
||||
return send_cmd(&baudrate_cmd, sizeof(baudrate_cmd), NULL);
|
||||
}
|
||||
|
||||
esp_loader_error_t loader_md5_cmd(uint32_t address, uint32_t size, uint8_t *md5_out)
|
||||
{
|
||||
spi_flash_md5_command_t md5_cmd = {
|
||||
.common = {
|
||||
.direction = WRITE_DIRECTION,
|
||||
.command = SPI_FLASH_MD5,
|
||||
.size = CMD_SIZE(md5_cmd),
|
||||
.checksum = 0
|
||||
},
|
||||
.address = address,
|
||||
.size = size,
|
||||
.reserved_0 = 0,
|
||||
.reserved_1 = 0
|
||||
};
|
||||
|
||||
return send_cmd_md5(&md5_cmd, sizeof(md5_cmd), md5_out);
|
||||
}
|
||||
|
||||
esp_loader_error_t loader_spi_parameters(uint32_t total_size)
|
||||
{
|
||||
write_spi_command_t spi_cmd = {
|
||||
.common = {
|
||||
.direction = WRITE_DIRECTION,
|
||||
.command = SPI_SET_PARAMS,
|
||||
.size = 24,
|
||||
.checksum = 0
|
||||
},
|
||||
.id = 0,
|
||||
.total_size = total_size,
|
||||
.block_size = 64 * 1024,
|
||||
.sector_size = 4 * 1024,
|
||||
.page_size = 0x100,
|
||||
.status_mask = 0xFFFF,
|
||||
};
|
||||
|
||||
return send_cmd(&spi_cmd, sizeof(spi_cmd), NULL);
|
||||
}
|
||||
|
||||
__attribute__ ((weak)) void loader_port_debug_print(const char *str)
|
||||
{
|
||||
(void)(str);
|
||||
}
|
||||
312
applications/external/esp_flasher/lib/esp-serial-flasher/src/protocol_spi.c
vendored
Normal file
312
applications/external/esp_flasher/lib/esp-serial-flasher/src/protocol_spi.c
vendored
Normal file
@@ -0,0 +1,312 @@
|
||||
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "protocol.h"
|
||||
#include "protocol_prv.h"
|
||||
#include "esp_loader_io.h"
|
||||
#include <stddef.h>
|
||||
#include <assert.h>
|
||||
|
||||
typedef struct __attribute__((packed)) {
|
||||
uint8_t cmd;
|
||||
uint8_t addr;
|
||||
uint8_t dummy;
|
||||
} transaction_preamble_t;
|
||||
|
||||
typedef enum {
|
||||
TRANS_CMD_WRBUF = 0x01,
|
||||
TRANS_CMD_RDBUF = 0x02,
|
||||
TRANS_CMD_WRDMA = 0x03,
|
||||
TRANS_CMD_RDDMA = 0x04,
|
||||
TRANS_CMD_SEG_DONE = 0x05,
|
||||
TRANS_CMD_ENQPI = 0x06,
|
||||
TRANS_CMD_WR_DONE = 0x07,
|
||||
TRANS_CMD_CMD8 = 0x08,
|
||||
TRANS_CMD_CMD9 = 0x09,
|
||||
TRANS_CMD_CMDA = 0x0A,
|
||||
TRANS_CMD_EXQPI = 0xDD,
|
||||
} transaction_cmd_t;
|
||||
|
||||
/* Slave protocol registers */
|
||||
typedef enum {
|
||||
SLAVE_REGISTER_VER = 0,
|
||||
SLAVE_REGISTER_RXSTA = 4,
|
||||
SLAVE_REGISTER_TXSTA = 8,
|
||||
SLAVE_REGISTER_CMD = 12,
|
||||
} slave_register_addr_t;
|
||||
|
||||
#define SLAVE_STA_TOGGLE_BIT (0x01U << 0)
|
||||
#define SLAVE_STA_INIT_BIT (0x01U << 1)
|
||||
#define SLAVE_STA_BUF_LENGTH_POS 2U
|
||||
|
||||
typedef enum {
|
||||
SLAVE_STATE_INIT = SLAVE_STA_TOGGLE_BIT | SLAVE_STA_INIT_BIT,
|
||||
SLAVE_STATE_FIRST_PACKET = SLAVE_STA_INIT_BIT,
|
||||
} slave_state_t;
|
||||
|
||||
typedef enum {
|
||||
/* Target to host */
|
||||
SLAVE_CMD_IDLE = 0xAA,
|
||||
SLAVE_CMD_READY = 0xA5,
|
||||
/* Host to target */
|
||||
SLAVE_CMD_REBOOT = 0xFE,
|
||||
SLAVE_CMD_COMM_REINIT = 0x5A,
|
||||
SLAVE_CMD_DONE = 0x55,
|
||||
} slave_cmd_t;
|
||||
|
||||
static uint8_t s_slave_seq_tx;
|
||||
static uint8_t s_slave_seq_rx;
|
||||
|
||||
static esp_loader_error_t write_slave_reg(const uint8_t *data, const uint32_t addr,
|
||||
const uint8_t size);
|
||||
static esp_loader_error_t read_slave_reg(uint8_t *out_data, const uint32_t addr,
|
||||
const uint8_t size);
|
||||
static esp_loader_error_t handle_slave_state(const uint32_t status_reg_addr, uint8_t *seq_state,
|
||||
bool *slave_ready, uint32_t *buf_size);
|
||||
static esp_loader_error_t check_response(command_t cmd, uint32_t *reg_value);
|
||||
|
||||
esp_loader_error_t loader_initialize_conn(esp_loader_connect_args_t *connect_args)
|
||||
{
|
||||
for (uint8_t trial = 0; trial < connect_args->trials; trial++) {
|
||||
uint8_t slave_ready_flag;
|
||||
RETURN_ON_ERROR(read_slave_reg(&slave_ready_flag, SLAVE_REGISTER_CMD,
|
||||
sizeof(slave_ready_flag)));
|
||||
|
||||
if (slave_ready_flag != SLAVE_CMD_IDLE) {
|
||||
loader_port_debug_print("Waiting for Slave to be idle...\n");
|
||||
loader_port_delay_ms(100);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const uint8_t reg_val = SLAVE_CMD_READY;
|
||||
RETURN_ON_ERROR(write_slave_reg(®_val, SLAVE_REGISTER_CMD, sizeof(reg_val)));
|
||||
|
||||
for (uint8_t trial = 0; trial < connect_args->trials; trial++) {
|
||||
uint8_t slave_ready_flag;
|
||||
RETURN_ON_ERROR(read_slave_reg(&slave_ready_flag, SLAVE_REGISTER_CMD,
|
||||
sizeof(slave_ready_flag)));
|
||||
|
||||
if (slave_ready_flag != SLAVE_CMD_READY) {
|
||||
loader_port_debug_print("Waiting for Slave to be ready...\n");
|
||||
loader_port_delay_ms(100);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t send_cmd(const void *cmd_data, uint32_t size, uint32_t *reg_value)
|
||||
{
|
||||
command_t command = ((const command_common_t *)cmd_data)->command;
|
||||
|
||||
uint32_t buf_size;
|
||||
bool slave_ready = false;
|
||||
while (!slave_ready) {
|
||||
RETURN_ON_ERROR(handle_slave_state(SLAVE_REGISTER_RXSTA, &s_slave_seq_rx, &slave_ready,
|
||||
&buf_size));
|
||||
}
|
||||
|
||||
if (size > buf_size) {
|
||||
return ESP_LOADER_ERROR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
/* Start and write the command */
|
||||
transaction_preamble_t preamble = {.cmd = TRANS_CMD_WRDMA};
|
||||
|
||||
loader_port_spi_set_cs(0);
|
||||
RETURN_ON_ERROR(loader_port_write((const uint8_t *)&preamble, sizeof(preamble),
|
||||
loader_port_remaining_time()));
|
||||
RETURN_ON_ERROR(loader_port_write((const uint8_t *)cmd_data, size,
|
||||
loader_port_remaining_time()));
|
||||
loader_port_spi_set_cs(1);
|
||||
|
||||
/* Terminate the write */
|
||||
loader_port_spi_set_cs(0);
|
||||
preamble.cmd = TRANS_CMD_WR_DONE;
|
||||
RETURN_ON_ERROR(loader_port_write((const uint8_t *)&preamble, sizeof(preamble),
|
||||
loader_port_remaining_time()));
|
||||
loader_port_spi_set_cs(1);
|
||||
|
||||
return check_response(command, reg_value);
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t send_cmd_with_data(const void *cmd_data, size_t cmd_size,
|
||||
const void *data, size_t data_size)
|
||||
{
|
||||
uint32_t buf_size;
|
||||
bool slave_ready = false;
|
||||
while (!slave_ready) {
|
||||
RETURN_ON_ERROR(handle_slave_state(SLAVE_REGISTER_RXSTA, &s_slave_seq_rx, &slave_ready,
|
||||
&buf_size));
|
||||
}
|
||||
|
||||
if (cmd_size + data_size > buf_size) {
|
||||
return ESP_LOADER_ERROR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
/* Start and write the command and the data */
|
||||
transaction_preamble_t preamble = {.cmd = TRANS_CMD_WRDMA};
|
||||
|
||||
loader_port_spi_set_cs(0);
|
||||
RETURN_ON_ERROR(loader_port_write((const uint8_t *)&preamble, sizeof(preamble),
|
||||
loader_port_remaining_time()));
|
||||
RETURN_ON_ERROR(loader_port_write((const uint8_t *)cmd_data, cmd_size,
|
||||
loader_port_remaining_time()));
|
||||
RETURN_ON_ERROR(loader_port_write((const uint8_t *)data, data_size,
|
||||
loader_port_remaining_time()));
|
||||
loader_port_spi_set_cs(1);
|
||||
|
||||
/* Terminate the write */
|
||||
loader_port_spi_set_cs(0);
|
||||
preamble.cmd = TRANS_CMD_WR_DONE;
|
||||
RETURN_ON_ERROR(loader_port_write((const uint8_t *)&preamble, sizeof(preamble),
|
||||
loader_port_remaining_time()));
|
||||
loader_port_spi_set_cs(1);
|
||||
|
||||
command_t command = ((const command_common_t *)cmd_data)->command;
|
||||
return check_response(command, NULL);
|
||||
}
|
||||
|
||||
|
||||
static esp_loader_error_t read_slave_reg(uint8_t *out_data, const uint32_t addr,
|
||||
const uint8_t size)
|
||||
{
|
||||
transaction_preamble_t preamble = {
|
||||
.cmd = TRANS_CMD_RDBUF,
|
||||
.addr = addr,
|
||||
};
|
||||
|
||||
loader_port_spi_set_cs(0);
|
||||
RETURN_ON_ERROR(loader_port_write((const uint8_t *)&preamble, sizeof(preamble),
|
||||
loader_port_remaining_time()));
|
||||
RETURN_ON_ERROR(loader_port_read(out_data, size, loader_port_remaining_time()));
|
||||
loader_port_spi_set_cs(1);
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static esp_loader_error_t write_slave_reg(const uint8_t *data, const uint32_t addr,
|
||||
const uint8_t size)
|
||||
{
|
||||
transaction_preamble_t preamble = {
|
||||
.cmd = TRANS_CMD_WRBUF,
|
||||
.addr = addr,
|
||||
};
|
||||
|
||||
loader_port_spi_set_cs(0);
|
||||
RETURN_ON_ERROR(loader_port_write((const uint8_t *)&preamble, sizeof(preamble),
|
||||
loader_port_remaining_time()));
|
||||
RETURN_ON_ERROR(loader_port_write(data, size, loader_port_remaining_time()));
|
||||
loader_port_spi_set_cs(1);
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static esp_loader_error_t handle_slave_state(const uint32_t status_reg_addr, uint8_t *seq_state,
|
||||
bool *slave_ready, uint32_t *buf_size)
|
||||
{
|
||||
uint32_t status_reg;
|
||||
RETURN_ON_ERROR(read_slave_reg((uint8_t *)&status_reg, status_reg_addr,
|
||||
sizeof(status_reg)));
|
||||
const slave_state_t state = status_reg & (SLAVE_STA_TOGGLE_BIT | SLAVE_STA_INIT_BIT);
|
||||
|
||||
switch(state) {
|
||||
case SLAVE_STATE_INIT: {
|
||||
const uint32_t initial = 0U;
|
||||
RETURN_ON_ERROR(write_slave_reg((uint8_t *)&initial, status_reg_addr, sizeof(initial)));
|
||||
break;
|
||||
}
|
||||
|
||||
case SLAVE_STATE_FIRST_PACKET: {
|
||||
*seq_state = state & SLAVE_STA_TOGGLE_BIT;
|
||||
*buf_size = status_reg >> SLAVE_STA_BUF_LENGTH_POS;
|
||||
*slave_ready = true;
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
const uint8_t new_seq = state & SLAVE_STA_TOGGLE_BIT;
|
||||
if (new_seq != *seq_state) {
|
||||
*seq_state = new_seq;
|
||||
*buf_size = status_reg >> SLAVE_STA_BUF_LENGTH_POS;
|
||||
*slave_ready = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static esp_loader_error_t check_response(command_t cmd, uint32_t *reg_value)
|
||||
{
|
||||
response_t resp;
|
||||
|
||||
uint32_t buf_size;
|
||||
bool slave_ready = false;
|
||||
while (!slave_ready) {
|
||||
RETURN_ON_ERROR(handle_slave_state(SLAVE_REGISTER_TXSTA, &s_slave_seq_tx, &slave_ready,
|
||||
&buf_size));
|
||||
}
|
||||
|
||||
if (sizeof(resp) > buf_size) {
|
||||
return ESP_LOADER_ERROR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
transaction_preamble_t preamble = {
|
||||
.cmd = TRANS_CMD_RDDMA,
|
||||
};
|
||||
|
||||
loader_port_spi_set_cs(0);
|
||||
RETURN_ON_ERROR(loader_port_write((const uint8_t *)&preamble, sizeof(preamble),
|
||||
loader_port_remaining_time()));
|
||||
RETURN_ON_ERROR(loader_port_read((uint8_t *)&resp, sizeof(resp),
|
||||
loader_port_remaining_time()));
|
||||
loader_port_spi_set_cs(1);
|
||||
|
||||
/* Terminate the read */
|
||||
loader_port_spi_set_cs(0);
|
||||
preamble.cmd = TRANS_CMD_CMD8;
|
||||
RETURN_ON_ERROR(loader_port_write((const uint8_t *)&preamble, sizeof(preamble),
|
||||
loader_port_remaining_time()));
|
||||
loader_port_spi_set_cs(1);
|
||||
|
||||
common_response_t *common = (common_response_t *)&resp;
|
||||
if ((common->direction != READ_DIRECTION) || (common->command != cmd)) {
|
||||
return ESP_LOADER_ERROR_INVALID_RESPONSE;
|
||||
}
|
||||
|
||||
response_status_t *status =
|
||||
(response_status_t *)((uint8_t *)&resp + sizeof(resp) - sizeof(response_status_t));
|
||||
if (status->failed) {
|
||||
log_loader_internal_error(status->error);
|
||||
return ESP_LOADER_ERROR_INVALID_RESPONSE;
|
||||
}
|
||||
|
||||
if (reg_value != NULL) {
|
||||
*reg_value = common->value;
|
||||
}
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
114
applications/external/esp_flasher/lib/esp-serial-flasher/src/protocol_uart.c
vendored
Normal file
114
applications/external/esp_flasher/lib/esp-serial-flasher/src/protocol_uart.c
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "protocol.h"
|
||||
#include "protocol_prv.h"
|
||||
#include "esp_loader_io.h"
|
||||
#include "slip.h"
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
static esp_loader_error_t check_response(command_t cmd, uint32_t *reg_value, void* resp, uint32_t resp_size);
|
||||
|
||||
esp_loader_error_t loader_initialize_conn(esp_loader_connect_args_t *connect_args) {
|
||||
esp_loader_error_t err;
|
||||
int32_t trials = connect_args->trials;
|
||||
|
||||
do {
|
||||
loader_port_start_timer(connect_args->sync_timeout);
|
||||
err = loader_sync_cmd();
|
||||
if (err == ESP_LOADER_ERROR_TIMEOUT) {
|
||||
if (--trials == 0) {
|
||||
return ESP_LOADER_ERROR_TIMEOUT;
|
||||
}
|
||||
loader_port_delay_ms(100);
|
||||
} else if (err != ESP_LOADER_SUCCESS) {
|
||||
return err;
|
||||
}
|
||||
} while (err != ESP_LOADER_SUCCESS);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
esp_loader_error_t send_cmd(const void *cmd_data, uint32_t size, uint32_t *reg_value)
|
||||
{
|
||||
response_t response;
|
||||
command_t command = ((const command_common_t *)cmd_data)->command;
|
||||
|
||||
RETURN_ON_ERROR( SLIP_send_delimiter() );
|
||||
RETURN_ON_ERROR( SLIP_send((const uint8_t *)cmd_data, size) );
|
||||
RETURN_ON_ERROR( SLIP_send_delimiter() );
|
||||
|
||||
return check_response(command, reg_value, &response, sizeof(response));
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t send_cmd_with_data(const void *cmd_data, size_t cmd_size,
|
||||
const void *data, size_t data_size)
|
||||
{
|
||||
response_t response;
|
||||
command_t command = ((const command_common_t *)cmd_data)->command;
|
||||
|
||||
RETURN_ON_ERROR( SLIP_send_delimiter() );
|
||||
RETURN_ON_ERROR( SLIP_send((const uint8_t *)cmd_data, cmd_size) );
|
||||
RETURN_ON_ERROR( SLIP_send(data, data_size) );
|
||||
RETURN_ON_ERROR( SLIP_send_delimiter() );
|
||||
|
||||
return check_response(command, NULL, &response, sizeof(response));
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t send_cmd_md5(const void *cmd_data, size_t cmd_size, uint8_t md5_out[MD5_SIZE])
|
||||
{
|
||||
rom_md5_response_t response;
|
||||
command_t command = ((const command_common_t *)cmd_data)->command;
|
||||
|
||||
RETURN_ON_ERROR( SLIP_send_delimiter() );
|
||||
RETURN_ON_ERROR( SLIP_send((const uint8_t *)cmd_data, cmd_size) );
|
||||
RETURN_ON_ERROR( SLIP_send_delimiter() );
|
||||
|
||||
RETURN_ON_ERROR( check_response(command, NULL, &response, sizeof(response)) );
|
||||
|
||||
memcpy(md5_out, response.md5, MD5_SIZE);
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static esp_loader_error_t check_response(command_t cmd, uint32_t *reg_value, void* resp, uint32_t resp_size)
|
||||
{
|
||||
esp_loader_error_t err;
|
||||
common_response_t *response = (common_response_t *)resp;
|
||||
|
||||
do {
|
||||
err = SLIP_receive_packet(resp, resp_size);
|
||||
if (err != ESP_LOADER_SUCCESS) {
|
||||
return err;
|
||||
}
|
||||
} while ((response->direction != READ_DIRECTION) || (response->command != cmd));
|
||||
|
||||
response_status_t *status = (response_status_t *)((uint8_t *)resp + resp_size - sizeof(response_status_t));
|
||||
|
||||
if (status->failed) {
|
||||
log_loader_internal_error(status->error);
|
||||
return ESP_LOADER_ERROR_INVALID_RESPONSE;
|
||||
}
|
||||
|
||||
if (reg_value != NULL) {
|
||||
*reg_value = response->value;
|
||||
}
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
125
applications/external/esp_flasher/lib/esp-serial-flasher/src/slip.c
vendored
Normal file
125
applications/external/esp_flasher/lib/esp-serial-flasher/src/slip.c
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
/* Copyright 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "slip.h"
|
||||
#include "esp_loader_io.h"
|
||||
|
||||
static const uint8_t DELIMITER = 0xC0;
|
||||
static const uint8_t C0_REPLACEMENT[2] = {0xDB, 0xDC};
|
||||
static const uint8_t DB_REPLACEMENT[2] = {0xDB, 0xDD};
|
||||
|
||||
static inline esp_loader_error_t peripheral_read(uint8_t *buff, const size_t size)
|
||||
{
|
||||
return loader_port_read(buff, size, loader_port_remaining_time());
|
||||
}
|
||||
|
||||
static inline esp_loader_error_t peripheral_write(const uint8_t *buff, const size_t size)
|
||||
{
|
||||
return loader_port_write(buff, size, loader_port_remaining_time());
|
||||
}
|
||||
|
||||
esp_loader_error_t SLIP_receive_data(uint8_t *buff, const size_t size)
|
||||
{
|
||||
uint8_t ch;
|
||||
|
||||
for (uint32_t i = 0; i < size; i++) {
|
||||
RETURN_ON_ERROR( peripheral_read(&ch, 1) );
|
||||
|
||||
if (ch == 0xDB) {
|
||||
RETURN_ON_ERROR( peripheral_read(&ch, 1) );
|
||||
if (ch == 0xDC) {
|
||||
buff[i] = 0xC0;
|
||||
} else if (ch == 0xDD) {
|
||||
buff[i] = 0xDB;
|
||||
} else {
|
||||
return ESP_LOADER_ERROR_INVALID_RESPONSE;
|
||||
}
|
||||
} else {
|
||||
buff[i] = ch;
|
||||
}
|
||||
}
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t SLIP_receive_packet(uint8_t *buff, const size_t size)
|
||||
{
|
||||
uint8_t ch;
|
||||
|
||||
// Wait for delimiter
|
||||
do {
|
||||
RETURN_ON_ERROR( peripheral_read(&ch, 1) );
|
||||
} while (ch != DELIMITER);
|
||||
|
||||
// Workaround: bootloader sends two dummy(0xC0) bytes after response when baud rate is changed.
|
||||
do {
|
||||
RETURN_ON_ERROR( peripheral_read(&ch, 1) );
|
||||
} while (ch == DELIMITER);
|
||||
|
||||
buff[0] = ch;
|
||||
|
||||
RETURN_ON_ERROR( SLIP_receive_data(&buff[1], size - 1) );
|
||||
|
||||
// Wait for delimiter
|
||||
do {
|
||||
RETURN_ON_ERROR( peripheral_read(&ch, 1) );
|
||||
} while (ch != DELIMITER);
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t SLIP_send(const uint8_t *data, const size_t size)
|
||||
{
|
||||
uint32_t to_write = 0; // Bytes ready to write as they are
|
||||
uint32_t written = 0; // Bytes already written
|
||||
|
||||
for (uint32_t i = 0; i < size; i++) {
|
||||
if (data[i] != 0xC0 && data[i] != 0xDB) {
|
||||
to_write++; // Queue this byte for writing
|
||||
continue;
|
||||
}
|
||||
|
||||
// We have a byte that needs encoding, write the queue first
|
||||
if (to_write > 0) {
|
||||
RETURN_ON_ERROR( peripheral_write(&data[written], to_write) );
|
||||
}
|
||||
|
||||
// Write the encoded byte
|
||||
if (data[i] == 0xC0) {
|
||||
RETURN_ON_ERROR( peripheral_write(C0_REPLACEMENT, 2) );
|
||||
} else {
|
||||
RETURN_ON_ERROR( peripheral_write(DB_REPLACEMENT, 2) );
|
||||
}
|
||||
|
||||
// Update to start again after the encoded byte
|
||||
written = i + 1;
|
||||
to_write = 0;
|
||||
}
|
||||
|
||||
// Write the rest of the bytes that didn't need encoding
|
||||
if (to_write > 0) {
|
||||
RETURN_ON_ERROR( peripheral_write(&data[written], to_write) );
|
||||
}
|
||||
|
||||
return ESP_LOADER_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
esp_loader_error_t SLIP_send_delimiter(void)
|
||||
{
|
||||
return peripheral_write(&DELIMITER, 1);
|
||||
}
|
||||
20
applications/external/esp_flasher/lib/esp-serial-flasher/submodules/CMakeLists.txt
vendored
Normal file
20
applications/external/esp_flasher/lib/esp-serial-flasher/submodules/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/stm32-cmake/cmake/gcc_stm32.cmake)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/stm32-cmake/cmake)
|
||||
|
||||
find_package(CMSIS REQUIRED)
|
||||
find_package(STM32HAL COMPONENTS gpio tim uart REQUIRED)
|
||||
|
||||
add_library(stm_cube_impl ${CMSIS_SOURCES} ${STM32HAL_SOURCES})
|
||||
target_include_directories(stm_cube_impl PUBLIC ${CMSIS_INCLUDE_DIRS} ${STM32HAL_INCLUDE_DIR})
|
||||
stm32_set_target_properties(stm_cube_impl)
|
||||
|
||||
# stm_cube target is made to propagate properties of stm_cube_impl, as stm32_set_target_properties
|
||||
# sets properties privately for given target. This eliminates need to call stm32_set_target_properties
|
||||
# on every target that links against STM32HAL.
|
||||
add_library(stm_cube INTERFACE)
|
||||
target_link_libraries(stm_cube INTERFACE stm_cube_impl)
|
||||
target_compile_definitions(stm_cube INTERFACE $<TARGET_PROPERTY:stm_cube_impl,COMPILE_DEFINITIONS>)
|
||||
target_link_options(stm_cube INTERFACE -T${CMAKE_CURRENT_BINARY_DIR}/stm_cube_impl_flash.ld)
|
||||
30
applications/external/esp_flasher/lib/esp-serial-flasher/zephyr/CMakeLists.txt
vendored
Normal file
30
applications/external/esp_flasher/lib/esp-serial-flasher/zephyr/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
if (CONFIG_ESP_SERIAL_FLASHER)
|
||||
zephyr_include_directories(
|
||||
"${ZEPHYR_CURRENT_MODULE_DIR}/include"
|
||||
"${ZEPHYR_CURRENT_MODULE_DIR}/port"
|
||||
"${ZEPHYR_CURRENT_MODULE_DIR}/private_include"
|
||||
)
|
||||
|
||||
zephyr_interface_library_named(esp_flasher)
|
||||
|
||||
zephyr_library()
|
||||
|
||||
zephyr_library_sources(${ZEPHYR_CURRENT_MODULE_DIR}/src/esp_loader.c
|
||||
${ZEPHYR_CURRENT_MODULE_DIR}/src/esp_targets.c
|
||||
${ZEPHYR_CURRENT_MODULE_DIR}/src/protocol_common.c
|
||||
${ZEPHYR_CURRENT_MODULE_DIR}/src/protocol_uart.c
|
||||
${ZEPHYR_CURRENT_MODULE_DIR}/src/slip.c
|
||||
${ZEPHYR_CURRENT_MODULE_DIR}/src/md5_hash.c
|
||||
${ZEPHYR_CURRENT_MODULE_DIR}/port/zephyr_port.c
|
||||
)
|
||||
|
||||
target_compile_definitions(esp_flasher INTERFACE SERIAL_FLASHER_INTERFACE_UART)
|
||||
|
||||
zephyr_library_link_libraries(esp_flasher)
|
||||
|
||||
if(DEFINED MD5_ENABLED OR CONFIG_SERIAL_FLASHER_MD5_ENABLED)
|
||||
target_compile_definitions(esp_flasher INTERFACE -DMD5_ENABLED=1)
|
||||
endif()
|
||||
endif()
|
||||
16
applications/external/esp_flasher/lib/esp-serial-flasher/zephyr/Kconfig
vendored
Normal file
16
applications/external/esp_flasher/lib/esp-serial-flasher/zephyr/Kconfig
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
config ESP_SERIAL_FLASHER
|
||||
bool "Enable ESP serial flasher library"
|
||||
default y
|
||||
select CONSOLE_SUBSYS
|
||||
help
|
||||
Select this option to enable the ESP serial flasher library.
|
||||
|
||||
config ESP_SERIAL_FLASHER_UART_BUFSIZE
|
||||
int "ESP Serial Flasher UART buffer size"
|
||||
default 512
|
||||
help
|
||||
Buffer size for UART TX and RX packets
|
||||
|
||||
if ESP_SERIAL_FLASHER
|
||||
rsource "../Kconfig"
|
||||
endif
|
||||
5
applications/external/esp_flasher/lib/esp-serial-flasher/zephyr/module.yml
vendored
Normal file
5
applications/external/esp_flasher/lib/esp-serial-flasher/zephyr/module.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
name: esp-flasher
|
||||
|
||||
build:
|
||||
cmake: zephyr
|
||||
kconfig: zephyr/Kconfig
|
||||
Reference in New Issue
Block a user