394
On later silicons, this has been corrected. This bug applies to all devices with mask
0M33Z from the 100MHz series.
The J-Link software and documentation package comes with a sample project for the
Kinetis K40 and K60 devices which is pre-configured for the TWR-40 and TWR-60 eval
boards and ETM / ETB Trace. This sample project can be found at \Sam-
ples\JLink\Projects .
15.6.1.3 Data flash support
Some devices of the Kinetis family have an additional area called FlexNVM, which can
be configured as data flash. The size of the FlexNVM to be used as data flash is con-
figurable and needs to be configured first, before this area can be used as data flash.
The sample below shows how to configure the FlexNVM area to be used as data flash
out of the target application.
For J-Flash there are also projects that are preconfigured to setup the data flash size
of a Kinetis device. The projects can be found at $JLINK_INST_DIR$\Sam-
ples\JFlash\ProjectFiles.
MK40DX256xxx10_ConfigureDataFlash.jflash .
For more information about how configuration of the data flash works, please refer to
the appropriate user manual of the device.
Configure FlexNVM area as data flash
The follwing sample configures the data flash size of Kinetis device. It is created for a
MK40DX256xxx10 device. The sequence is almost the same for all Kinetis devices
only the lines which configure size of the data flash may be modified. In this sample
the data flash is set to max size. EEPROM size is set to 0 bytes.
#define FSTAT
#define FCCOB0
#define FCCOB1
#define FCCOB2
#define FCCOB3
#define FCCOB4
#define FCCOB5
#define FCCOB6
#define FCCOB7
#define FCCOB8
void ConfigureDataFlash(void);
*******************************************************************
*
*
ConfigureDataFlash
*
*
Notes
*
Needs to be located in RAM since it performs flash operations
*
which make instruction fetching from flash temporarily not possible.
*/
void ConfigureDataFlash(void) {
unsigned char v;
//
// Read out current configuration first
//
FSTAT
= 0x70;
FCCOB0 = 0x03;
FCCOB1 = 0x80;
FCCOB2 = 0x00;
FCCOB3 = 0xFC;
FCCOB8 = 0x00;
FSTAT
= 0x80;
while((FSTAT & 0x80) == 0);
//
J-Link / J-Trace (UM08001)
CHAPTER 15
One
(*(volatile unsigned char*)(0x40020000 + 0x00))
(*(volatile unsigned char*)(0x40020000 + 0x07))
(*(volatile unsigned char*)(0x40020000 + 0x06))
(*(volatile unsigned char*)(0x40020000 + 0x05))
(*(volatile unsigned char*)(0x40020000 + 0x04))
(*(volatile unsigned char*)(0x40020000 + 0x0B))
(*(volatile unsigned char*)(0x40020000 + 0x0A))
(*(volatile unsigned char*)(0x40020000 + 0x09))
(*(volatile unsigned char*)(0x40020000 + 0x08))
(*(volatile unsigned char*)(0x40020000 + 0x0F))
// Clear error flags in status register
// Read resource
// Read from data flash IFR area with offset 0xFC (0x8000FC)
// Select IFR area to be read
// Start command execution
// Wait until flash controller has finished
of
these
sample
© 2004-2017 SEGGER Microcontroller GmbH & Co. KG
Device specifics
projects
is
the
Need help?
Do you have a question about the J-Link and is the answer not in the manual?