<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Crash when using FPEC after IAP with STM32F103</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/25854/crash-when-using-fpec-after-iap-with-stm32f103</link><description> 
Hi, 

 
I work with &amp;#181;Vison4 and a STM32F103RC. My software use lot&amp;#39;s
of peripherals (adc, usart, ...) and there is also an EEPROM
Emulation (Using flash and FPEC). It works well when the code is
loaded starting from 0x0800000. If I load the code staring</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Crash when using FPEC after IAP with STM32F103</title><link>https://community.arm.com/thread/115970?ContentTypeID=1</link><pubDate>Mon, 23 Aug 2010 03:19:11 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d594c7ec-3876-437f-897b-c4c28371d79f</guid><dc:creator>Pascal Munnix</dc:creator><description>&lt;p&gt;&lt;p&gt;
Here the message again:&lt;/p&gt;

&lt;p&gt;
Some more informations about the software:&lt;/p&gt;

&lt;p&gt;
the IAP-Software is loaded at 0x0800000 and is like this:&lt;/p&gt;

&lt;pre&gt;
int main (void)
{

unsigned long int JumpAddress;

init_RCC();

// *********************************************************************
// a few lines code deleted:
// waiting 1 sec while check usart1 if a new download is needed
// if download is need, than do it now starting from APPLICATION_ADDRESS
// *********************************************************************

// Test if user code is programmed starting from address &amp;quot;APPLICATION_ADDRESS&amp;quot;

if (((*(volatile unsigned long int *)APPLICATION_ADDRESS) &amp;amp; 0x2FFE0000 ) == 0x20000000) {
// Jump to user application

JumpAddress = *(volatile unsigned long int *) (APPLICATION_ADDRESS + 4); Jump_To_Application = (void *) JumpAddress;
// Initialize user application&amp;#39;s Stack Pointer

__set_MSP(*(volatile unsigned long int *) APPLICATION_ADDRESS); Jump_To_Application(); } while (1) { }
}

&lt;/pre&gt;

&lt;p&gt;
When I load my main application staring from 0x0800000 the
software works without failures.&lt;/p&gt;

&lt;p&gt;
When I load my main application starting from 0x08002000 I
uncomment the following in top of the code:&lt;/p&gt;

&lt;pre&gt;
NVIC_VTOR = (unsigned long int)0x2000; // uncomment with IAP!!!!
&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
This is the only difference between both applications (loaded at
0x0800000 and loaded at 0x08002000). There is no failure in the
transmission of the code. As soon as I try to write to the flash or
to erase a page, the software crashes when loaded at 0x08002000.&lt;/p&gt;

&lt;p&gt;
If I move the &amp;quot;writing to flash&amp;quot; to an other location, the
software crashes at the new location.&lt;/p&gt;

&lt;p&gt;
I hope you can read it now&lt;br /&gt;
Thanks for help&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Crash when using FPEC after IAP with STM32F103</title><link>https://community.arm.com/thread/104182?ContentTypeID=1</link><pubDate>Mon, 23 Aug 2010 03:02:29 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6c4336ad-300e-492b-a11c-9e0566006289</guid><dc:creator>Tamir Michael</dc:creator><description>&lt;p&gt;&lt;p&gt;
Please repost using the proper tags. I can&amp;#39;t read this!&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Crash when using FPEC after IAP with STM32F103</title><link>https://community.arm.com/thread/78579?ContentTypeID=1</link><pubDate>Mon, 23 Aug 2010 01:18:07 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:13edfe0a-e2dc-4ea8-8b2c-9d310b8a8bb8</guid><dc:creator>Pascal Munnix</dc:creator><description>&lt;p&gt;&lt;p&gt;
Here some more informations about the software:&lt;/p&gt;

&lt;p&gt;
the IAP-Software is loaded at 0x0800000 and is like this:&lt;/p&gt;

&lt;p&gt;
------------------------------------------------------&lt;br /&gt;
int main (void)&lt;br /&gt;
{&lt;/p&gt;

&lt;p&gt;
unsigned long int JumpAddress;&lt;/p&gt;

&lt;p&gt;
init_RCC();&lt;/p&gt;

&lt;p&gt;
//
*********************************************************************&lt;br /&gt;

// a few lines code deleted:&lt;br /&gt;
// waiting 1 sec while check usart1 if a new download is needed&lt;br /&gt;
// if download is need, than do it now starting from
APPLICATION_ADDRESS&lt;br /&gt;
//
*********************************************************************&lt;/p&gt;

&lt;p&gt;
// Test if user code is programmed starting from address
&amp;quot;APPLICATION_ADDRESS&amp;quot;&lt;/p&gt;

&lt;p&gt;
if (((*(volatile unsigned long int *)APPLICATION_ADDRESS) &amp;amp;
0x2FFE0000 ) == 0x20000000) {&lt;br /&gt;
// Jump to user application&lt;/p&gt;

&lt;p&gt;
JumpAddress = *(volatile unsigned long int *) (APPLICATION_ADDRESS
+ 4); Jump_To_Application = (void *) JumpAddress;&lt;br /&gt;
// Initialize user application&amp;#39;s Stack Pointer&lt;/p&gt;

&lt;p&gt;
__set_MSP(*(volatile unsigned long int *) APPLICATION_ADDRESS);
Jump_To_Application(); } while (1) { }&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;
-----------------------------------------------------&lt;/p&gt;

&lt;p&gt;
When I load my main application staring from 0x0800000 the
software works without failures.&lt;/p&gt;

&lt;p&gt;
When I load my main application starting from 0x08002000 I
uncomment the following in top of the code:&lt;/p&gt;

&lt;p&gt;
NVIC_VTOR = (unsigned long int)0x2000; // uncomment with
IAP!!!!&lt;/p&gt;

&lt;p&gt;
This is the only difference between both applications (loaded at
0x0800000 and loaded at 0x08002000). There is no failure in the
transmission of the code. As soon as I try to write to the flash or
to erase a page, the software crashes when loaded at 0x08002000.&lt;/p&gt;

&lt;p&gt;
If I move the &amp;quot;writing to flash&amp;quot; at an other place, the software
crashes at the new place.&lt;/p&gt;

&lt;p&gt;
Thanks for help&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Crash when using FPEC after IAP with STM32F103</title><link>https://community.arm.com/thread/58565?ContentTypeID=1</link><pubDate>Sun, 22 Aug 2010 19:51:49 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:3cacead0-f045-4b11-af95-85274cbf3e97</guid><dc:creator>Tamir Michael</dc:creator><description>&lt;p&gt;&lt;p&gt;
Do the IAP functions return an error code before the crash? Are
you sure all the code programming the flash is located in RAM ?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>