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.

CCS/TMS320F28054M: Custom board bringup problems (DRV8323RS + NexFET)

Part Number: TMS320F28054M
Other Parts Discussed in Thread: DRV8301, DRV8323, MOTORWARE, DRV8305-Q1EVM, CCSTUDIO

Tool/software: Code Composer Studio

Having some trouble bringing up a custom board, maybe someone can spot a dumb mistake. Exactly the same board, but with a STM32 MCU was used before pretty successfully. In fact after many tries with different user.h parameters, motor did turn in learn mode, so it seems that the problem is probably is in the code somewhere. The first thing that goes wrong is this message - "Device may be operating in low-power mode error", which appears just after I check the 'Run' checkbox, after that all the values goes crazy, but the board still runs through the learn procedure and turn the motor (not every time). With current config after several seconds it just hangs somewhere though. Tried to attach a debugger after that, but with no luck, some address outside of the source code was shown, probably incorrect. I though that it is a JTAG connection issue, shortened the wires to just 5cm, didn't help. And connection test in project properties runs just fine. Not sure if this is supposed to be like that, but it seems that MCU is not running on itself after power on, with both linker scripts, Debug in CCS and GUI Composer loads the firmware just fine. Also GUI Composer works for a long time if I do not check the Run checkbox.

Here are the numbers changed from drv8301_kit example code, which uses the same MCU:

#define USER_IQ_FULL_SCALE_VOLTAGE_V      (32)
#define USER_IQ_FULL_SCALE_CURRENT_A      (55) 

#define   I_A_offset    (0.0)
#define   I_B_offset    (0.0)
#define   I_C_offset    (0.0)
#define   V_A_offset    (0.0)
#define   V_B_offset    (0.0)
#define   V_C_offset    (0.0)

#define USER_SYSTEM_FREQ_MHz                  (60.0)
#define USER_PWM_FREQ_kHz                     (45.0)


#define USER_MOTOR_Rs                    (0.0)
#define USER_MOTOR_Ls_d                 (0.0)
#define USER_MOTOR_Ls_q                 (0.0)
#define USER_MOTOR_RATED_FLUX           (0.0)
#define USER_MOTOR_RES_EST_CURRENT      (4.0)
#define USER_MOTOR_IND_EST_CURRENT      (-2.0)
#define USER_MOTOR_MAX_CURRENT          (15.0)
#define USER_MOTOR_FLUX_EST_FREQ_Hz     (88.0)

I've copied the aforementioned drv8301 example project and changed the GPIO mappings, removed DRV8301 initialization, added DRV8323RS related code, changed TZ pin config and ADC mappings. Here are the project config:

MCU schematics:

The actual P/N is TMS320F28054MPNQ.

3mR shunts are used, and DRV8323RS is in default config, (20V/V gain, other parameters should not matter in this case).

  • If I do not enable the DRV8323 and click Run, MCU continues to work but sometimes after several minutes the same message appears. Before that all the numbers are reasonable. Tried to power the MCU from separate power supply, nothing changed.

  • Nice schematic. You might change the USER_NUM_PWM_TICKS_PER_ISR_TICK to 3. The 45kHz ISR frequency is too high that will cause the ISR overflow.

    #define USER_NUM_PWM_TICKS_PER_ISR_TICK       (1)
    Seems like two USER_NUM_PWM_TICKS_PER_ISR_TICK definitions in user.h. And make sure that USER_ADC_FULL_SCALE_VOLTAGE_V  and USER_ADC_FULL_SCALE_CURRENT_A should be calculated per current and voltage sensing circuit. 
  • Thanks:)

    Right now the config is:

    #define USER_IQ_FULL_SCALE_VOLTAGE_V      (24)
    #define USER_ADC_FULL_SCALE_VOLTAGE_V     (33)
    #define USER_IQ_FULL_SCALE_CURRENT_A      (41.25)
    #define USER_ADC_FULL_SCALE_CURRENT_A     (55)
    #define USER_NUM_PWM_TICKS_PER_ISR_TICK        (3)
    #define USER_NUM_ISR_TICKS_PER_CTRL_TICK       (1)
    #define USER_NUM_CTRL_TICKS_PER_EST_TICK       (1)
    #define USER_NUM_CTRL_TICKS_PER_TRAJ_TICK      (15)

    And here is what gui composer says about it:

    Seems correct. If I press Run without enabling the DRV, it doesn't give an error about sleep mode and seems to be doing something for quite a while. With DRV enabled, it gives the message right away, MCU still doing something for a second and then freezes.

    By the way, this message often appears when launching gui composer, is it normal, or something might be wrong with my setup?

    Here is ISR trace, it just stops after Run. ISR takes 12us, frequency is 15kHz.

  • You might use CCS to design and debug the project directly. The GUI is not for DRV8323, especially you changed the example project in motorWare.  And let me know if have any further questions.

  • Unfortunately there seems to be the same problem here. I've added this piece of code before the main for loop:

    gMotorVars.Flag_enableSys = true;
    gMotorVars.Flag_Run_Identify = true;
    gMotorVars.Flag_enableUserParams = false;
    gMotorVars.Flag_enableForceAngle = true;
    gMotorVars.Flag_enableFieldWeakening = false;
    gMotorVars.Flag_enableRsRecalc = true;
    gMotorVars.Flag_enableOffsetcalc = false;

    Started debug session, everything was ok, then I enabled silicon real-time mode and as soon as I pressed run this message appeared:

    Nevertheless MCU continued to work and it seem'd like it passed through Rs calculation and tried to turn the motor for flux calculation and then just stopped somewhere. What this low power mode even mean, could it be something wrong with my JTAG connection or JTAG adapter itself (I'm using DRV8305-Q1EVM as XDS110, rewired it's jtag to my board)?

  • 1. Remove all breakpoints in your project.

    2. The connection wires should be as short as possible or use a standalone emulator to avoid the noise.

    3. Make sure that the output current of the power supply is enough for controller and emulator.

  • Finally some progress:) if I flash the mcu and disconnect jtag wire right away, mcu continues to work, rotates the motor and overall seems to work fine.

    We should receive XDS110 soon, it should be more robust?

  • Yes. I think so.

  • Tried it with XDS110, with super short wires and replaced 2K2->10K resistors, jtag test passes correctly even at 5MHz. Using 100kHz for now. Debugging and loading from CCS works fine, even with enabled DRV there are no sleep mode error messages. But now another problem, trying to start gui composer, and getting this message: 

    Restarting Program Model...
    Initializing target : C:\ti\guicomposer\eclipse\workspace\.metadata\.plugins\com.ti.binding.program\appConfig.ccxml
    Connecting target: Texas Instruments XDS110 USB Debug Probe/C28xx Wrapped com.ti.ccstudio.scripting.environment.ScriptingException: Error connecting to the target: emulation failure occurred (<Unknown source>#14) in <Unknown source> at line number 14Restart Completed.

  • The default emulator of the GUI is XDS100. You should change the appConfig.ccxml for XDS110 emulator, you might use the target configuration file (.ccxml) in CCS and change its name to appConfig.ccxml instead of the original one.

  • Unfortunately the same error happens, and there was no appConfig.ccxml file in wabapps folder in the first place. But it did load this file though.

    Also we've managed to launch the firmware without the debugger by pulling GPIO34 and GPIO37 to +3V3 on startup.

  • The GUI uses the ccxml file at C:\ti\guicomposer\webapps\InstaSPIN_F2805xM_UNIVERSAL\appConfig.ccxml

    If you were using the same emualtor to connect in CCS, you may copy the contents of the working ccxml into the appConfig.ccxml and see if that allows you to connect with the GUI.