DelfiSpace / DelfiPQcore

0 stars 1 forks source link

Print at startup the status of the oscillators #18

Closed StefanoSperetta closed 4 years ago

StefanoSperetta commented 4 years ago

I would like to print at startup the status of the different oscillators (right now only HF and LF but shortly also the DCO with external resistor), exactly as it is done by the reset handler. I would want this to happen by default in all projects so we can monitor on the console if one oscillator is not working...

How to do it? Might be a good idea to have a simple function inside DelfiPQCore that just prints the status? Querying the status is already implemented by getHFOscillatorStatus() and getLFOscillatorStatus().

Any idea?

CasperBroekhuizen commented 4 years ago

Since you want to print it, it should be called after the initialization of the serial port. I think the easiest right now is to absorb the functionality in the resethandler as well

CasperBroekhuizen commented 4 years ago

Besides InterruptStatusRegister (which holds the Fault Flags), there's also the StatusRegister which holds the status of all the clocks (on/off, ready/not ready). Obtaining them all will lead to a bootup log like this: image

Should we ommit clock status? or maybe only print if on. I assume the CS Fault Status will be saved on FRAM/Telemetry, but should the regular clock status also be saved on FRAM or Telemetry?

StefanoSperetta commented 4 years ago

As stated verbally, all clocks status might be a bit too much but errors are needed indeed.

We might have to think about a proper place to put the code though...

CasperBroekhuizen commented 4 years ago

Reduced the clock status print in https://github.com/DelfiSpace/DelfiPQcore/commit/74e4eb8a4bebc98e1b97167a8a2fa55ed68a7f75 .

Currently still in ResetService. We discussed to collect all fault-collection to a central object. Maybe a good place is the bootloader as it is always present in SLOT0 and always loaded. and the reset-faults should be used in the bootloader policies (https://github.com/DelfiSpace/DelfiPQcore/issues/21)

CasperBroekhuizen commented 4 years ago

Absorbed in HWMonitor