cancel
Showing results for 
Search instead for 
Did you mean: 

SPC56EC64 MCU is resetting while using I2C moule.

djtilava
Associate II

We are using I2C of SPC56EC64 MCU to communicate with bq25798 battery charger IC.

Communication is successfully done and we are also getting data from Charger.But whenever we do software reset of SPC56 MCU using below line of code mcu stuck in reset mode and it's RESET pin remains low.

             asm volatile ("wrteei  0" : : : "memory");
	    	 ME.IS.R = 5;
	    	 ME.MCTL.R = 0x00005AF0;
	    	 ME.MCTL.R = 0x0000A50F;

Also before doing rest i deinit i2c module too using below code.

	    	i2c_lld_stop();
	    	i2c_lld_deinit();

We use bootloader also with this application.So i have configures I2C module in bootloader code also but whenever we do software reset MCU stuck in RESET.

So it would be helpful if anyone could guide on this.

#[SPC5 Automotive MCUs]​ @Erwan YVIN

This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 ACCEPTED SOLUTION

Accepted Solutions
Erwan YVIN
ST Employee

Hello ,

for this task , i recommend to go step by step in debugger session (PLS)

check your e200 registers R13 / R14 / PC.

go directly in assembler code .. sometimes the C Code does not match perfectly with your symbol file (elf file)

Best Regards

Erwan

View solution in original post

8 REPLIES 8

Your posting is confusing.

Does the MCU attempt to reset while you use the I2C ?

Or do you explicitly try and reset the MCU, in some unrelated way that you're relating somehow too I2C operation ?

You're doing a Software Reset WHY?

If you don't touch the I2C module does the SW Reset succeed? or still fail?

Is ST's software reseting the MCU within the I2C stack? Do you have the source/listing, can you follow the logic as to why?

What's going on with your external circuitry?

Anything else Driving the Reset line?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
djtilava
Associate II

I want to update application in MCU using bootloader that's why i do software reset of MCU.

Does the MCU attempt to reset while you use the I2C ?

No, I have seperate thread for I2C in which i have one variable when i got update request from host i set that variable and in I2C thread i check that variable before i send command over I2C. If that variable is set than in main loop i am checking that there is not any ongoing operation over I2C then i do software reset.

If you don't touch the I2C module does the SW Reset succeed? or still fail?

If i don't touch I2C module SW Reset succeed.

Is ST's software reseting the MCU within the I2C stack?

It is outside of I2C Thread.

What's going on with your external circuitry?

Anything else Driving the Reset line?

NO nothing is driving Reset line it is pulled up by 4.7K resistor.

Actually older PCB has not use I2C module as there is no requirement for that.And in that PCB software reset is working ok not faced any issue with that.After i added I2C module then i am facing this reset stuck issue.

I think you're going to need to look at the circuit nodes related to the I2C pins (SCL, SDA), and anything attached to the I2C Slave Device (EEPROM?) you're talking too.

Would look for shorts on the MCU side, and on the I2C Slave side.

Would look at schematic netlist for unanticipated connectivity, or lack of connectivity

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
djtilava
Associate II

There is only one device attached on I2C bus and it is charger only.

Also check for shorts on MCU and I2C slave side but nothing like that.

Erwan YVIN
ST Employee

Hello ,

for this task , i recommend to go step by step in debugger session (PLS)

check your e200 registers R13 / R14 / PC.

go directly in assembler code .. sometimes the C Code does not match perfectly with your symbol file (elf file)

Best Regards

Erwan

djtilava
Associate II

@Erwan YVIN​ @Community member​ 

Thanks for your support.

Presently my issue is resolved by slowering down PLL clock to 48MHz from 120MHz in both application and bootloader program.

I don''t know what is relating to this.

I will try to find out this issue once i free from other task.

If you have any idea on this then i will implement that also.

Sivashankar
Associate II

Hi @djtilava​ , I am finding same issue with SPC56EC64.

  text   data   bss   dec   hex filename

 58976   436  69828 129240  1f8d8 build/out.elf

This is the size of my program.

My program is running for some time and getting reset after some time.

Kindly give me suggestions.

Debug the issue, work with your colleagues.

Suggest instrumenting your code so you can understand the flow and dynamics that occur prior to the reset.

Look for common causes or sequences.

Look for Watchdog or other causes.

Look for any code that explicitly resets the MCU, instrument that, and any error / fault routines or infinite loops.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..