Target MCU definition

Sysprogs forums Forums VisualGDB Target MCU definition

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #7790
    karlis77
    Participant

    Hello all.

    When I make a new VisualGDB project, for example, with STM32F051R8 then in the STM32f0xx.h file it shows that the chosen MCU is STM32F051R8 and there are no problems regarding that.

    But when I make project with STM32F030CC then STM32f0xx.h shows that STM32F030 is chosen.

    In both cases in proprocessor macros there is only DEBUG, but I guess that shouldn’t be the problem, because in case of STM32F051R8 everything works fine.

    Also when I make the project I choose the right MCU so there is no mistake in that part too.

    Why this happens? Where in the project can I define which MCU I am using?

    Please help.

     

    #7798
    support
    Keymaster

    Hi,

    The macros that VisualGDB sets for different devices are defined in %LOCALAPPDATA%\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32\BSP.XML .

    We have just checked the one for STM32F030CC and it seems to be defined correctly (see stm32.mak):

    PREPROCESSOR_MACROS += ARM_MATH_CM0 STM32F030CC stm32_flash_layout STM32F030xC

    Could you double-check that you are using the latest BSP v3.5? Does the same problem happen when you create a new project? If yes, could you share the PREPROCESSOR_MACROS line from your stm32.mak?

    #7804
    karlis77
    Participant

    <h5>I checked the stm32.mak file and it differs from the line you wrote. Here is mine:
    PREPROCESSOR_MACROS += ARM_MATH_CM0 STM32F030CC stm32_flash_layout STM32F030</h5>
    <h5>
    If I change the STM32F030 to STM32F030CC in the end of line it still does not work.</h5>
    I guess I am using BSP version 3.3, because this is what I found in BSP file.
    <PackageVersion>3.3</PackageVersion>

    Yes, this same problem happens when I create a new project with this model. It does not happen when I choose STM32F051R8 for example.

    • This reply was modified 8 years, 1 month ago by karlis77.
    #7806
    karlis77
    Participant

    BTW, I just updated my Visual GDB, but it did not update the BSP. It is still version 3.3, and when I choose STM32F030CC for new project, there still is a STM32F030 in the end of preprocessor macros instead of STM32fF030CC

    #7808
    karlis77
    Participant

    I updated BSP to V3.5, but it still does not work.

    This is stm32.mak file of the project

     

    #This file is generated by VisualGDB.
    #It contains GCC settings automatically derived from the board support package (BSP).
    #DO NOT EDIT MANUALLY. THE FILE WILL BE OVERWRITTEN.
    #Use VisualGDB Project Properties dialog or modify Makefile or per-configuration .mak files instead.

    #VisualGDB provides BSP_ROOT and TOOLCHAIN_ROOT via environment when running Make. The line below will only be active if GNU Make is started manually.
    BSP_ROOT ?= $(LOCALAPPDATA)/VisualGDB/EmbeddedBSPs/arm-eabi/com.sysprogs.arm.stm32
    EFP_BASE ?= $(LOCALAPPDATA)/VisualGDB/EmbeddedEFPs
    TOOLCHAIN_ROOT ?= C:/SysGCC/arm-eabi

    #Embedded toolchain
    CC := $(TOOLCHAIN_ROOT)/bin/arm-eabi-gcc.exe
    CXX := $(TOOLCHAIN_ROOT)/bin/arm-eabi-g++.exe
    LD := $(CXX)
    AR := $(TOOLCHAIN_ROOT)/bin/arm-eabi-ar.exe
    OBJCOPY := $(TOOLCHAIN_ROOT)/bin/arm-eabi-objcopy.exe

    #Additional flags
    PREPROCESSOR_MACROS += ARM_MATH_CM0 STM32F030CC stm32_flash_layout STM32F030
    INCLUDE_DIRS += . $(BSP_ROOT)/STM32F0xxxx/STM32F0xx_StdPeriph_Driver/inc $(BSP_ROOT)/STM32F0xxxx/CMSIS_StdPeriph/Device/ST/STM32F0xx/Include $(BSP_ROOT)/STM32F0xxxx/CMSIS_StdPeriph/Include $(BSP_ROOT)/STM32F0xxxx/CMSIS_StdPeriph/RTOS
    LIBRARY_DIRS +=
    LIBRARY_NAMES += compactcpp
    ADDITIONAL_LINKER_INPUTS +=
    MACOS_FRAMEWORKS +=
    LINUX_PACKAGES +=

    CFLAGS +=
    CXXFLAGS +=
    ASFLAGS +=
    LDFLAGS +=
    COMMONFLAGS += -mcpu=cortex-m0 -mthumb
    LINKER_SCRIPT := $(BSP_ROOT)/STM32F0xxxx/LinkerScripts/STM32F030CC_flash.lds

    #7812
    support
    Keymaster

    Hi,

    It looks like the file still defines the STM32F030CC macro. Could you let us know what exactly is broken with the project? Do you get some build error or is some functionality broken?

    #7816
    karlis77
    Participant

    When I make a project with STM32F051R8  then in  STM32f0xx.h file it is highlighted that STM32f051R8 is selected and everything is fine.

    When I make project with STM32F030CC then in STM32f0xx.h file it is highlighted that STM32F030 is selected and I can’t access features which STM32f030cc has.

    I uploaded 2 pictures below so you can see what I mean.

    STM32F030CC

    STM32F051R8

    #7820
    support
    Keymaster

    Hi,

    Please try clicking the “Regenerate MCU files” button on the Embedded Project page of VisualGDB Project Properties. This should update the preprocessor macros to the ones defined in the latest BSP.

    #7953
    karlis77
    Participant

    Thanks for answer.

    I can’t seem to find this “Regenerate MCU files” button.  This is how the window appears to me.

    #7955
    support
    Keymaster

    Hi,

    The “regenerate MCU files” button is only available starting from the Custom edition.

    If you are using the Embedded or Linux edition, you can simply change something on the Makefile Settings page (e.g. add a space to CFLAGS and delete it) and press “Apply”.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.