Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

R1991 patch: MCU keep on running after PC out of range.

2 posters

Go down  Message [Page 1 of 1]

royqh1979



If PC out of range, the mcu will keep on running. And the message panel would be spammed by the debug message.

The patch tries to fix it.
Attachments
R1991 patch: MCU keep on running after PC out of range. Attachmentstop.zip
You don't have permission to download attachments.
(1 Kb) Downloaded 2 times

arcachofo

arcachofo

It is working ok for me: If PC is out of range it shows a message and the MCU stops.

royqh1979



arcachofo wrote:It is working ok for me: If PC is out of range it shows a message and the MCU stops.

en, if I just connect a fixed volt to 8051 rst pin, it will stop if PC out of range.

But if I connect reset to a capcitor as in the 8051 manual, it will keep on spamming.
R1991 patch: MCU keep on running after PC out of range. Snap319
.

arcachofo

arcachofo

But if I connect reset to a capcitor as in the 8051 manual, it will keep on spamming.
Ok, I see the problem.
We need a clean reset signal here...

royqh1979



arcachofo wrote:
But if I connect reset to a capcitor as in the 8051 manual, it will keep on spamming.
Ok, I see the problem.
We need a clean reset signal here...

Thanks. And it has some other problems in the reset procedure. With this connection, it seems that hardreset(true) will be triggered many times before volt goes down to 0 and will slow down the startup.

And although I'm not sure what hardreset( false ) really doing, it seems that it might be mis-named. It was called again and again like a heartbeat. I've no idea why it was called.

arcachofo

arcachofo

Thanks. And it has some other problems in the reset procedure. With this connection, it seems that hardreset(true) will be triggered many times before volt goes down to 0 and will slow down the startup.
Yes, hopefully solved at Rev 1992.

And although I'm not sure what hardreset( false ) really doing, it seems that it might be mis-named. It was called again and again like a heartbeat. I've no idea why it was called.
This is exit reset state.

The problem is that with a capacitor this function will be called every time the voltage changes at reset pin.
That's what I mean: "We need a clean reset signal here"

royqh1979



arcachofo wrote:
Yes, hopefully solved at Rev 1992.

It seems that the PC out of range spamming is not fixed in R1995.

When reset pin's voltage dropped below 2.5v, m_ecu will restart and quickly PC out of range will set e_mcu's m_state to mcuStopped. Then  mcu's volatgeChange() will call hardreset( false ) and restart the e_mcu, untill finally voltage is at 0. At least 500+ "eMcu::stepCpu: Error PC = 4096 PGM size = 4096 \n MCU stopped" messages is generated will be generated in this process.

That's why I add a new state in the first patch.



Last edited by royqh1979 on Mon Oct 16, 2023 3:45 pm; edited 1 time in total

royqh1979



royqh1979 wrote:
arcachofo wrote:
Yes, hopefully solved at Rev 1992.

It seems that the PC out of range spamming is not fixed in R1995.

When reset pin's voltage dropped below 2.5v, m_ecu will restart and quickly PC out of range will set e_mcu's m_state to mcuStopped. Then  mcu's volatgeChange() will call hardreset( false ) and restart the e_mcu, untill finally voltage is at 0. At least 500+ "eMcu::stepCpu: Error PC = 4096 PGM size = 4096 \n MCU stopped" messages is generated will be generated in this process.


I've made a test circuit in the attachment.
Attachments
R1991 patch: MCU keep on running after PC out of range. Attachmenttestrun.zip
You don't have permission to download attachments.
(1 Kb) Downloaded 1 times

arcachofo

arcachofo

It seems that the PC out of range spamming is not fixed in R1995.

When reset pin's voltage dropped below 2.5v, m_ecu will restart and quickly PC out of range will set e_mcu's m_state to mcuStopped. Then  mcu's volatgeChange() will call hardreset( false ) and restart the e_mcu, untill finally voltage is at 0. At least 500+ "eMcu::stepCpu: Error PC = 4096 PGM size = 4096 \n MCU stopped" messages is generated will be generated in this process.

That's why I add a new state in the first patch.
You are completely right.
I think it is solved at Rev 1996.

I also added some "special effects".

royqh1979



arcachofo wrote:
It seems that the PC out of range spamming is not fixed in R1995.

When reset pin's voltage dropped below 2.5v, m_ecu will restart and quickly PC out of range will set e_mcu's m_state to mcuStopped. Then  mcu's volatgeChange() will call hardreset( false ) and restart the e_mcu, untill finally voltage is at 0. At least 500+ "eMcu::stepCpu: Error PC = 4096 PGM size = 4096 \n MCU stopped" messages is generated will be generated in this process.

That's why I add a new state in the first patch.
You are completely right.
I think it is solved at Rev 1996.

I also added some "special effects".

It seems there's some issue in R1996:
- In eMcu::voltChanged() and eMcu::runEvent(), mcuStopped is checked before processing. Should mcuError be checked too?
- m_crashed is only not set to false in initialize(), but not in reset(). So it will keep flashing even after the mcu is reseted(not restart the simulation). (This is a minor issue since a crashed mcu would crash again after reset...)

arcachofo

arcachofo

- In eMcu::voltChanged() and eMcu::runEvent(), mcuStopped is checked before processing. Should mcuError be checked too?
Yes, that's already done (m_state != mcuRunning) at Rev 1997.

- m_crashed is only not set to false in initialize(), but not in reset(). So it will keep flashing even after the mcu is reseted(not restart the simulation). (This is a minor issue since a crashed mcu would crash again after reset...)
Yes, this is an issue. A program could go out of range in one run but not in another.

arcachofo

arcachofo

- m_crashed is only not set to false in initialize(), but not in reset(). So it will keep flashing even after the mcu is reseted(not restart the simulation). (This is a minor issue since a crashed mcu would crash again after reset...)
I think this is solved at Rev 2003.

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum