cancel
Showing results for 
Search instead for 
Did you mean: 

ST7 IAP - Odd functionality after IAP and reset

md21028
Associate II
Posted on May 17, 2004 at 10:46

ST7 IAP - Odd functionality after IAP and reset

3 REPLIES 3
md21028
Associate II
Posted on May 08, 2004 at 18:58

I am currently working on a bootloader application for an ST72F521. I have been able to successfully reprogram the micro in IAP mode. The problem that I am having is after the micro is reset. After a reset is performed it gets to a certain point in the code, and seems to stop. I believe the problem is caused becuase of my interrupt vector. I will explain why, but first I will give a few details:

The code to beprogrammed in ICC mode will be called BLDR2 (loaded in sector 0) and the code that I am reprogramming the micro in IAP mode is BLDR_load. The files are identical, with the exception of a different software revision number that will be retrieved later through sci.

To test the differences in the two files I am using a hex file comparor. I first program the micro with BLDR2 with a DVP3. I then use STVP to read the sectors and save the file as an .s19 file for comparison (we'll call it BLDR_std.s19). Then I initiate the IAP sequence. The IAP sequence unlocks the flash through the FCSR, erases the memory, initializes the sci for RS-232 communication, gets the .s19 file over the sci, and programs the micro in IAP mode for each S1 record recieved. Keep in mind that I am checking the status of each operation and verifying success. Once I recieve the S9 file I write 0x80 to the watchdog to generate a software reset. After the reset I use STVP to read the sectors and saved the .s19 for comparison (we'll call this BLDR_read.s19). I then open a Hex file comparason utility to look at the differences in the two files. Here is what I found:

Sectors 1 and 2 are equal byte for byte. Sector 0 is almost completely different. The thing that concerns me most with the difference is in memory location FFE0.....the interrupt vector. I used the HDFlashdemo as my guide when I wrote the interrupt vector file so I don't think that there is a discrepancy there.....but I am out of ideas.

Any input?

More pertinent info:

Cosmic Compiler

writing the code in c

shreya
Associate II
Posted on May 14, 2004 at 12:19

ST7 does not allow Sector 0 to be programmed or erased in IAP mode. What do you mean by ''Sector 0 is almost completely different''?

Did you follow the algorithm for IAP in HDFlashdemo? What were the changes you made in the code attached with the application note?
md21028
Associate II
Posted on May 17, 2004 at 10:46

When I said that sector 0 was almost completely different I was looking at each file in a hex comparison utility. I am not sure that this is the real issue though.

I followed the IAP HDFlash demo almost exactly. I have found where my mistake is though. In the demo they have all of the functions in sector 0, including the interrupt functions. In my application I have interrupt routines that are called in sector 2. It is my theory that although the interrupt functions may not have changed between revisions of software, when the program is compiled it dynamically assigns the interrupt vector. This begs the question: What exactly does the interrupt vector represent? Is it a pointer to a physical address? Also, to solve my problem I believe that I would have to initialize the interrupt function names so that they point to the proper interrupt vector offset. Am I on the right track?