HC08 C Flash read write routines NOT using inbuilt routines

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

HC08 C Flash read write routines NOT using inbuilt routines

3,806 Views
CarlFST60L
Senior Contributor II
hi all, another thread on this topic:
I have read a few hundred post's on the "Complete C flash routines" , but still no actual complete C code to read, write and erase flash from C that requires 'work' (but some good info to get going in the right direction)

Is anyone willing to share their code C code to read/write/erase flash without using inbuilt routines, or, a majority of asm code?

Im very suprised at the amount of questions on this topic, yet freescale / codewarrior have not publised C code to read/write to flash without using inbuilt routines or significant asm code...

Thanks for sharing : )
Carl
Labels (1)
0 Kudos
5 Replies

457 Views
CarlFST60L
Senior Contributor II
Im sorry, I didnt make my post clear.

I am after C routines to erase/write flash on the fly i.e. using the flash as EEPROM style storage while running code...

So far i have seen a link to a how to setup metroworks to copy the erase/write functions to RAM but thats only a reference, and freescale use codewarrior. I dont want to use the assembly code and call them as function / or run as assembly code from C... I also have C code to do erase/write with inbuilt routines (which is very basic), i have code to write/erase flash which wont work as its not running in RAM, and no working code to load these functions into RAM using codewarrior...



Thanks,
Carl
0 Kudos

457 Views
peg
Senior Contributor IV
Hi Carl,
 
I am still unclear on exactly what it is that you are after.
I would have thought that what you could have found here on these forums and what Alban had pointed out would have sufficed.
You also seem to be against using Codewarrior, is this correct?
You seem to be trying to achieve a solution in pure C (whatever that is). However I would have to ask why? The programming of the flash is very device/technology/timing specific. C is not the best language for this sort of thing and most of the aims of using "pure" C would not apply.
Perhaps if you would share your reasoning on this, someone may be able to suggest a way forward for you.
 
0 Kudos

457 Views
bigmac
Specialist III
Hello Carl,
 
You do not say which HC08 derivative you are using.  I am unclear why you would not want to use the ROM based routines.  Their use should simplify the coding for what you are trying to achieve.
 
There should be few issues with calling the assembly routines from C.  I would suspect that the main issue may be setting up the data buffer at the required location, as required by the routines.
 
Regards,
Mac
 
0 Kudos

457 Views
CarlFST60L
Senior Contributor II
I am using the HC908GP32 for this development all in Codewarrior.

The routines are quite simple to erase/write flash in C for the GP32, but getting them to run out of RAM has proven to be more difficult.


0 Kudos

457 Views
Alban
Senior Contributor II
Hello,

Freescale has published NVM (flash and E²PROM) drivers for all HC08 devices.
You probably read the wrong hundreds of posts.

They are cleverly accessible from the device page, as Design Tools -> Software

HIS-DRIVER_HC908SGF50NVM 
HIS-compatible Driver for 0.50µm SGF Flash in HC908

HC908SGF50NVMSSD 
HC908 SGF NVM Standard Software Drivers
Program/erase software driver for 0.5µm SGF NVM (flash and EEPROM) in HC908
SGF means Split Gate Flash
NVM means Non Volatile Memory

Regards,
Alban.
0 Kudos