MC9S08LL36 Flash Page Query

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MC9S08LL36 Flash Page Query

Jump to solution
682 Views
Stryphe
Contributor II

Hi

 

I have ported to the MC9S08LL36 after using the MC9S08LL16, for larger ROM space. In an attempt to be having a cunning plan, I am now looking to attempt some Flash manipulation as a form of EEPROM storage.

 

As such, I am aware that if executing in one flash array, I can only write to a separate array. Now the LL36 refers to 2 separate Flash Array's: "MC9S08LL36: 36,864 bytes (12,288 in flash B and 24,576 in flash A)" - PG69 of MC9S08LL64RM.pdf. Many of the examples in the forum refer to moving the programming instructions into RAM to execute the required operations. Would I be able to run off Flash A for example, and periodically erase/write to Flash B as a method of non-volatile storage in the event of power loss etc?

 

Then there are some seemingly conflicting application notes I have found where it suggests I could erase just a small block at a time. Would there be a smaller amount I could allocate to erase and use, so that I don't have to wipe an entire flash-array? Like, for example, if I could wipe PPage2 (0x0A000 to 0x0BFFF) (only 8k of FlashA) or even smaller like a 512 byte segment?

 

Please let me know.

Many thanks!

 

P.s. (so far I have discovered that you can't initialise FCDIV or write to any of the Flash Registers in the high page (0x1820 to 0x1826) without FLS in SCGC2 being set.... very annoying since there is no mention in the RM (it appears more than one micro's RM is missing this tid-bit)).

 

EDIT:

I have just seen the following post with someone trying to do something similar:

https://community.freescale.com/thread/68167

I was also looking at AN3824SW which was too complicated and lengthy. I saw the attached S08_Flash_A2.zip in the above post which incidently I had just received today from support@freescale.com hehehe, so I will try to get it up and running correctly in the morning as I was struggling with FCDIV today.

Labels (1)
0 Kudos
1 Solution
269 Views
Stryphe
Contributor II

Hi

 

Nevermind! I have succeeded in running code on both flash arrays to maximise ROM space, and borrowing a couple of pages on one of the arrays to work as an eeprom and store variables for power-off state.

 

Thanks to bigmac for his post under this topic:

https://community.freescale.com/thread/68167

To note is that the erase only erases a single 512byte page, allowing you to not destroy code stored from programming.

 

This, along with simplified code sent from support@freescale.com, helped me solve my issues.

Also, of assistance was the below:

https://community.freescale.com/message/76638#76638

(The requirement of the FLS bit set in SCGC2 to allow the clocking of the flash).

 

Thanks guys :smileyhappy:

 

View solution in original post

0 Kudos
1 Reply
270 Views
Stryphe
Contributor II

Hi

 

Nevermind! I have succeeded in running code on both flash arrays to maximise ROM space, and borrowing a couple of pages on one of the arrays to work as an eeprom and store variables for power-off state.

 

Thanks to bigmac for his post under this topic:

https://community.freescale.com/thread/68167

To note is that the erase only erases a single 512byte page, allowing you to not destroy code stored from programming.

 

This, along with simplified code sent from support@freescale.com, helped me solve my issues.

Also, of assistance was the below:

https://community.freescale.com/message/76638#76638

(The requirement of the FLS bit set in SCGC2 to allow the clocking of the flash).

 

Thanks guys :smileyhappy:

 

0 Kudos