2015-11-27 09:41 AM
2015-11-27 01:22 PM
Not sure I'm up to second guess what in the project/loader isn't quite right. Suggest you zip up both as complete projects for review.
If you have a USART connection, the thing to do would be to dump out the memory content at 0x08003000, or some stats out the back end of the YModem transfer. Not a big fan of Hyper Terminal. Something likehttp://www.clearconnex.com/content/clearterminal
supports X/Y-Modem and can display interactions/responses outside of the download protocol. Setting RAM to 0x21000000 is definitely going to cause headaches. A base of 0x200000C0 should get beyond the scope of the Vector Table. This needs to be the ClockCmd form not the ResetCmd form, ST has a long standing bug with this.RCC_APB2PeriphResetCmd(RCC_APB2Periph_SYSCFG, ENABLE);
2015-11-30 03:25 AM
Thanks Clive1 for the pointers. As you suggested, I changed few things:
1: Dump the application start address (0x0800 3000) on serial console, after the successful IAP over UART using Ymodem protocol and I see that the values are not 0xFF ..... but are rather some meaningful values. Attached here is the screen capture ( capture_HT_NOV30_2.txt) and also in the debug window of IAP driver, I see that the application memory address is indeed not 0xff anymore. (Please refer the screenshot attached: IAP_Driver_Debug_window_Memory_dump) 2: Changed reset command to clock command as you suggested. i.e. in the application f/w code://RCC_APB2PeriphResetCmd(RCC_APB2Periph_SYSCFG, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
3: Set the IRAM1 in application code to0x200000C0 and compilation works fine. 3: Attached here is the zip of the IAP driver and the application f/w code (stm32f0_programming_usart_modified.zip). Note that the check for application code and Jumping to it from IAP driver code is commented out at the moment. You will have to comment line #77 in IAP driver code and un-comment line #83 -101 to test the jump logic in the IAP driver code. However at the moment I see that the following test in the IAP driver fails in my case: if
(((*(__IO uint32_t*)APPLICATION_ADDRESS) & 0x2FFE0000 ) == 0x20000000)
I get 0x2FFE0000 instead of 0x20000000 and hence the IAP driver does not jump to the application. Application f/w code: ~/stm32f0_programming_usart_modified\STM32F0xx_AN4065_FW_V1.0.0\Project\STM32F0xx_IAP\binary_template IAP driver code:~/stm32f0_programming_usart_modified\STM32F0xx_AN4065_FW_V1.0.0\Project\STM32F0xx_IAP\MDK-ARM
________________
Attachments : capture_HT_NOV30_2.txt : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I12U&d=%2Fa%2F0X0000000bhE%2FqBdrhAaUNFw1ydi6OsVhIsSuWNENuQZtCy3jwp4xdt4&asPdf=falseIAP_Driver_Debug_window_Memory_dump.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I12P&d=%2Fa%2F0X0000000bhD%2F3znm6gWvrYxY05wADH5XTdmHOFD7dUPJoeSzXq_czCE&asPdf=falsestm32f0_programming_usart_modified.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0vZ&d=%2Fa%2F0X0000000bhC%2F6lnals._LedG4Gy2gsOVVxLcjq7q5OXE09K.qA_oiF4&asPdf=false
2015-11-30 07:27 AM
Figured out the problem, actually it was a quite silly problem.
Under Keil uVision5 -> Option for target -> Debug -> settings -> Flash download -> Download function:Erase Full chip
was selected for IAP driver code, hence after downloading the application firmware and then reflashing it again for testing the jump logic was causing application f/w area to be erased and hence I was seeing it 0xff .... in the debug window. This time, to test this jump logic i selected ''Erase sectors'' under the same tab and now i see my application f/w which was for blinking a LED on my target board working.