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.

TMS570LS1227: PWM error during initialization for TI MCAL

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

  • Hello,

    any progress on this issue

  • Hello,

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

    Best regards,
    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.

  • 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.

  • HI,

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

  • 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.

  • 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

  • Hi,

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

  • Hi

    after testing, whenever I read/write data from address FF460000, error occurs. So is this address is protected? How can I unprotected this address

  • Hello,

    This address you tried to read (0xff460000) is N2HET1 Ram base address. Anyway the driver does write to this memory in a critical section. We shouldn't be accessing the memory directly.

    The issue you have reported previously was about memory fault due to Pwm-Het-Init where parameter corruption happens during the function call. We will continue with parameter corruption issue. It is not possible for driver software to have corrupted these parameters as the passed values are just numerical values. Thanks for the memory section data.

    We'll investigate further on this and let you know.

  • Hi

    the data is not correct may be some mistake of debug tool. I have modified the code to do some test. If the N2HET1 ram base address(Het_Memptr  0xff460000) is not accessed, there is no problem. You can see from the below picture the parameter is passed correctly.  Then after run the code in line 184 to access the N2HET1 ram base address(Het_Memptr  0xff460000) the same error occurs.

    And then I have test this issue using ICU module.

    In ICU module the address parameter passed without corruption, but when access to the N2HET1 ram base address(Het_Memptr  0xff460000) the same errors occurs. 

    I have checked the N2HET1 parity check is enabled

    So I think the problem may be caused by the N2HET1 Ram is not initial and the parity check can not be passed. And I have checked the MCU module, the N2HET1 Ram init is not enabled in my project. And I try to enable this RAM init in MCU module, but after I enable the N2HET1 Ram init the MCU module. The Memory Hardware Initialization can not be completed so the MCU can not finish initialization.

    So why the N2HET Ram base address can not be accessed? Is it because the N2HET ram ECC check? How can I disable the N2HET Ram parity check or how can the N2HET Ram parity can be checked without problem? And can you help to find why MCU can not finish init when N2HET ram init is enabled.

    attached is my mcal related code

    1300.TMS570LS1224.zip

  • Hello,

    Thanks for the update and the configuration/files. We'll check this case and update you about the Het Ram access and Mcu Ram Init.

  • Hi

    Can you speed up? We are face a hurry delivery.

  • Hello,

    Tested with your configuration on our setup. It is found that McuUseVclk2 is disabled which is required for proper setup of Het1 memory and accessing the memory and Het1 enabling was not done.

    Attached Mcu.xdm is good and Pwm Init is executed without fault. Differences:
    > McuUseVclk2 parameter set as Enabled
    > McuInitNhet1Ram, McuInitHetTu1Ram and McuUseNhet1,McuUseHetTu1 are set as Enabled

    Please use the updated Mcu.xdm attached here.

    7167.Mcu.xdm.txt