Temporary Flash page

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Still battling on with why my SPM routine does not work properly. Found that I sub'd a word count which should have been a byte count though. Now instead of the erased page, I get a page full of 0's

So where abouts is this mysterious 'temporary flash page', Because I setup the Z pointer to the page that I want to erase/program, but I am getting a zero'd page back. I know that the pointers are going to the correct data, and there should be some data there, but nothing is appearing :(

Any help welcome :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can you use your programmer to down load the whole flash area and view it to se if you have written anywhere at all?
Also you say you are getting back a zeroed page do you mean erased ie all 0xff's.
Mike

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Mike,

Having studied the data sheet further it worded things slightly different to how I remember, i.e. you could run the SPM instruction from anywhere within NRWW memory, as it turns out you can't, you can only execute the SPM instruction successfully when you have the SPM instruction inside the bootloader section of memory. e.g. if BOOTSZ=128, the spm will only work properly in the last 128bytes of flash.

I managed to program the lock bits to put the boot section at 1024 bytes (My SPM routines start at 1C00), and now everything works fine. Took me a while to read the data sheet saying you need to erase the device before changing the boot section size lock bits. You have to do it manually in the STK500 part of Studio 4.07!

However, before I did this, the SPM instruction did used to clear the page, i.e. perform a page erase, and when I aligned the address with the page start for the write it started to clear that page (all to 0x00). So it does do something when in the NRWW section, and not within the boot loader section, but it behaves, well, odd.

Anyway, all sorted now, thanks for all your replies.

Best Regards,
Brian Sidebotham.