ObKo / stm32-cmake

CMake for stm32 developing.
MIT License
1.16k stars 334 forks source link

STM32F746G-DISCO Unsupported #51

Closed pymaximus closed 7 years ago

pymaximus commented 7 years ago

First of all, thanks for this project, it definitely helps my projects !!

Testing with a STM32 F7 Discovery board with STM32F746NGH6 MCU and cmake things its a 765xx device.

23:22 $ cmake -DSTM32_CHIP=STM32F746NG -DCMAKE_TOOLCHAIN_FILE=/Users/frank/other_repos/stm32-cmake/cmake/gcc_stm32.cmake -DCMAKE_BUILD_TYPE=Debug ../ -- No TARGET_TRIPLET specified, using default: arm-none-eabi -- No STM32_FAMILY specified, trying to get it from STM32_CHIP -- Selected STM32 family: F7 -- STM32F746NG is 765xx device

If I make the following change

diff --git a/cmake/gcc_stm32f7.cmake b/cmake/gcc_stm32f7.cmake index 910795c..0bfb256 100644 --- a/cmake/gcc_stm32f7.cmake +++ b/cmake/gcc_stm32f7.cmake @@ -5,7 +5,7 @@ SET(CMAKE_ASM_FLAGS "-mthumb -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=softf SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections -mthumb -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=softfp -mabi=aapcs" CACHE INTERNAL "executable linker flags") SET(CMAKE_MODULE_LINKER_FLAGS "-mthumb -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=softfp -mabi=aapcs" CACHE INTERNAL "module linker flags") SET(CMAKE_SHARED_LINKER_FLAGS "-mthumb -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=softfp -mabi=aapcs" CACHE INTERNAL "shared linker flags") -SET(STM32_CHIP_TYPES 745xx 765xx 756xx 767xx 777xx 769xx 779xx CACHE INTERNAL "stm32f4 chip types") +SET(STM32_CHIP_TYPES 745xx 746xx 756xx 767xx 777xx 769xx 779xx CACHE INTERNAL "stm32f4 chip types") SET(STM32_CODES "745.." "746.." "756.." "767.." "777.." "769.." "779..")

ie: change the 765xx into 746xx in STM32_CHIP_TYPES then all is well.

✔ ~/repos/stm32f746G_disco_TIM_TimeBase/build 00:15 $ cmake -DSTM32_CHIP=STM32F746NG -DCMAKE_TOOLCHAIN_FILE=/Users/frank/other_repos/stm32-cmake/cmake/gcc_stm32.cmake -DCMAKE_BUILD_TYPE=Debug ../ -- No TARGET_TRIPLET specified, using default: arm-none-eabi -- No STM32_FAMILY specified, trying to get it from STM32_CHIP -- Selected STM32 family: F7 -- The C compiler identification is GNU 6.3.1 -- The CXX compiler identification is GNU 6.3.1 -- Check for working C compiler: /Users/frank/opt/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc -- Check for working C compiler: /Users/frank/opt/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /Users/frank/opt/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-g++ -- Check for working CXX compiler: /Users/frank/opt/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-g++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- The ASM compiler identification is GNU -- Found assembler: /Users/frank/opt/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc -- STM32F746NG is 746xx device -- Found CMSIS: /Users/frank/STM32Cube/Repository/STM32Cube_FW_F7_V1.7.0/Drivers/CMSIS/Device/ST/STM32F7xx/Include;/Users/frank/STM32Cube/Repository/STM32Cube_FW_F7_V1.7.0/Drivers/CMSIS/Include
-- Found STM32HAL: /Users/frank/STM32Cube/Repository/STM32Cube_FW_F7_V1.7.0/Drivers/STM32F7xx_HAL_Driver/Inc
-- No linker script specified, generating default -- STM32F746NG has 1024KiB of flash memory and 320KiB of RAM -- Configuring done -- Generating done -- Build files have been written to: /Users/frank/repos/stm32f746G_disco_TIM_TimeBase/build

The flash and ram sizes are correct for this chipset, according to the linker script provided by STM32Cube

00:20 $ grep ORIGIN STM32F746NGHx_FLASH.ld FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 320K

ObKo commented 7 years ago

Thanks for reporting!