KV46F PWM misbehavior when connecting FreeMaster or setting break-point

cancel
Showing results for 
Search instead for 
Did you mean: 

KV46F PWM misbehavior when connecting FreeMaster or setting break-point

514 Views
plinioandrade
Contributor I

Hi,

I am having an issue with the KV46F256 microcontroller when connecting to it via FreeMASTER using BDM communication plugin OR also when just setting a break-point at a part of the code that is not being executed while the code is running.

I noticed that my motor was doing a noise every time I set a break-point or any time I try to connect via FreeMaster. Looking the PWM signals for my phase U upper switch I found the following:

plinioandrade_0-1606151266105.png

 

There is an interruption of the PWM signals for about 8.8 milliseconds then it resumes to normal operation. I really believe this should NOT be happening specially when connecting with FreeMaster as this can cause damage to bigger motors. 

Is there a way to stop this interruption of the PWMs when connecting to the micro via FreeMaster and/or setting a break-point?

I am using the latest version of SDK for the KV46F256 micro, I am using the MCUXpresso IDE v11.2.0 [Build 4120] [2020-07-09] and my debug probe is the Multilink Universal FX.

Sincerely,

 

 

Labels (1)
0 Kudos
7 Replies

460 Views
FelipeGarcia
NXP TechSupport
NXP TechSupport

Hello,

Please note that when you are connecting over JTAG/BDM plug-in, you should abort the debugging session first. The P&E Micro probe must NOT be occupied by a debugger when connecting with FreeMASTER. If you need to debug while running Freemaster then I recommend you to connect over serial line as you can have both debugger and FreeMASTER running.

I believe this is the reason why you are seeing unexpected behavior when placing a breakpoint.

Best regards,

Felipe

0 Kudos

450 Views
plinioandrade
Contributor I

@FelipeGarcia ,

I'm NOT trying to connect FreeMASTER while debugging. I described two scenarios where the problem occurs:

First scenario: When debugging and I add/remove a breakpoint at a piece of code not being executed.

Second scenario: When not debugging and I connect to the micro via FreeMaster using the BDM plugin.

Both scenarios stop the PWM switching for about 8.8mS which I believe to not be the correct behavior as I'm performing non-intrusive operations.

Sincerely,

 

0 Kudos

404 Views
FelipeGarcia
NXP TechSupport
NXP TechSupport

Hello,

I've received feedback from Freemaster team. 

Just to confirm - I hope the glitch on PWM signal is only observed when FreeMASTER is just establishing connection...? It should NOT be observed during normal communication - that would be really bad.

When FreeMASTER is connecting (and also when a debugger communicates with target while setting a breakpoint etc), the JTAG temporarily forces the CPU to a background/suspended mode to analyze the connection. I think it is normal/default behavior that the peripheral clocks are suspended during this period - causing the PWM glitch. The KV4x reference manual writes about it in section 37.2.2. It may indeed be dangerous to the motor hardware.

The customer should consider setting the CTRL2[DBGEN] bit in PWM configuration.

image.png

Hope it helps! 

Best regards,

Felipe

-------------------------------------------------------------------------------

Note:

- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored. Please open a new thread and refer to the closed one, if you have a related question at a later point in time.

------------------------------------------------------------------------------ 

0 Kudos

389 Views
plinioandrade
Contributor I

Felipe,

The problem with that approach is:

My PWM will not stop anymore but the duty cycle will be kept constant (because CPU isn't running to recalculate the new PWMs) for the same amount of time which translate to applying DC voltage to the motor (high currents are produced). 

So, it seems like this is a glitch that can cause issues no matter what.

Do you know if this is something that NXP/ARM is planning to fix in a soon-to-come future?

Sincerely,

 

0 Kudos

365 Views
FelipeGarcia
NXP TechSupport
NXP TechSupport

Hi,

Unfortunately, there is no plan to fix this issue yet. I am sorry for the inconvenience that this may have caused you.

Best regards,

Felipe

0 Kudos

335 Views
plinioandrade
Contributor I

Felipe,

I don't know if you really understand how big of a problem this is. I'm unable to debug my code when my hardware is connected to a motor. I cannot even set a breakpoint because doing so will either stop my PWMs for some milliseconds causing issues (since all my lowers go enabled and it short my motor) or keep my PWMs running without an updated duty cycle which is even more catastrophic for the hardware.

I should not experience this type of issues when just setting breakpoints on my code (notice that I'm not really stopping the code execution, I'm just setting breakpoints). I've used other types of motor control micros such as TI C2000 and have never experienced this type of behavior.

I really would like to get a better evaluation of this issue other than just apologies.

Sincerely,

 

0 Kudos

427 Views
FelipeGarcia
NXP TechSupport
NXP TechSupport

Hi,

Thank you for the clarification. I have contacted Freemaster team to see whether this is expected behavior or not. I will update this thread as soon as I receive more information.

Best regards,

Felipe

0 Kudos