This makes clear that the timestamp is not the actual time, but the
seconds since the device started.
The timestamp is also not stored in NVM anymore, as the DayCount provides
information about the operating time of the device already. This way
it can be found out if there was a reset of the device based on its uptime.
- Increase PWM step size to see differences between each controller run
- Take ADC2 measurements (current sensors) synchronous to voltages
(previous approach with high-rate current measurement once per PWM
cycle only makes sense for cycle-by-cylce control, not for slow MPPT)
The controllers with fast ADC sampling speed were sometimes switched off
immediately after turn-on. Switching off at negative power flow is only an
additional safety measure. Normally the controller should switch off
reliably because of power_good_timestamp already.
Reason: We need to wait until the clock enable register is actually set before
we can consider the clock running. This caused an issue with the CRC
peripheral, which sometimes did not work correctly (always returned 0) right
after startup.
This commit switches to LL API, which includes a delay. Updating all occurences
of direct clock enabling via registers and not only the CRC peripheral.
The hardware CRC calculation fails hard if a non-aligned memory pointer
is passed to it. This was leading to random issues when changing
unrelated parts in the firmware so that the compiler shuffled memory
locations.
Telling GCC that it should word-align the buffer fixes the issue.
Also renaming _lock to eeprom_buf_lock.
For PWM charge controllers, the topping stage was sometimes very short
and the battery did not get fully charged.
This commit adds a voltage_filtered and current_filtered member variable
to DcBus and PowerPort classes which can hold measurements more heavily
filtered (initial time constant setting: 10 seconds). This should fix
above issues with the charging algorithm.
The previous approach to define the pinmux in the timer nodes didn't work
because the timers don't have a pinctrl-0 property. This commit adds a new
half-bridge binding similar to upstream Zephyr pwm binding, which is a child
node of the used timer.
It makes sense to define PWM frequency and dead-time also in this node, so
the dcdc devicetree binding is redundant and therefore removed.
The v2.5-branch is based on upstream master until Zephyr v2.5 is released.
hal_stm32 needs to be overwritten with forked version to support new pinctrl
introduced in Zephyr 2.5.
Also fixing some CAN issues because of API changes to make it compile.
This allows us to enable e.g debug output for the CAN module with
CONFIG_CAN_LOG_LEVEL=4 without enabling the global
CONFIG_LOG_DEFAULT_LEVEL=4 and being swamped with debug output from
all of Zephyr's subsytems.