STM32 frequency floats when debugging

Sysprogs forums Forums VisualGDB STM32 frequency floats when debugging

Viewing 15 posts - 1 through 15 (of 26 total)
  • Author
    Posts
  • #29054
    VladT
    Participant

    I use Preview 7 build 3703 and see the following picture: when starting in debug mode, the processor frequency clearly floats … Compilation to release works fine … How to debug, for example, USB devices, if in debug mode the device gives “Failure to request a USB descriptor device. ” ???

    • This topic was modified 4 years, 3 months ago by VladT.
    • This topic was modified 4 years, 3 months ago by VladT.
    Attachments:
    You must be logged in to view attached files.
    #29058
    support
    Keymaster

    Hi,

    Please let us know the email associated with your license key so that we could check your support status.

    #29059
    VladT
    Participant

    at the moment the support period has ended … the manager has requested an invoice for an extension … waiting …
    By the way, along the way, the question is – is there a discount on the extension? or is it like buying a new license?

    #29060
    VladT
    Participant

    I added an email to my profile … the first where is registered and the second is my personal

    #29064
    support
    Keymaster

    Sorry, we could not find any licenses associated with your company domain name.

    If you know your previous license key, please forward it to our support and we will link it to your forum profile.

    Edit: thanks for sending us your key information. We have linked it to your profile. Please use this link to renew your support and we will help you troubleshoot this.

    • This reply was modified 4 years, 3 months ago by support.
    #29086
    VladT
    Participant

    we renewed the license …

    #29087
    support
    Keymaster

    Thanks for renewing your license. Regarding the frequency, most likely the program triggers several breakpoints before the USB requests get properly handled.

    Please try removing all the breakpoints and make sure the device responds to the USB requests. If it still doesn’t work, please try programming the FLASH memory without debugging, restart the device, make sure it is recognized, and then try attaching to it as shown here: https://visualgdb.com/tutorials/arm/attach/

    If attaching a debugger breaks further USB functionality, please try connecting to the device using the native debugger tool (e.g. ST-Link tool or J-Link Commander) instead. If this also breaks the USB functionality, most likely the board has insufficient power, or has some wiring issues.

    #29089
    VladT
    Participant

    Please read the first post of the branch … The configuration release works … The debug does not work … What does the power have to do with it? There are no breakpoints … Now I made a special connection to the release as advised – nothing was broken in the work …. I compile this project in Keil and everything works fine … The problem with USB and the frequency drop occurs only in debug mode …

    #29090
    VladT
    Participant

    The fact is that the project is quite loaded with functionality. More than 10 streams on FreeRTOS. How does it affect it?

    #29091
    VladT
    Participant

    A short description of my project:

    CPU = STM32F427

    LAN + USB (VirtualCOM port) + 8UART

    The device receives a packet from the network, exchanges data on ports and sends the received data to the LAN. Additionally, an exchange can be made via USB with the desired uart …

    #29093
    support
    Keymaster

    In order to avoid additional clarification steps and get relevant help faster, please consider following our problem reporting guidelines. As your initial report compared debugging a debug configuration vs. running a release one, we assumed that the problem is caused by using a debugger. If running the debug build without debugging doesn’t work either (and release one works), most likely the lower optimization level of the debug build causes some kind of error (e.g. a stack overflow, memory corruption, or a timing bug). Please consider manually overriding the optimization level of the Debug configuration to match the Release configuration. If it helps, you can try changing optimization level for individual files, until you can find a specific file triggering the problem.

    The Keil compiler is very different from GCC, so it is completely expected that switching a large project between the compilers would require some additional troubleshooting. If you prefer, you can configure VisualGDB to use the Keil compiler as well: https://visualgdb.com/tutorials/arm/keil/

    #29101
    VladT
    Participant

    Okay. In the first message, I did not have enough information (Now I can say that there is another similar project where I observe the same picture … the same CPU + LwIP + CAN … On the CAN bus I observe a three-fold frequency drop …

    The initialization code CAN is where I experimentally selected a divider that allows you to work in debug mode … I selected the divider using an oscilloscope …

    For some reason, the Keil compiler does not want to be used. I only use it for checking. Before the errors occurred, both projects were originally written in VisualGDB + CubeMX.

    static void MX_CAN1_Init(void)
    {
    hcan1.Instance = CAN1;
    #ifdef DEBUG
      hcan1.Init.Prescaler = 8;
    #else
      hcan1.Init.Prescaler = 21;
    #endif
    hcan1.Init.Mode = CAN_MODE_NORMAL;
    hcan1.Init.SyncJumpWidth = CAN_SJW_1TQ;
    .........
    }
    
    
    • This reply was modified 4 years, 3 months ago by VladT.
    • This reply was modified 4 years, 3 months ago by VladT.
    #29104
    support
    Keymaster

    Thanks, this makes sense. If the frequency is configured conditionally based on the DEBUG macro, it will indeed show different results in Debug and Release builds.

    #29105
    VladT
    Participant

    over the weekend I will try to make a demo (my cut-down project with CAN) to reproduce the error you have …

    #29106
    VladT
    Participant

    both options work))) and debug and release …

    • This reply was modified 4 years, 3 months ago by VladT.
Viewing 15 posts - 1 through 15 (of 26 total)
  • You must be logged in to reply to this topic.