Sign in

username:

password:



Not a member?

Search 68hc12



Search tips

Subscribe to 68hc12



68hc12 by Keywords

68HC1 | 812A4 | 9S12DP256 | Bootloader | CodeWarrior | D60A | Debugger | DP256 | ECT | EEPROM | EVB | Flash | HC1 | HCS12 | I2C | IAR | ICC1 | Interrupts | LCD | M68KIT912DP256 | MC9S12DP256 | MC9S12DP256B | Metrowerks | Motor | MSCAN | Multilink | PLL | Quadrature | SDI | SPI | Transceiver | XFC

Sponsor

controlSUITE™ software
Comprehensive.
Intuitive.
Optimized.

Real-world software for real-time control. Details Here!

Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | 68HC12 | Metrowerks user: How to access a specific Flash position (absolut e addressing)?

Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).

Metrowerks user: How to access a specific Flash position (absolut e addressing)? - Roth Markus - Feb 4 8:03:00 2003

My (safety related) application has to recognize changes in the code (in the
Flash). I have to calculate a CRC checksum over the whole code in the Flash.
Thus I have to access every Flash cell in an absolute addressing manner.

Any idea how to read out the whole Flash this way?

Any hint is highly appreciated.

Thanks, Markus




______________________________
controlSUITE™ software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!



(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )


RE: Metrowerks user: How to access a specific Flash position (absolute addressing)? - Erich Styger - Feb 4 12:13:00 2003

Markus,
check out:
CodeWarrior Manuals\pdf\Manual SmartLinker.pdf
chapter "Linker Defined Objects".
Search for "checksum" to get there as well.
The linker generates special symbols for it, e.g.
. "__SEG_START_": start address of the segment
. "__SEG_END_": end address of the segment

There is example code as well for it.

Erich
> -----Original Message-----
> From: Roth Markus [mailto:]
> Sent: Dienstag, 4. Februar 2003 14:04
> To: '
> Subject: [68HC12] Metrowerks user: How to access a specific Flash
> position (absolute addressing)? > My (safety related) application has to recognize changes in the
> code (in the
> Flash). I have to calculate a CRC checksum over the whole code in
> the Flash.
> Thus I have to access every Flash cell in an absolute addressing manner.
>
> Any idea how to read out the whole Flash this way?
>
> Any hint is highly appreciated.
>
> Thanks, Markus > --------------------------------------------------------
> To unsubscribe from this group, send an email to: > To learn more about Motorola Microcontrollers, please visit
> http://www.motorola.com/mcu


______________________________
controlSUITE™ software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!



(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Metrowerks user: How to access a specific Flash position (absolut e addressing)? - varneybob - Feb 5 12:18:00 2003

Here is pseudo-code for an additive checksum (not a CRC) but you
should get the jist: WORD checksum = 0x0000u; // initialize checksum value to zero
BYTE pageVal; // Flash PPAGE values are from 30h to 3Fh
WORD address; // Flash Page window at 8000h to C000h

// Loop over all Flash pages.
//
for (pageVal = 0x30u; pageVal <= 0x3Fu; pageVal++) {

// Set the PPAGE register to bring in the appropriate Flash
// page into view.
//
PPAGE = pageVal;

// Loop over all addresses in the page window.
//
for (address = 0x8000u; address < 0xC000u; address += 2) {

// Add the 16 bits at `address' to the checksum.
//
checksum += *((WORD*) address);
}
}

// Determine what the checksum should actually equal.
//
WORD expectedChecksum = readConfigParameter(EXPECTED_FLASH_CHECKSUM);

// Compare the actual checksum to the expected checksum.
//
if (checksum == expectedChecksum)
// Signify test as "Passed"
else
// Signify test as "Failed" --- In , Roth Markus <markus.roth@s...> wrote:
> My (safety related) application has to recognize changes in the
code (in the
> Flash). I have to calculate a CRC checksum over the whole code in
the Flash.
> Thus I have to access every Flash cell in an absolute addressing
manner.
>
> Any idea how to read out the whole Flash this way?
>
> Any hint is highly appreciated.
>
> Thanks, Markus


______________________________
controlSUITE™ software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!



(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )