Problems with In-Application-Programming of Data-Flash with extended Code Memory

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hello,

I need to store and erase parameter data via In-Application-Programming in the XC886 32kB Flash Device.

Moreover I have a lack of code memory. So I use 7kB of the Data-Flash as additional code memory.
This works fine. So the Code is executed well, independent if it is stored in the Program-Flash-Banks (0x0000…0x5FFF)
or in D-Flash-Bank 1 or in D-Flash-Bank 0.

2427.attach

If only D-Flash-Bank 1 is written with Code-Memory (till 0x6FFF), everything works fine. I can erase and write to the flash
without problems.

The point is: If D-Flash-Bank 0 is written with Code-Memory, the In-Application-Programing-functions don’t work anymore.
Sometimes I can’t erase the parameters (the function stays in an endless loop) and writing to the flash works.
Sometimes I can’t write to the flash and erasing works.

(Note: I am sure that the code memory is not in the sectors which I use as data and I am sure that I do not erase
or overwrite code memory)

I have attached a file with the Flash-functions I use. I relocated these functions via linker instructions to different places
in the code memory (0x7800, 0x6800, 0x5800, 0x2800, 0x2200). On some of these places the
In-Application-Programing-functions work again, but if I add or remove e.g. 100 Bytes of code, I have the same error.

Has anybody an idea?
0 Likes
0 Replies