2021-10-02 04:39 AM
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
Solved! Go to Solution.
2021-10-14 02:30 AM
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
2021-10-02 06:13 AM
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?
2021-10-02 06:28 AM
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.
2021-10-02 07:00 AM
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
2021-10-03 10:36 PM
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.
2021-10-14 02:30 AM
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
2021-10-14 05:56 AM
@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.
2023-05-11 04:32 AM
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.
2023-05-11 04:42 AM
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.