antongus / stm32tpl Goto Github PK
View Code? Open in Web Editor NEWSTM32 C++ Template Peripheral Library
License: MIT License
STM32 C++ Template Peripheral Library
License: MIT License
Приветствую!
При компиляции файла pin_stm32F4xx.h с установленным флагом -O0 на этапе линковки получаю следующее сообщение:
E:/ws/NewImpedans/NewCode/build-reader-Cortex-Debug/qtc_Cortex_8a595335-debug/reader.qtc-Cortex-8a595335.825e82ec/.obj/3a52ce780950d4d9/main.cpp.o: In function `Pin<(char)65, 3, (char)72, (PinSpeed)3>::SetPullUp(PullUpMode)':
E:/ws/NewImpedans/NewCode/reader/work/pin_stm32F4xx.h:505: undefined reference to `Pin<(char)65, 3, (char)72, (PinSpeed)3>::BBBits'
E:/ws/NewImpedans/NewCode/reader/work/pin_stm32F4xx.h:505: undefined reference to `Pin<(char)65, 3, (char)72, (PinSpeed)3>::BBBits'
E:/ws/NewImpedans/NewCode/reader/work/pin_stm32F4xx.h:505: undefined reference to `Pin<(char)65, 3, (char)72, (PinSpeed)3>::BBBits'
E:/ws/NewImpedans/NewCode/build-reader-Cortex-Debug/qtc_Cortex_8a595335-debug/reader.qtc-Cortex-8a595335.825e82ec/.obj/3a52ce780950d4d9/main.cpp.o: In function `Pin<(char)65, 2, (char)72, (PinSpeed)3>::SetPullUp(PullUpMode)':
E:/ws/NewImpedans/NewCode/reader/work/pin_stm32F4xx.h:505: undefined reference to `Pin<(char)65, 3, (char)72, (PinSpeed)3>::BBBits'
E:/ws/NewImpedans/NewCode/reader/work/pin_stm32F4xx.h:505: undefined reference to `Pin<(char)65, 2, (char)72, (PinSpeed)3>::BBBits'
E:/ws/NewImpedans/NewCode/reader/work/pin_stm32F4xx.h:505: undefined reference to `Pin<(char)65, 2, (char)72, (PinSpeed)3>::BBBits'
E:/ws/NewImpedans/NewCode/reader/work/pin_stm32F4xx.h:505: undefined reference to `Pin<(char)65, 2, (char)72, (PinSpeed)3>::BBBits'
E:/ws/NewImpedans/NewCode/reader/work/pin_stm32F4xx.h:505: undefined reference to `Pin<(char)65, 2, (char)72, (PinSpeed)3>::BBBits'
E:/ws/NewImpedans/NewCode/build-reader-Cortex-Debug/qtc_Cortex_8a595335-debug/reader.qtc-Cortex-8a595335.825e82ec/.obj/3a52ce780950d4d9/main.cpp.o: In function `main':
E:/ws/NewImpedans/NewCode/reader/main.cpp:55: undefined reference to `Pin<(char)65, 2, (char)72, (PinSpeed)3>::BBBits'
E:/ws/NewImpedans/NewCode/reader/main.cpp:55: undefined reference to `Pin<(char)65, 3, (char)72, (PinSpeed)3>::GPIOx'
E:/ws/NewImpedans/NewCode/reader/main.cpp:55: undefined reference to `Pin<(char)65, 2, (char)72, (PinSpeed)3>::GPIOx'
При установке опции -O1 всё собирается отлично, но нет возможности в отладчике посмотреть некоторые переменные (откуда и появилось -O0).
Кусочек кода, где используется библиотека:
typedef Pin<'A', 3> uart2Rx;
typedef Pin<'A', 2> uart2Tx;
uart2Rx::Mode(ALT_INPUT);
uart2Tx::Mode(ALT_OUTPUT);
uart2Rx::Alternate(ALT_FUNC_USART2);
uart2Tx::Alternate(ALT_FUNC_USART2);
Версия gcc:
Using built-in specs.
COLLECT_GCC=F:\arm4.9\bin\arm-none-eabi-gcc.exe
COLLECT_LTO_WRAPPER=f:/arm4.9/bin/../lib/gcc/arm-none-eabi/4.9.3/lto-wrapper.exe
Target: arm-none-eabi
Configured with: /home/build/work/GCC-4-9-build/src/gcc/configure --build=i686-l inux-gnu --host=i686-w64-mingw32 --target=arm-none-eabi --prefix=/home/build/wor k/GCC-4-9-build/install-mingw --libexecdir=/home/build/work/GCC-4-9-build/instal l-mingw/lib --infodir=/home/build/work/GCC-4-9-build/install-mingw/share/doc/gcc -arm-none-eabi/info --mandir=/home/build/work/GCC-4-9-build/install-mingw/share/ doc/gcc-arm-none-eabi/man --htmldir=/home/build/work/GCC-4-9-build/install-mingw /share/doc/gcc-arm-none-eabi/html --pdfdir=/home/build/work/GCC-4-9-build/instal l-mingw/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --disable-decim al-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libqu admath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared - -disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-headers=yes -- with-newlib --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/home/build /work/GCC-4-9-build/install-mingw/arm-none-eabi --with-libiconv-prefix=/home/bui ld/work/GCC-4-9-build/build-mingw/host-libs/usr --with-gmp=/home/build/work/GCC- 4-9-build/build-mingw/host-libs/usr --with-mpfr=/home/build/work/GCC-4-9-build/b uild-mingw/host-libs/usr --with-mpc=/home/build/work/GCC-4-9-build/build-mingw/h ost-libs/usr --with-isl=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-cloog=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-li belf=/home/build/work/GCC-4-9-build/build-mingw/host-libs/usr --with-host-libstd cxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='GNU Tools for ARM Embedded Processors' --with-multilib-list=armv6-m,armv7-m,armv7e-m ,cortex-m7,armv7-r
Thread model: single
gcc version 4.9.3 20150529 (release) [ARM/embedded-4_9-branch revision 227977] ( GNU Tools for ARM Embedded Processors)
Флаги компиляции:
-g -O0 -Wall -Wextra -Tldscripts/ld.ld "-Wl,--unresolved-symbols=ignore-in-shared-libs" "-mcpu=cortex-m4" "-mfloat-abi=hard" "-mfpu=fpv4-sp-d16" -mthumb -ggdb3 -Xlinker --gc-sections "-Wl,-Map=e:output.map"
В enum'е PinAltFunction названия для USB недостаточно понятные.
Убил вчера весь день, пока не выяснил, что
ALT_FUNC_OTG_FS = 0x0A, // OTG_FS с встроенным трансивером
ALT_FUNC_OTG_HS = 0x0A, // OTG_HS с внешним трансивером
ALT_FUNC_OTG_HS_FS = 0x0C, // OTG HS с встроенным трансивером
Прошу переименовать второй, скажем, в
ALT_FUNC_OTG_HS_ULPI = 0x0A, // OTG_HS с внешним трансивером
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.