11#include " generated/stm32fxxx/PinoutTableDefault.hpp"
22#include " hal_st/cortex/InterruptCortex.hpp"
3+ #include " hal_st/instantiations/NucleoTracerInfrastructure.hpp"
34#include " hal_st/stm32fxxx/GpioStm.hpp"
45#include " hal_st/synchronous_stm32fxxx/SynchronousFlashInternalStm.hpp"
56#include " hal_st/synchronous_stm32fxxx/SynchronousSpiMasterStm.hpp"
67#include " services/synchronous_util/SynchronousFlashRegion.hpp"
78#include " services/synchronous_util/SynchronousFlashSpi.hpp"
89#include " services/synchronous_util/SynchronousSpiMasterWithChipSelect.hpp"
10+ #include " services/tracer/GlobalTracer.hpp"
911#include " upgrade/boot_loader/DecryptorNone.hpp"
1012#include " upgrade/boot_loader/ImageUpgraderFlash.hpp"
1113#include " upgrade/boot_loader/PackUpgrader.hpp"
@@ -31,13 +33,10 @@ constexpr services::SynchronousFlashSpiConfig CreateFlashConfig()
3133
3234void ProcessUpgradePack (infra::ConstByteRange flashMemory, uint32_t flashOffset)
3335{
34- static hal::InterruptTable::WithStorage<128 > interruptTable;
35- static hal::GpioStm gpio (hal::pinoutTableDefaultStm, hal::analogTableDefaultStm);
36-
3736 static std::array<uint32_t , 12 > sectorSizes{
38- 0x08000 , 0x08000 , 0x08000 , 0x08000 ,
39- 0x20000 , 0x40000 , 0x40000 , 0x40000 ,
40- 0x40000 , 0x40000 , 0x40000 , 0x40000
37+ 0x04000 , 0x04000 , 0x04000 , 0x04000 ,
38+ 0x10000 , 0x20000 , 0x20000 , 0x20000 ,
39+ 0x20000 , 0x20000 , 0x20000 , 0x20000
4140 };
4241
4342 hal::SynchronousFlashInternalStm internalFlash (infra::MakeRange (sectorSizes), flashMemory);
@@ -94,6 +93,16 @@ int main()
9493{
9594 HAL_Init ();
9695
96+ static hal::InterruptTable::WithStorage<128 > interruptTable;
97+ static hal::GpioStm gpio (hal::pinoutTableDefaultStm, hal::analogTableDefaultStm);
98+
99+ static hal::GpioPinStm traceUartTx{ hal::Port::D, 8 };
100+ static hal::SynchronousUartStmSendOnly traceUart{ 3 , traceUartTx };
101+ static services::StreamWriterOnSynchronousSerialCommunication traceWriter{ traceUart };
102+ static infra::TextOutputStream::WithErrorPolicy tracerOutputStream{ traceWriter };
103+ static services::TracerToStream tracer{ tracerOutputStream };
104+ services::SetGlobalTracerInstance (tracer);
105+
97106 extern uint8_t _flash_start;
98107 extern uint8_t _flash_end;
99108 infra::ConstByteRange flashMemory (&_flash_start, &_flash_end);
0 commit comments