This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
I'm currently looking into developing my own bootloader, but I'm not sure if I'm doing it correctly. So here are several questions currently on my mind:
Is there a define somewhere which gives me the flash page size and number of pages?
Regarding flash wearing: Does the flash wear down on page erase only, or also during writing the 0's?
Things one has to take care of when developing your own bootloader:
Before jumping to the user application, deinitialize all peripherals you used with sdStop(&device) etc.
After Erasing a page deselect the FLASH_CR_PER bit (it's not done automatically)
In the user application the only thing you have to do is to define the new flash start in the linker script and set CORTEX_VTOR_INIT to the new offset (best in chconf.h).
mabl wrote:[*] Is there a define somewhere which gives me the flash page size and number of pages?
One of the serious weaknesses of STM32F's - lack of that info embedded into chip Mentioned countless times on official STM32 board, but without any response from ST...
Hi Giovanni, thx for the kind words. There are of cause still some rough edges and I did not optimize for RAM usage. For example I modify each page first in memory before it is written back - so this already needs 2K...
I've moved the blinker thread into main. The MMCFlasherThread uses fatfs and would hence need a bigger main stack.
Known limits of my bootloader:
One could add exception handlers which catch exceptions on jump to the user application.
The bootloader expects that there is no page protection in place. But I guess there is no need for IP protection in our firmwares...
Thanks for making the bootloader available, exactly what I was looking for! An example of an application which can be loaded using the bootloader would be really useful though. Could be just a simple bilnker - just to show where to put change CORTEX_VTOR_INIT and how to init/deinit it.