The code assumes that whenever scheduler is running I2CSemaphore is
available. Initialising it in a task might lead to race conditions and
is also not happening at all if the task is disabled (for debugging or
due to lack of need for a particular usecase).
The race condition can't happen with the current code though, as GUI
task has lower priority than the MOV task, and they're the only tasks
that currently use I2C. However, this might change in the future with
the code refactoring or introduction of new features.
This patch makes allocating special pages automatic and flexible,
allowing flash size and application start offset specification with
linker command line arguments. It should allow easier porting to
different targets and experimentation without adding code complexity.
Many original STM32F103x8 chips have fully functional 128 kiB flash and
so this additional space might come useful for experimentation,
additional optional features etc. Tested on v2.51A board, including
writing and verifying 128 kiB of random data.
Make variables are added to control that, so to build for the full
undocumented flash size and dapboot configured to start the app from 8
kiB offset one can run:
make flash_size=128k bootldr_size=0x2000
This updates Cortex-M3 port files to version found in
V10.3.1-kernel-only tag of FreeRTOS-Kernel.
The new upstream release includes memory barriers which are essential
for use with modern optimising compilers. Without those firmware
certainly breaks with -O3 -flto and might be also broken with other
optimisation configurations.
Fixes: d59ec10c4e ("Update FreeRTOS to v10.3.1")