Buzzing noise on S12ZVM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Buzzing noise on S12ZVM

869 Views
BastienF
Contributor I

Hello,

We had a strange behaviour with the microcontroller MC9S12ZVMC128. When we power off/on several times, the motor randomly starts a buzzing noise. In this condition, it do nothing and have no communication. Other power off/on on actuator do not heal this behavior. The only way is to completely reflash the microcontroller with JTAG. The buzz comes from the oscillation of the coils at a frequency of around 200Hz.

I did a dump of the flash, eeprom and register for some buzzing motor and compare to a good one.

- The flash is clean. Nothing to report.

- The eeprom shows some differences, but doesn't seem to have any impact. It's possible that the power off/on occurs during an eeprom write.

- The registers show some differences. I will provide a table with the differences I got.

 

When I reflash a good or bad EEPROM (.Srec file from the dump of the EEPROM) without erasing memory sector before, I got also the buzzing effect. I have no buzzing when I reflash a good or bad eeprom with erasing sector before program and the motor works fine.

 

Do you have any idea where does it come from?

What hapen exactly when we reflash an .Srec file without erasing sector before?

 

Thank you for your help!

Best regards,

Bastien

0 Kudos
9 Replies

824 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello Bastien,

It depends on the algorithm that the programmer uses.

The EEPROM sectors must be erased before programming.

The Program EEPROM Command verifies the data though.

If there are ECC errors detected during the operation, MGSTATx bits are set, and the algorithm should handle that.

danielmartynek_0-1697723140426.png

Anyway, you shold be able to read the EEPROM and compare it.

 

You mentioned that the MCU does nothing while it is under the conditions.

But in general, the MCU can be either in reset or do something.

If it not in reset, it is stuck somewhere.

 

The debugger can be attached to the running MCU .

CW11:

danielmartynek_1-1697723388895.png

Once attached, the debugger can halt the execution.

And you should see where it is stuck.

 

Best regards,

Daniel

 

 

0 Kudos

738 Views
BastienF
Contributor I

Hello Daniel,

 

Thank you for your answer.

I check the FSTAT register and got this. When I'm connected, I do some play/pause and check the value in FSTAT.

  • 0xEE (mostly)
  • 0xA0 (rarely)
  • 0x80 (rarely)

So it seem we have an Flash Access Error and an error is detected in MGSTAT. Not sure I interpret well the 0xEE, because in the datasheet, the value of bit 6 and 2 must be always 0.


I didn't know about the Attach function, that helps. Thanks for this.

I haven't figured out where it's stuck yet. I need more time to analyze the code further. For my initial observations, it seems to come back often on our eeprom read functions.

 

Best regards,

Bastien

0 Kudos

686 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @BastienF,

The application SW should clear the ACCERR, FPVIOL flags before it launches any flash command whereas the MGSTAT flags are cleared automatically.

Do you clear the flags?

Most of the time, you should see FSTAT = 0x80.

The error flags should be read at the end of any flash operation when CCIF gets set to 1 again.

Please place a breakpoint at this condition.

 

Since MGSTAT0 = 1, I would say the application SW programs an EEPROM location that is not erased.

 

Regards,

Daniel

 

0 Kudos

518 Views
BastienF
Contributor I

Hi Daniel,

 

Yes, it seem we clear the flags. I wanna double check with a colleague if we clear them in the good place.

The breakpoints doesn't work and I can't stop to  check the correct value of register. So I investiguate by compilling differents SW with differents tests point to check on oscilloscope. It's took me time, but I found the function where it's stuck, I hope.

Since we have errror_u8 == ERR_OK (0), it should break the while, but doesn't seem to work.

BastienF_0-1700472629767.png

Green: Test point DBG2

Blue: Test point DBG3

BastienF_1-1700472652790.png

 

0 Kudos

514 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @BastienF,

Maybe there is some kind of issue with the compiler's optimization.

Have you checked the disassembly?

If you can break it there, try placing an infinite loop there.

volatile unsigned int var = 1;
while(var){}

You should be able to halt the execution manually and find it there.

The debugger can clear the variable to proceed.

 

Regards,

Daniel

 

 

0 Kudos

403 Views
BastienF
Contributor I

Hi Daniel,

We are not familiar with the disassembly, do you have some manual?

And do you think it's possible to get your help on site ?

We observe that breakpoints can be used at the very beginning of the SW. But we can't get them further into the SW, even though we can get test points out on the oscilloscope further down.

According to our latest investigations, it seems that this buzzing problem occurs when the power supply is cut off during an eeprom write. We're still investigating this last point.

 

Best regards,

Bastien

0 Kudos

394 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @BastienF,

Regarding the assembler, have a look at S12Z CPU RM.

https://www.nxp.com/webapp/Download?colCode=S12ZCPURM

In the CW11 instalation directory, there are these documents:

MCU_S12Z_Compiler.pdf

MCU_S12Z_Assembler.pdf

 

Our team does not provide support at sites.

I see your company has a sale contact assigned.

We will send you an email.

 

The S12ZVM MCU has BATS module that monitors VSUP a gives a warning when VSUP drops below a certain level.

The EEPROM operation should be started only when there is no such warning.

The consumption of the MCU and the size of the bulk capacitor at VSUP should give you the expected time between the BATS warning and Low-voltage reset.

 

Regards,

Daniel

 

 

 

 

0 Kudos

392 Views
danielmartynek
NXP TechSupport
NXP TechSupport

This is also functional safety related.

Please refer to the S12Z Safety Manual available in Secure files and an NDA.

danielmartynek_0-1701772605140.png

https://www.nxp.com/products/processors-and-microcontrollers/additional-mpu-mcus-architectures/s12-m...

 

Regadrs,

Daniel

0 Kudos

850 Views
BastienF
Contributor I

And the data I get from the register. The test we done is a power on/off cycle of 4.2s during 5 days. During this 4.2s, our motor initialize and move a little bit. We have 4 motors for the data, PO1882, PO1883, PO1884 and PO1885. I extract the registers before to launch the test and after stoping the test. I hope it could help.

 Before testBefore testBefore testBefore testAfter testAfter testAfter testAfter test
 PO1882PO1883PO1884PO1885PO1882
buzzing
PO1883
no buzzing
PO1884
buzzing
PO1885
buzzing
CPMUACLKTR0x040x080x080x100x040x000x080x10
CPMUIRCTRIM0xB2DD0x9AB10x9AB10x92D20xB2DD0x0AA20x9AB10x92D2
CAN0RXDLR0x3B0xB60xB60x650x3B0x1B0xB60xE5
CAN0RXDSR00x060x370x370xB50x160x370x370xB5
CAN0RXDSR10x590xB00xB00xA10x590xC00xB00xA1
CAN0RXDSR20x880x350x350x660x880xA80x750x66
CAN0RXDSR30x5C0xC00xC00xB20x5C0xDF0xE00xB2
CAN0RXDSR40x400xD00xD00x1B0x600x080xD00x13
CAN0RXDSR50x030x340x3C0x5F0x030x600x3C0x5F
CAN0RXDSR60x0D0xCA0xCA0x700x170x100xCA0x70
CAN0RXDSR70xCC0xB30xB70x440x4C0x290xB70xC4
CAN0RXIDR00x0C0x000x000x060x040x4E0x000x00
CAN0RXIDR10x810x8F0x8E0x940x810x9A0x8F0x94
CAN0RXIDR20x170x430x730x280x170x040x530x28
CAN0RXIDR30x1C0x940x940xC10x140xD20x940xC0
CAN0RXTSR0x45040x34DE0x34DE0x8AA00x65040x51980x34DE0x8AA0
0 Kudos