2016-10-11 09:41 AM
Hey all,
I have a problem when I'm debugging the STM32F091RC the firmware doesn't work. I break and the address is so high, about 0x1fffda7c. I've tried the demo examples and the same thing happens. Initialy, the firmware works, but after it goes to the address above. WDT is not active.2016-10-11 09:53 AM
Make sure BOOT0 is pulled low in your design.
2016-10-11 11:11 AM
Hi xarada,
It is an address in the system memory region ( check table.2 in reference manual RM0091). In order to boot from Flash memory, you should connect the Boot0 to GND and ensure BOOT_SEL bit is set in the user option byte ( see Table3. Boot modes). Another case that may be the root cause , is the empty check flag that can be set.This flag is updated only during Option bytes loading: it is set when the content of theaddress 0x08000 0000 is read as 0xFFFF FFFF, otherwise it is cleared. It means a poweron or setting of OBL_LAUNCH bit in FLASH_CR register is needed to clear this flag after programming of a virgin device to execute user code after System reset.(page 52-53 in RM0091)-Hannibal-2016-10-13 06:02 AM
Hi Hannibal and Clive1,
Thank you for answer. The problem is really the BOOT0 pin, I'm using as an output and I need this because I have all pins used. I've read that I can use the option byte to configure the boot and leave the BOOT0 pin free to IO purpose. I if configure with ST-LINK Utility this bit the debug works correctely (so you are right), but I'm trying to configure by firmware this bit and it doesn't work. Below I put the code to write at BOOT_SEL [bit 23] from Option Byte address 0x1FFFF800./* Unlock the Flash to enable the flash control register access *************/
HAL_FLASH_Unlock();
/* Unlock the Options Bytes *************************************************/
HAL_FLASH_OB_Unlock();
/* Get pages write protection status ****************************************/
HAL_FLASHEx_OBGetConfig(&OptionsBytesStruct);
OptionsBytesStruct.USERConfig = 0x7F;
OptionsBytesStruct.OptionType = OPTIONBYTE_USER;
HAL_FLASHEx_OBProgram(&OptionsBytesStruct);
Is there anything wrong?
Thank you