This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM62A3-Q1: DebugP_log() print will cost long time

Part Number: AM62A3-Q1

Tool/software:

Hi Expert,

customer report one issue is about DebugP_log() api, if customer call this api directly, it will make 100ms period CAN frame increase to 242ms. customer also do some profile as below. 

1. call the DebugP_log() in lowest priority task;

2.using the tick to profile the time cost.

do you have any suggestion to customer to optimize the time cost on DebugP_log(). now I let customer disable the DebugP_log() for workaround at first, but sometimes customer still need the log for debug, so pls help give some suggestion.

BR,

Biao 

  • Hello Biao,

    I am looking at your queries and you may expect reply in one or two days.

    Regards,

    Anil.

  • Hi Anil,

    Thanks for reply, I have let customer try to increase the baud rate and enable dma mode to see any improvement. if you have any suggestion or specific data (debug_log time cost) in your side, pls let me know.

    BR,

    Biao

  • Hello Biao,

    How do customers measure time ? I mean which is the API they are using to measure the debug_logp time ?

    If they are using the clockP_pmu timer, then the measurement does not be the right because when the application runs in the freertos there might be a chance an idle task runs, and it executes the WFI instructin, which will impact the measurement.

    Please use the GTC timer and calculate the measurement time.

    Do the testing in the release build if customer  captured measurement results in the debug build.

    And, share the test results.

    Can you please share how many tasks are created ?

    Mostly this debuglog_p is used for debug purposes and, in real time application running , most of the case we don't need to enable this function .

    Regards,

    Anil.

    1. Using xTaskGetTickCount (), how to use UTC time interface? APls for SOC Specific Device Drivers APIs for GTC are used on the SOC side.
    We are measuring the time on the MCU R5F side.
         2. A total of 10 tasks were created.
  • Hi Anil

    May I ask why my serial port is reporting an error when I want to use DMA mode here?

    BR,

    Huang

  • Hi Biao && Anil

    May I ask if there has been any progress on this issue?

    BR,

    Huang

  • Hello Huang,

    The DMA is not supported for the MCU Domain peripherals.

    So, the syscfg is not supported to enable the  DMA for MCU peripherals .

    The DMA is supported only for the MAIN domain peripherals.

    Do the testing in the release build if customer  captured measurement results in the debug build.

    Can you please also confirm if the above results measured in the release build or not ?

    Regards,

    Anil.

  • Hi Anil

    I would like to ask, how can I use the GTC timer to measure time? Can you share with me which steps to follow? What actions should I take to provide you with more information?

    BR,

    Huang

  • Hello Huang ,

    You can enable GTC form syscfg and generate the code in WKUP R5F core.

    Later, flash the updated WKUP R5F application in the SOC and next simply read the GTC count value from the MCU R5F core with the help of 

    GTC_getCount64 API.

    Make sure that you need to run this test case in the release mode and not in the debug mode.

    This GTC count value needs to be converted to sec. For that please follow the steps below.

    Put the break point in the function below and get the frequency of the GTC timer.

    Next , To calculate Time = (T2 - T1 ) / GTC Clock frequency 

    Regards,
    Anil.
  • Hi Anil

    I obtained the clock frequency by interrupting as shown in the figure:

    Here are my test results:

    I hope the above information can help you analyze. If there is anything else you need to provide, please let me know.

    BR,

    Huang

  • Hello Huang,

    Can you please confirm the above results in Release build or debug build ?

    And, one more thing, these are debug logs and are used for debugging purposes.

    If you think the debug log API takes more time, we need to disable it in the actual release build .

    Regards,

    Anil.

  • Hi Anil

    I verified the above results in the release build

    BR,

    Huang