2014-08-24 02:47 AM
Hi!
I work with STM32F427 with 2 Mb flash size and want use high flash bank to load firmware image when upgrading.When I allocate firmware image in low bank (512kb) all works properly, but when i assign address to image to high bank (1024 kb)- i see hard fault error at random points and time- such effects is as stack corrupts. Soft is identical- only image allocation address differ. I know, that when i programm flash in same bank, when code execute- cpu stall, and no interrupts occures, but when code execution is in bank1 and we programm flash in bank 2- code will be executed, so will be interrupts services, including RTOS context switshing etc. Is any limitation of interrupts or some commands execution, while flash programming executed in opposit bank? #stm32f427-flash-dual-bank2014-08-24 05:35 AM
Hard Faults occur for a number of reasons, if you had an effective handler and debugging strategy you could probably determine exactly why.
You need to make sure that SCB->VTOR, the Vector Table, is correctly configured for the alternate address, this is usually done in SystemInit() in system_stm32f4xx.c Also if you are swapping the high/low regions of flash then the address will not actually be different. If you aren't swapping regions, then you do risk bricking the device.2014-08-24 07:52 AM
2014-08-24 09:42 AM
1 I dont change any settings of SCB->VTOR because upper bank i use only for load new firmware image, that later will be written to low bank. Hard Faults occur at load image process, i.e. at original firmware, and only if load address -is in upper flash bank and low bank - all application tasks and interrupts work. So i see incompatibility of application work (RTOS, IT, etc) with flash program process.Application firmware is same, and Hard Faults occur at random points (most frequently in RTOS core). I think it is concerned with some CPU commands , witch RTOS use or DMA process.
2 I don't understand about ''swapping the high/low regions''- it will be very useful to change regions- i.e. start from bank1 or bank2? but i not find in datasheet how realize that.
An RTOS is likely to preclude the use of certain instructions. I'd probably look at memory usage, and exactly how/what you're writing. Reference Manual (RM0090) - SYSCFG_MEMRMP
2014-08-24 11:58 AM
2014-08-24 02:17 PM
SYSCFG_MEMRMP and bit FB_MODE is not nonvolatile, so system will allways start from bank1, and later we may set FB_MODE to remap flash- is it so?
Please top post responses so they are visible. There is the BFB2 bit in the option bits, pretty sure the Note is wrong, as the second MB is at 0x08100000 not 0x08080000 as it is on 1MB 512+512KB type devices. I would generally still opt for a boot loader in the first 16KB, and have that do the mapping. I think you'd need to check what the BOOTx pins do, and how the System Loader execute/map memory in the second bank.2014-08-25 01:13 AM
2015-12-04 04:48 AM
Hi,
I am experiencing the same issue on STM32F427 1MB with dual bank mode enabled. Did you have any luck solving the problem?2015-12-04 05:11 AM
Ok, the OP has a total of 4 posts, all in this thread, from over a year ago. Can we please not play me-too, the forum by default isn't going to ping respondents.
Sounds like you have a different part. Perhaps you can clearly, and completely, state your case, including what exactly the problem is and what you have tried, the results, and the mapping registers described in this thread.2016-09-03 01:16 AM
Problem was resolved only by disabling all interrupts and DMA transfers(waiting its complete) at flash programming time. It is not satisfy the request of full-time work in
download firmware image proccess. So i had use external SPI flash to load firmware image.