dmitrystu / sboot_stm32

Secure USB DFU1.1 bootloader for STM32
Apache License 2.0
303 stars 63 forks source link

Platform init #17

Closed fizzyade closed 4 years ago

fizzyade commented 4 years ago

Ideally the boot loader should provide a platform_init() type function (by default it does nothing and is weak) which is executed before any of the boot loader verification functions are run, ideally it should be called as early as possible.

The idea behind this is that it would allow the system clock to be configured to the fastest available for the platform, this would have a dramatic effect things like PKI signature verification.

dmitrystu commented 4 years ago

I accept this point, but in other side some sort of the platform_deinit() must be added to revert back settings if bootloader start is not required. It will enlarge code. But i have an idea how to to this other way.

dmitrystu commented 4 years ago

Could you check this experimental branch? Done for F4.

fizzyade commented 4 years ago

I'll have to look ASAP Dmitry. I've only just returned to the project that is going to be using this and it's taken me a while to remember where I was and what I was up to!

I'm just adding support into our application firmware for the DFU runtime descriptors and control endpoint commands that are needed, then I will test this, although this particular board is using a L4 processor.

dmitrystu commented 4 years ago

BTW L4 is done. https://github.com/dmitrystu/sboot_stm32/commit/87fe5f201efac6a96c5ad194247666524d57b6c3

dmitrystu commented 4 years ago

This feature was implemented. I will close this issue.