ARMプロセッサがコールドブート(つまり、初期電源投入)から起動するのか、ウォームブート(つまり、実際の電力損失なしにアサーションをリセットする)から起動するのかを判断する方法を探しています。具体的には、ARM968コアを使用しており、Cまたはアセンブリを使用して決定を行います。決定を使用して、特定の操作が最初の電源投入時にのみ実行され、後続のリセットでは実行されないようにします。以前のプロジェクトでは、外部回路(FPGAなど)を利用してさまざまなブートシナリオを検出しましたが、この場合はARMコアに限定されています。
3 に答える
特定のチップのドキュメントを確認してください(「ARM968」は十分に具体的ではありません)。リセットの原因を説明するレジスタが必要です。たとえば、LPC23xxには次のようなものがあります。
Reset Source Identification Register (RSIR - 0xE01FC180)
This register contains one bit for each source of Reset. Writing a 1 to any of these bits
clears the corresponding read-side bit to 0. The interactions among the four sources are
described below.
Bit Symbol Description
0 POR Assertion of the POR signal sets this bit, and clears all of the other bits in
this register. But if another Reset signal (e.g., External Reset) remains
asserted after the POR signal is negated, then its bit is set. This bit is not
affected by any of the other sources of Reset.
1 EXTR Assertion of the RESET signal sets this bit. This bit is cleared by POR,
but is not affected by WDT or BOD reset.
2 WDTR This bit is set when the Watchdog Timer times out and the WDTRESET
bit in the Watchdog Mode Register is 1. It is cleared by any of the other
sources of Reset.
3 BODR This bit is set when the 3.3 V power reaches a level below 2.6 V.
If the VDD(DCDC)(3V3) voltage dips from 3.3 V to 2.5 V and backs up, the
BODR bit will be set to 1.
If the VDD(DCDC)(3V3) voltage dips from 3.3 V to 2.5 V and continues to
decline to the level at which POR is asserted (nominally 1 V), the BODR
bit is cleared.
if the VDD(DCDC)(3V3) voltage rises continuously from below 1 V to a level
above 2.6 V, the BODR will be set to 1.
This bit is not affected by External Reset nor Watchdog Reset.
Note: Only in case when a reset occurs and the POR = 0, the BODR bit
indicates if the VDD(DCDC)(3V3) voltage was below 2.6 V or not.
RAM内のグローバル変数をコールドブート中に起こりそうもない値に初期化し、ブート中にそれをチェックすることができます。
マイクロコントローラの場合、通常、特定のチップのリセットロジックは、リセットのソースを示すステータスレジスタを提供します。それがこの大きなコアに存在するかどうか、そしてそれを使用できるかどうかはわかりません。
それは難しいかもしれません、そして多分あなたは本当にコア自体だけを意味するのではありません。コアはリセットされるべきでしたが、外部のメモリ(おそらくまだチップ内)はリセットされませんでした。メモリがドラムベースの場合でも、起動時にワイプされる可能性があります。私は一般的なワンサイズがすべての答えに合うことを知りません。あなたとstarblueの両方がそれを持っていますが、リセット時にクリアされないレジスタをどこかに見つけて、電源投入時にランダムに発生しない「可能性が高い」ものに設定する必要があります。それを読んでから設定してください。ボードレベルでリセットロジックを管理するfpgaまたはpld(存在する場合)が最適であると考えています。これは、パワーオンリセットではそれらもリセットされ、ウォームリセットではそれらが原因で状態を維持するためです。 。
コアのTRMまたはチップのレジスタ仕様を調べて、リセット状態が定義されていないレジスタがあるかどうかを確認します。通常は使用せず、何かに設定してもチップを傷つけないレジスタを確認します。それはパワーアップします、それは私が探し始めるところです。