Pregunta

Busco una manera de determinar si un procesador ARM arranca desde un arranque en frío (es decir encendido inicial) frente a un arranque en caliente (es decir, la afirmación de reposición sin pérdida de potencia real). Específicamente estoy usando un núcleo ARM968, va a hacer la determinación usando C o montaje, y voy a utilizar la determinación por lo que ciertas operaciones sólo se ejecutan en los de encendido y no en restablece posteriores iniciales. En proyectos anteriores que he apalancadas circuitos externos (por ejemplo FPGA) para detectar los diferentes escenarios de arranque, pero en este caso estoy limitado al núcleo ARM.

¿Fue útil?

Solución

Se puede inicializar una variable global en la memoria RAM a un valor que es poco probable que durante el arranque en frío, y compruebe si hay que durante el arranque.

Para microcontroladores normalmente la lógica de reposición del chip específico proporciona un registro de estado, que indica la fuente de la reposición. No sé si es que existe para este núcleo más grande, y si usted podría utilizar eso.

Otros consejos

Comprobar la documentación para que el chip específico ( "ARM968" no es lo suficientemente específica). Debe haber un registro que describe la causa de reinicio. P.ej. esto es lo que tiene 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.

Es probable que sea difícil, y tal vez usted realmente no significa sólo el propio núcleo. El núcleo debería haber recibido un reinicio, pero el exterior de memoria (pero quizás todavía dentro del chip) no lo hizo. si la memoria DRAM se basa entonces todavía puede quedar eliminado en el arranque. No sé de una talla única respuesta genérica. tanto usted como starblue tenerlo sin embargo, usted tiene que encontrar algún lugar alguna registro que no se despeja en un reinicio, establecer que a algo que es "probable" no ocurra al azar en un encendido. leyó luego la puso. piensa como el FPGA o PLD que manejan la lógica de reposición a nivel del consejo (si los hay) son los mejores porque en un Power On Reset que se restablecen también, y en un cálido y restablecer ellos son el uno que causó y mantener su estado .

excavación a través de la TRM para su núcleo o a través de la especificación de registro para el chip, y ver si hay algún registros cuyo estado de reinicio no está definido, uno que utiliza normalmente Dont y no dañará el chip si se establece a algo, y ver lo que se pone en marcha como, que es donde me gustaría empezar a buscar.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top