Quote from: LubOlimex on February 05, 2013, 11:40:48 AM
To identify whether the problem is hardware or software (project options, etc) it is a good idea to try uploading the example available at our web site: https://www.olimex.com/Products/ARM/ST/STM32-E407/resources/STM32-E_revB1_demo.zip (https://www.olimex.com/Products/ARM/ST/STM32-E407/resources/STM32-E_revB1_demo.zip)
I've already tried that but I didn't manage to download image correctly from IAR. Before that strange problem I didn't have any difficulties with downloading and debugging from IAR (STM32-E_revB1_demo.zip and my code).
Quote from: LubOlimex on February 05, 2013, 11:40:48 AM
Another thing you might try is to use the ODS IDE
I would like to use IAR because I use it at work and I'm used to it. Also, everything worked fine so I would like to find solution for my problem.
As a matter a fact, I have already found a workaround for my problem. While I was searching for solution I came across on link https://forum.sparkfun.com/viewtopic.php?p=67685
I'll try to explain procedure that works for me...
I took the STM32-E_revB1_demo.zip and erased all files except ST library, board specific files, startup file and main. I also deleted all code from main.c and left only SysInit and empty while(1) loop. The idea was mainly to initialize interrupt vectors.
After that I programed my Project.bin image to flash via telnet. Then I tried download it trough IAR couple of times and everything worked fine. Info window looked like on http://i.imgur.com/0lKDKBs.jpg (http://i.imgur.com/0lKDKBs.jpg).
Then I downloaded successfully my CODE from IAR and finally I was able to debug it! But...after that I tried once more and error popped up again! You can see that on http://i.imgur.com/FW5n3d7.jpg (http://i.imgur.com/FW5n3d7.jpg) http://i.imgur.com/Aet57AD.jpg (http://i.imgur.com/Aet57AD.jpg)
Then I tried to download from IAR my "empty" code and got the same error. Then I tried once again and I managed to download it without errors. After that I was able to program my code.
Conclusion:
To debug my code (let we say that I have my "empty code" downloaded to flash) trough IAR I have to do next steps:
Program my code and debug it. If I want to change something and download it again I have to do next:
1. Download my "empty code" for the first time. (Stack warning)
2. Download my "empty code" for second time. (No warnings no errors and debugging works fine)
3. Download my code. (No warnings no errors and debugging works fine)
4. If I have to change something and then debug it--> jump to step 1
I would also like to ask how can I set CSTACK starting address to top of the RAM 0x20020000 in startup.s file
because as I can see it is not set to that address by default.
Thank you!
Best regards,
Marko