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.

TMS320F28069M: Adding bootloader to instaspin lab caus inverter short

Part Number: TMS320F28069M

Tool/software:

Hi,

We have implemented a design where we have a modified lab20 serving as our inverter. Now we have added a canbus bootloader for ota availability. 

The lab is working fine as stand alone implementation.

Now we have added a bootloader app in part of the flash, which fires up on reset and checks a boot cookie set in app. If boot cookie is set we update the flash, else we just jump to the lab code.

But here is the strange part, if we run this combo, where the lab-project is virtually the same code as we run stand alone, without bootloade, we get a shorted inverter as soon as we activate the pwms/enable.

We have looked at everything we think is possible, linker overlaps, unclean ram from hand over, epwm states, and clock speeds. Nothing looks different in bl compared to the app stand alone. We even looked at the switching without applying any dc load, and it switches with correct frequency. 

Does anyone have any idea what can be different from a power on reset/stand alone compared to if we start in a bootloader app and then jump to the lab code? Anything specific we shall look out for? We are completely stuck.

/Mikael

  • Hello,

    The lab is working fine as stand alone implementation.

    To make sure we're on the same page: the lab works fine without the bootloader but once the bootloader has been added, the lab fails? Does this happen after you program a new application to flash via the bootloader? 

    But here is the strange part, if we run this combo, where the lab-project is virtually the same code as we run stand alone, without bootloade, we get a shorted inverter as soon as we activate the pwms/enable.

    What configurations are you doing in the bootloader? Are you doing any PLL configurations before branching to the application?

    Best,

    Matt

  • The problem is there if i flash the bootloader and the app using debugger. I have not programmed the lab using the bootloader in this scenario. If I run just the lab stand alone it is no issues at all. In the bootloader I do clock setup, this is the code that runs before I jump to the app;

     

        EALLOW; SysCtrlRegs.WDCR = 0x0068; EDIS;  /* watchdog off */
        call_device_cal();
        set_sysclk_90MHz_from_intosc();
        flash_waits_90MHz();
    
        /* Quiesce to a minimal environment */
        kernel_quiesce();
    
        /* If no boot cookie, briefly listen for a reflash request then jump */
        if (g_boot_cookie != BOOT_COOKIE_MAGIC) {
            CAN_init(1000);
            CAN_send(ID_C2H, RPL_INIT, 0,0,0,0,0,0,0, 8);
    
            if (!wait_for_reflash_window(REFLASH_WINDOW_US)) {
                if (app_present()) {bl_sanitize_before_jump(); jump_to_app(); }
            }
        } else {
    
    
            g_boot_cookie = 0UL; /* consume cookie; stay in bootloader */
        }

    I have confirmed that the frequencies in the app are good and that the PLL settings align with the stand alone working code, and I have canbus up and running in the app, no issues. But right after HAL_enablePwm(halHandle); I short the inverter. I have verified every songle epwm reg and it also align well with the stand alone ed running. I am lost here. 

  • Hi Mikael,

    Not sure how inverter shoring is possible if deadband module is being used properly.Can you verify ePWM trips are configured properly to all go LOW state? One similar issue I've seen before was root caused by a stack overflow, maybe stack size needs to be increased?

    Is the bootloader or integrated code interfering with the motor control ISR in some way? Could measure the cpu utilization of the functions.

    Best,

    Kevin

  • Hi Mikael,

    Not sure how inverter shoring is possible if deadband module is being used properly.Can you verify ePWM trips are configured properly to all go LOW state? One similar issue I've seen before was root caused by a stack overflow, maybe stack size needs to be increased?

    Is the bootloader or integrated code interfering with the motor control ISR in some way? Could measure the cpu utilization of the functions.

    Best,

    Kevin

  • Hi, 

    No I am just as stumbled as you in this case. I have read out all the registers at the initiation of my inverter app, both with and without the bootloader prior to running in the inverter code. In both cases I end up with the exact same settings for pwm:s but only the one with prior bootloader shorts. I have also tried increasing the stack with no success. I clear all bootloader ram usage before I jump to the inverter code, and I can confirm that the ram is clear once it enters the inverter part. I have also checked that the memory regions all are programmed correctly for both code parts. But i shall check cpu utilization and get back, thanks for the tip! The strange issue is that if i run from a current limited psu, I can see that the switching proceeds and looks quite ok without zooming into details from the logic side so it is not a lockup in that sense. I will check the high/low timing as well here in more detail and see if I can spot where the signals might look off. In my view it must be the high/low side being out of sync somehow. Like you said, the deadband module not correctly initiated or similar.

  • Hi Mikael,

    Keep us updated with what you find.

    You have the deadband sub-module configured for active high complimentary, correct? Another test idea if you haven't found a hint yet is increasing the ePWM Deadband FED / RED times beyond what you realistically need for your inverter stage. However I don't see how adding the booatloader would effect any of that...

    Best,

    Kevin