Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stm32_get_memory_info : FAMILY field is no longer required to get the ram size #345

Merged
merged 1 commit into from
Jul 12, 2024
Merged

Conversation

ciuzhienki
Copy link
Contributor

The RAM size returned by stm32_get_memory_info is always 0. Replace "FAMILY" to "INFO_FAMILY" to fix.

@Hish15
Copy link
Collaborator

Hish15 commented Jul 7, 2024

I ran

cd /tests/cmsis
cmake -B build -DTEST_FAMILIES=F4

and got something ending with

-- STM32F479ZG: F4 family, type F479xx, 1024K flash, 320K RAM
-- STM32F479ZI: F4 family, type F479xx, 2048K flash, 320K RAM

This is the expected output. In fact a quick debug shows that FAMILY and INFO_FAMILY hold the same value.

Can you describe what you did to get a ram size of zero please ?

@ciuzhienki
Copy link
Contributor Author

I did not set the FAMILY variable, it shouldn't be necessary:

cmake_minimum_required(VERSION 3.30)
project(test-ram-size-output-of-stm32_get_memory_info)

set(CHIP "STM32F103CB" CACHE STRING "stm32 chip name in uppercase like STM32F103CB")

include(FetchContent)

set(STM32_TARGET_TRIPLET "arm-none-eabi")
FetchContent_Declare(
    stm32-cmake
    GIT_REPOSITORY https://github.com/ObKo/stm32-cmake.git
    GIT_TAG        origin/master
    GIT_SHALLOW    1
    FIND_PACKAGE_ARGS NAMES stm32-cmake
)
FetchContent_MakeAvailable(stm32-cmake)

include("${stm32-cmake_SOURCE_DIR}/cmake/stm32_gcc.cmake")

stm32_get_memory_info(CHIP "${CHIP}" RAM SIZE CHIP_RAM_SIZE)

message("RAM size: ${CHIP_RAM_SIZE}")

@Hish15 Hish15 changed the title Fix RAM size output of stm32_get_memory_info stm32_get_memory_info : FAMILY field is no longer required to get the ram size Jul 12, 2024
@Hish15 Hish15 merged commit 5f5c92c into ObKo:master Jul 12, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants