IMPORT KEIL PROJECT GENERATED BY STM32CUBEMX TO VISUAL GDB,VS 2017 COMPILE ERROR

Sysprogs forums Forums VisualGDB IMPORT KEIL PROJECT GENERATED BY STM32CUBEMX TO VISUAL GDB,VS 2017 COMPILE ERROR

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #23144
    Miao Mico
    Participant

    I generate the the KEIL PROJECT code via STM32CUBEMX-STM32F4.HAL.

    I compile the  project as soon as the project imported success via VISUAL GDB import.

    BUT.

    The VS2017 ERROR LIST output will show below error message.

     

    A1167E: Invalid line start

     

    And i will find something differ from the keil  Preprocesser Macros.

    VISUAL GDB Preprocesser Macros ADD THE BELOW SECTION.

     

    $$com.sysprogs.bspoptions.primary.memorys$$_layout;

     

    Then i try to remove it , i find vs2017 will compile successfully.

    I feel very confused.

    Can you tell me how this added Preprocesser Macro works?

    PLEASE.

    • This topic was modified 5 years, 4 months ago by Miao Mico.
    Attachments:
    You must be logged in to view attached files.
    #23148
    Miao Mico
    Participant

    AND I want to know how to ENABLE the Regular VC ++ IntelliSence as default.i can’t use the clang very well.

    I am so sorry about this.

    #23149
    Miao Mico
    Participant

     

    THE SECOND QUESTION.

     

    This may be a silly question,too.

     

    I can’t load the programs compiled by KEIL ARMCLANG(V6.10.1) via VS2017 DEBUG mode CORRECTLY .

    AND the KEIL ARMCC is work perfectly.

    I got this conclusion from my discovery board not working, while my program focus it float shine.

    BUT the GDBSever show it load success.

    I feel very confused about this.

    I think the code should be no problem, because the Initialize GPIO part code is generated by STM32CUBEMX5.0 .

     

    FOR THIS.

    I want to know the difference between RELEASE MODE and DEBUG MODE .

    Is it just differ from Optimization Grades?

    Want to understand how it works,please.

    • This reply was modified 5 years, 4 months ago by Miao Mico.
    #23153
    support
    Keymaster

    Hi,

    No problem. The macro looks like a leftover from a GCC-based project that should not be set for Keil-based projects. If you could let us know the exact steps to reproduce this, we should be able to fix it. Alternatively, removing the macro via VisualGDB Project Properties should work as well.

    You can set the VC++ IntelliSense as a default engine via View->Clang IntelliSense Diagnostics Console -> Default Engine.

    The difference between debug and release is usually just the optimization. You can find the exact command line options VisualGDB passes to Keil in the .rsp file  in the VisualGDB\<Configuration name> subdirectories. If you can reliably reproduce problems with a certain project/configuration, please try building it with uVision and check if the problem persists. If not, please try comparing the command lines from the .rsp files with the command lines from Keil uVision (enable the “create batch file” to make uVision dump the command lines). E.g. try linking the object files produced by uVision using the VisualGDB’s link command line or vice versa.

    #23158
    Miao Mico
    Participant

    ADD INFO.

     

    It can’t work via DEBUG : Program and Start Without Debuging .

    BUT can work via DEBUG : Start Debugging With Gdb .

     

    I will try what you just directed.

    #23159
    support
    Keymaster

    Hi,

    That might be a different issue – the code is likely stuck somewhere waiting for debugger (e.g. on a semihosting call).

    Please try attaching to the stuck program as  shown here to diagnose it.

    #23160
    Miao Mico
    Participant

    but why i can’t find the CFSR via the Hardware Registers ?

    My chip is STM32F407ZG.

    Any Visual Gdb settings not correct?

    By the way , my setting is default.

    Attachments:
    You must be logged in to view attached files.
    #23162
    support
    Keymaster

    Hi,

    The register definitions when using the Keil compiler are taken from the SVD files shipped with Keil. E.g. for the STM32F407ZG that would be Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\<version>\CMSIS\SVD\STM32F40x.svd. If you believe the files are missing some registers, please double-check it with Keil support, as they supply the files.

    #23164
    Miao Mico
    Participant

    AND

    How to add the up to data ARMCLANG compiler (v6.11) downloaded via ARM official website into VISUAL GDB while the KEIL ARMCLANG vision is v6.10.1 ?

    CAN THE VISUAL GDB  SUPPORT THE UP TO DATA COMPILER NOW?

     

    According to the STEP to reproduce that phenomenon Preprocesser Macros add ‘$$com.sysprogs.bspoptions.primary.memorys$$_layout;’  .

    You know the STM32CubeMX ?

    I use it to generate the keil project .

    Whether function i choose to enable,changes the setting on STM32CubeMX ,the Keil project it generates will cause the problem,when i import it into Visual GDB .

     

    You can try it . If the conditions differ from mine, i will send the whole file about the project .

    Attachments:
    You must be logged in to view attached files.
    #23166
    Miao Mico
    Participant

    https://visualgdb.com/tutorials/arm/attach/

     

    I find the SVD file you reffered ,and i can’t find cases about CFSR in that file.

    AND i find the compiler you choose is ARM-EABI,not ARMCC ,in the above web page .

    THEN i think the solution the above web page refered may not fit to me .

    HOW CAN I DO ?

    Thank you in advance .

    • This reply was modified 5 years, 4 months ago by Miao Mico.
    Attachments:
    You must be logged in to view attached files.
    #23174
    support
    Keymaster

    Hi,

    VisualGDB automatically uses the compilers from the <Keil installation directory>\ARMCC and <Keil installation directory>\ARMClang. As long as you install the updates in those directories, VisualGDB will automatically pick them up.

    We have reproduced the problem with the “$$com.sysprogs.bspoptions.primary_memory$$” macro and fixed it in this build: http://sysprogs.com/files/tmp/VisualGDB-5.4.10.2642.msi

    Please ensure that you generate a Keil project from STM32CubeMX, not a GPDSC project, and that you select the Keil compiler in the Keil importer settings (first page of VisualGDB Project Wizard).

    If the SVD files does not contain the register, VisualGDB won’t be able to display it as it takes the register definitions from the Keil-supplied SVD files. Please consider editing the file to add any extra registers that you would like to view with VisualGDB.

    The tutorial we mentioned describes how to diagnose embedded firmware getting stuck without the debugger attached. The steps described there do not depend on a specific compiler type, so you should be able to use it with the Keil compiler as well as with GCC. Simply attach to the project to see where exactly.

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