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.

  • Resolved

TMS570LS1227: PWM error during initialization for TI MCAL

Prodigy 120 points

Replies: 16

Views: 400

Part Number: TMS570LS1227

Hi Team,

I am using MCAL version AUTOSAR MCAL 05.40.00 EA1 and EB tresos 21.0.0. The target MCU is TMS570L1227

The PWM module cause the system go to error status when running Pwm_Init() function.

Please help to identify the error cause and solve the problem.

My PWM module configuration is as below:

When run to following code, the system will go to OS exception

The Call stack when error happens is as below:

The following pic show the status when the PWM_Init() function is entered

  • Hello,

    I don't see attached code and picture. Would you attach them?

    Best regards,
    Miro

    Best regards,
    Miro

  • In reply to Miro:

  • In reply to Miro:

    Hello,

    any progress on this issue

  • In reply to user6116028:

    Hello,

    The engineer who will take a look at this issue is out of office. He will answer ASAP

    Best regards,
    MIro

    Best regards,
    Miro

  • In reply to Miro:

    Hello,

    We're checking PWM with the same release version with the PWM configuration as given by you. We'll get back to you soon after we have the test done.

  • In reply to user6116028:

    Hello,

    I was going through the snapshots shared in the post. From what I saw, the values passed to Pwm_Het_Init are not correct.

    RamBaseAddress and RegBaseAddress parameter values are sort of fixed values are they're calculated using a Macro and a fixed offset. But in the above, we see values which are not as expected, and these values are not proper values for PWM register and Ram Base addresses.

    May be something is corrupting the values by the time the value is used as an address causing an exception. Please confirm the values of the macros for Ram and Control register base addresses are as below (taken from Pwm.h):

    #define PWM_HET1_RAM_ADDR ((P2VAR(Pwm_HetMemSectionType, PWM_VAR, HET_RAM)) 0xFF460300U)
    #define PWM_HET1_REG_ADDR ((P2VAR(Pwm_HetRegisterType, PWM_VAR, MSR_REGSPACE)) 0xFFF7B800U)

    If the values are same in code, then at run-time it may be that some corruption occurred. Please let me know about your observation on this.

  • In reply to Chetan Sanga:

    HI,

    I have checked pwm.h, the Ram and Control register base addresses is the same as your post

  • In reply to user6116028:

    Hello,

    Thanks for the info.

    This means corruption occurred in the parameters passed causing the values to be changed at runtime. So this is not due to PWM configuration or driver software.

    Possibly a stack related issue. To confirm, in current project just have Mcu, Port and Pwm Init called and comment out all other code, you should be able to see Pwm_Init works.

    If Pwm_Init succeeds, please adjust the stack size and enable other peripheral init calls and try the new binary.

  • In reply to Chetan Sanga:

    HI,

    I try to comment out the code and increase the stack size, but the problem is still the same.

    I modified the .cmd file as below to increase the stack size:

    MEMORY
    {
        VECTBL  (RX)    : org = BASE             len = 0x00001000
        CALIB    (RX)    :org = 0x00001000         len = 0x00010000         
        FLASH   (RX)    : org = 0x00011000         len = 0x0012F000
        STACKS  (RW)   : org = 0x08000000         len = 0x00012500 
        RAM (RW)    :org = 0x08012500             len = 0x0000DB00
        OVERLAY     (RW)   : org = 0x08020000     len = 0x00010000
    }

    I think the stack size is quite enough for 12500 len

  • In reply to Chetan Sanga:

    Hi,

    after my test It is not related to the stack issue. Do you have any other comments?

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.