We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
We started to use the phyCoreXC161-Board from Phytec and now we have got a strange problem. We started with the Project "C:\Keil\Boards\PhyCORE XC16x\Blinky.uv2". The only modification in the complete project we made was the declaration and the initialisation of the array cIEC[] in Blinky.c, as you can see below. We build the target as an "external flash"-application, no setting was changed. When we compiled it there were no errors and no warnings. But when we tried to download it with ULINK, we get the message "Flash download failed" at about address 0x4000. When we delete the new declared array and rebuild it, the download works fine again as well as the debugging. We are also able to declare the array without an initialisation. It is also possible to declare it as static, as well as a global declaration outside the function (each time with initialisation.) It is also strange that we we can load the built HEX-File with the Flash-tool of Phytec via RS232. If we do so we can also debug it with the ULINK. But this can not be a practical solution. This problem also occurs in all off our other projects.
Best regards M.Ubbenhorst
/*-----------------------------------------------------BLINKY.C: adapted for XC161/XC164 Board
Copyright 2003 Keil Software, Inc. -------------------------------------*/
#include <stdio.h> e #include <XC161.h> #include <math.h>
sbit P9_0 = P9^0; sbit DP9_0 = DP9^0;
char const xhuge a[0x60000] = 0;
/****************/ /* main program */ /****************/ void main (void) { unsigned long i=0;
char cIEC[5] = {0x39,0x37,0x37,0x36,0x36};
DP9_0 = 1;
do {
P9_0 = 1;
for (i=0; i<100000; i++) {;}
P9_0 = 0;
} while(1); }
You did read the information about how to format code in your posts?
What is the 384kB zero-initialized const data you have in your variable a[]?
Sorry, I am new here !! I suppose I will learn!
This doesn't matter ! Also if I leave this line, I have got the same problem!
Can you please provide the exact error message that you are getting including all address information. Did you check that you have memory available and a Flash algorithm selected for the address that generates an error?
Can you please provide the exact error message that you are getting
The exact Message in a small window was: "Error: Flash Download Failed -" after the target hardware was erased and programmed at about address 0x4000
including all address information.
The target settings were:
Memory model: small; Use of ON-Chip XRAM 0xC000-0xCFFF; External memory #1 ROM Start:0x000000;Size:0x100000; Near memory: 16kB RAM and 16kB ROM; Data threshold: near 6;
Did you check that you have memory available and a Flash algorithm selected for the address that generates an error?
the flash algorithm I selected in the settings for ULINK in the utilities is: AM29F800BT Ext.Flash Start:0x000000;Size:0x100000 Offset:0x000000
I also tried the the following target settings :
Use of XRAM was disabled:; instead I activated: External memory #2 RAM Start:0x200000;Size:0x80000
The startup file I use is the original Start_v2.a66 in the project folder
By the way the correct project folder we started with was: "c:\Keil\C166\Boards\PhyCORE XC16x\Blinky.uv2"
I found the solution by myself in the Programming algorithm for the ULINK. The Board we got was equipped with a AM29F800BB-flash. I only had an algorithm for the AM29F800BT which was used in the default example project. After assembling the new algorithm the problem has gone. Am I wrong, or should Phytec have known this ?????