2021-01-01 10:59 AM
Hi all,
From Nucleo STM32WB55 to my own application with the same micro.
I have written an application based on Cable Replacement Service from examples.
I did my PCB and everything works.
Now I have to add my own bootloader with cipher.
Beacause of this I would like to place bootloader at the start of the flash memory and application in higher address, i.e. 0x80010000.
Unfortunatelly after modification in the linker script, everything looks that preloaded BLE stack FW, can't communicate with application.
This is my first STM32 project since 2013 and first with BLE so Iam not a master yet :).
In theory I can change the order - APP first and Bootloader in the higher area, but any crash while upgrading firmware will block everything.
What to do?
Regards
Mariusz D
2021-01-02 02:39 PM
Hi,
Linker script modification is not enough.
You need to relocate interrupt vector as well. You can do that by modification the following macros (code under links is just example)
or just update SCB->VTOR on your own.
2021-01-02 08:26 PM
Hi zbigelpl,
Thank you for help :).
It will be usefull for the future but finally, yesterday afternoon I have found this:
https://www.devcoons.com/howto-stm32-custom-bootloader-application/
After few unsuccessfull trys yesterday, now, in the morning I have modified correctly BL and APP and it works :).
Now next step - write to flash, but
../Application/User/Core/flash.c:37:18: error: 'FLASH_TYPEERASE_SECTORS' undeclared (first use in this function); did you mean 'TYPEERASE_SECTORS'?
.TypeErase = FLASH_TYPEERASE_SECTORS,
This is from:
https://www.devcoons.com/how-to-write-data-to-the-internal-flash-memory-of-an-stm32/
Investigation in progress...
Regards
Mariusz D
P.S.
zbiglpl looks like Zbig L. from Poland. Am I right?
md
2021-01-03 08:08 AM
Hi,
for STM32WB there is an easiest way - there are ready for use prototypes and they are shown in Examples of the Nucleo board.
Mariusz
2021-01-03 09:16 AM
Hi again,
Glad to hear you've made some progress!
> zbiglpl looks like Zbig L. from Poland. Am I right?
Correct.
2021-01-03 10:59 AM
Hi,
Today I have prepared sceleton of the BL with active interrupts!
It needs another order of calls than suggested in this example.
Looks crazy, but works.
If you are interested I can give you code when finished.
Regards
MariuszDwawpl