I got hold of some KL24Z 64K 32-pin microcontrollers at around the same time I got the Kinetis FRDM-KL25Z and FRDM-KL05Z freedom boards. After playing with the KL25Z board for a while, basically trying different kinds of toolchains and Eclipse, I think its time to make some custom PCB prototypes with the kl24 chips, and use the freedom board as the debugger. One problem though… where to begin to write code? Ok i had a few bare-metal starter projects for the KL25Z target on the freedom board, but how to port to KL24Z?? I found out that Erich had already tackled how to install Processor Expert in Eclipse Kepler. Perfect!!
About the Expert!
In the words of the Vendor:
Processor Expert Software is a development system to create, configure, optimize, migrate, and deliver software components that generate source code for Freescale silicon.
Processor Expert is a tool with which, in a few clicks, an embedded developer can generate the right sources for a specific Freescale chip like the startup codes, linker files and Doxygen documentation. It actually has a lot of goodies and like one expert puts it,
“creating your own components can be addictive!”
So I just followed the tutorial, though i use Linux, and it all worked out. I installed the eclipse plugin without any problems and created a Processor Expert Project.
What Next?
- Learn a little more about Processor Expert.
- Build a sample application for my prototype.
- Buy more Freescale chips from this family for different uses 🙂
- May be if I get time, try to see how i can port my KL24Z board to mbed. I have come to love mbed! BTW, with the mbed firmware, I will successfully now flash the custom KL24Z in Linux with no problems.
Update
Beware of a famous pitfall!! I spent a fair share of my afternoon tracking a linker error thinking it was a problem with GNU-ARM tool-chain.
- Processor expert new project
- Processor expert choose device
- Processor expert perspective
- Processor expert eclipse project
Moar Updates:
I have played around with PE and I have a general understanding of how to add components, configure them and implement minimum code to have the hardware running.
Here is an RGB-LED-cycle application i just tested
/* ###################################################################
** Filename : ProcessorExpert.c
** Project : ProcessorExpert
** Processor : MKL25Z128VLK4
** Version : Driver 01.01
** Compiler : GNU C Compiler
** Date/Time : 2013-08-30, 21:44, # CodeGen: 0
** Abstract :
** Main module.
** This module contains user's application code.
** Settings :
** Contents :
** No public methods
**
** ###################################################################*/
/*!
** @file ProcessorExpert.c
** @version 01.01
** @date 2013-08-30, 21:44, # CodeGen: 0
** @brief
** Main module.
** This module contains user's application code.
*/
/*!
** @addtogroup ProcessorExpert_module ProcessorExpert module documentation
** @{
*/
/* MODULE ProcessorExpert */
/* Including needed modules to compile this module/procedure */
#include "Cpu.h"
#include "Events.h"
#include "Bit1.h"
#include "WAIT1.h"
#include "Bit2.h"
#include "Bit3.h"
/* Including shared modules, which are used for whole project */
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"
/* User includes (#include below this line is not maintained by Processor Expert) */
LDD_TDeviceData *bit1Ptr;
LDD_TDeviceData *bit2Ptr;
LDD_TDeviceData *bit3Ptr;
/*lint -save -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
/* Write your local variable definition here */
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
PE_low_level_init();
/*** End of Processor Expert internal initialization. ***/
/* Write your code here */
//blue LED initializer and handle
bit1Ptr = Bit1_Init((LDD_TUserData*)NULL); /* Initialize the pin */
/* Wait until logical "1" is on the pin */
while( !Bit1_GetVal(bit1Ptr) );
//red LED
bit2Ptr = Bit2_Init((LDD_TUserData*)NULL); /* Initialize the pin */
/* Wait until logical "1" is on the pin */
while( !Bit2_GetVal(bit2Ptr) );
//green LED
bit3Ptr = Bit3_Init((LDD_TUserData*)NULL); /* Initialize the pin */
/* Wait until logical "1" is on the pin */
while( !Bit3_GetVal(bit2Ptr) );
//clear the blue and green LEDs
Bit2_ClrVal(bit2Ptr);
Bit3_ClrVal(bit3Ptr);
for(;;) {
WAIT1_Waitms(500);
Bit1_NegVal(bit1Ptr);
Bit2_NegVal(bit2Ptr);
WAIT1_Waitms(100);
Bit3_NegVal(bit3Ptr);
WAIT1_Waitms(800);
Bit3_NegVal(bit3Ptr);
}
/*** Don't write any code pass this line, or it will be deleted during code generation. ***/
/*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
#ifdef PEX_RTOS_START
PEX_RTOS_START(); /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
#endif
/*** End of RTOS startup code. ***/
/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
for(;;){}
/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
/* END ProcessorExpert */
/*!
** @}
*/
/*
** ###################################################################
**
** This file was created by Processor Expert 10.2 [05.06]
** for the Freescale Kinetis series of microcontrollers.
**
** ###################################################################
*/
[…] The setup gives two hardware breakpoints, so if you put more than two, you will end up with the resource not found situation. otherwise everything runs ok for the FRDM-KL25Z board. I tested with a Processor Expert project toggling RGB LED. […]