Hi,
I have a FRDM-KL05Z and I've downloaded an evaluation version of CodeWarrior. During download I only ticked the box for Kinetis Family. I'd like to know if there is a template/package/add-in/whatever available for CodeWarrior such that when I begin a new project, I get FRDM-KL05Z as an option.
If such a product is available, could you please tell me where to get it and how to install it?
Thanks
Dan
Solved! Go to Solution.
Hi Dan,
what you are looking for is kind of a 'board example project'? This is not something you get directly. You either could creaete a project with the device on the FRDM-KL05Z, or to import an existing example project. I have example projects (not many for KL05Z) here:
https://github.com/ErichStyger/mcuoneclipse/tree/master/Examples/FRDM-KL05Z
Erich
Hi Dan,
what you are looking for is kind of a 'board example project'? This is not something you get directly. You either could creaete a project with the device on the FRDM-KL05Z, or to import an existing example project. I have example projects (not many for KL05Z) here:
https://github.com/ErichStyger/mcuoneclipse/tree/master/Examples/FRDM-KL05Z
Erich
Hi Erich,
I had some limited success with using a sample project. I will make a post regarding the problems.
But first I want to try your sample projects and I was wondering if there is an easy way to obtain them. There doesn’t seem to be a download option at github.
Do have to use “save target as ...” for each file?
Thanks
Dan Bovill
Yes, there is a better way, although somehow hidden on GitHub.
If you go to the root of the repository (ErichStyger/mcuoneclipse · GitHub), on the right lower side there is a 'download zip' button, which downloads you everything in a zip file (direct link: https://github.com/ErichStyger/mcuoneclipse/archive/master.zip)
I hope that helps,
Erich
Thanks Erich,
Unfortunately I couldn’t build these due to problems with finding includes.
My problem I think, is not understanding how to create a simple project in CodeWarrior. From scanning other posts I see that I’m not alone.
I was successful in importing and building the LED_Blink project supplied by freescale. The downloaded program functioned as expected.
Then I tried to recreate the project from scratch but using the supplied source code in all cases.
These are the steps I took in my attempt to recreate the LED_Blink Project from scratch.
Commander: New MCU Project
Project Name: My_LED_Blink_01 (created in C:\Users\Dan\workspace)
Devices: Kinetis L Series | KL0x Family | KL05Z (48 MHz) Family | MKL05Z32 - with Project Type / Output = Application
Connections: P&E USB MultiLink Universal / USB MultiLink = checked; and
OpenSDA = checked
Language and
Build Tools
Options: Language = C; and
Floating Point = Software; and
I/O Support = No I/O; and
Arm Build Tools = GCC
Rapid
Application
Development: Rapid Application Development = None; and
Start with perspective designed for = Use current perspective (CW Installed default)
Finish
Then
Menu Bar | Project | Properties
Under C/C++ Build | Settings | Additional Tools: Create Flash Image = Checked
The resulting main program:
/*
main implementation: use this 'C' sample to create your own application
*
*/
#include "derivative.h" /* include peripheral declarations */
int main(void)
{
int counter = 0;
for(;;) {
counter++;
}
return 0;
}
After building, a .hex file is produced and I plug my FRDM-KL05Z board into the USB port of my computer.
Small green LED is on and stable. Windows Explorer opens in drive FRDM_KL05Z (F:)
SDA_INFO appears normal.
When I drag n drop My_LED_Blink_01.hex to the drive FRDM-KL05Z it programs as usual. Then the green led signals "program error" with 8 fast flashes followed by 2 seconds off.
??????????????????????????????????????????????
Question 1: Why isn't it simply doing nothing?
??????????????????????????????????????????????
I assumed that there needed to be other header files included for setting up cpu config, reset vector, ram and stack etc. so I decided to use the LED_Blink project files copied the following lines from LED_Blink.c to My_LED_Blink_01.c
#include "common.h"
#include "freedom_gpio.h"
#include "spi.h"
#ifdef CMSIS
#include "start.h"
#endif
#if(defined(CW))
#include "sysinit.h"
#endif
This generated the expected file-not-found errors, so I set to work.
Long story short:
Recreated demo folder structure under "Sources" folder.
Linked all of the same support files as linked in the demo
Copied LED_Blink.c to My_LED_Blink_01.c
Under Project Settings | C/C++ Build | ARM Ltd Windows GCC C Compiler | Directories I set the Include paths thus:
"$/Project_Headers" "$/Project_Settings/Startup_Code"
"$/ARM_GCC_Support/ewl/EWL_C/include" "$/ARM_GCC_Support/ewl/EWL_Runtime/include"
"$/../../../src/platforms" "$//../../../src/drivers/uart"
"$//../../../src/drivers/rtc" "$//../../../src/drivers/mcg"
"$//../../../src/drivers/rcm" "$//../../../src/drivers/spi"
"$//../../../src/cpu" "$//../../../src/cpu/headers"
"$//../../../src/common" "$//../../../src/projects/kl05_frdm_demo/freedom_gpio"
I made and unmade various other adjustments here and there with the result that the build halts with anywhere from 13 errors to 250 errors and 6 warnings.
The obstinate errors that never changed included:
C:/Users/src/common/common.h:51:4: error: #error "No valid platform defined"
C:/Users/src/common/common.h:64:4: error: #error "No valid CPU defined"
In the "Console" tab these are also the first 2 lines to be highlighted.
???????????????????????????????
Question 2: What have I missed?
???????????????????????????????
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
Request 1: I would be very grateful for a list of steps that create the LED_Blink project from scratch.
Request 2: I would be additionally grateful for instructions that expand the program such that it transmits "Hello World" out of the serial port.
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
Once I have the project at this stage, I think I will be able to learn a lot faster.
Thanks in advance
Do you have the correct firmware loaded on your board?
I have:
Erich
I’ve added to my last post. I tried to update firmware. My boards are no longer working.
Thanks
Dan
Hello Dan:
Please check all the suggestions provided by Erich in this article:
FRDM Board not responding? Check your Virus Scanner! | MCU on Eclipse
You can try updating BOOTLOADER or loading applications to "FRDM-KL05Z (F:)" using the COPY command from cmd shell.
Regards!
Jorge Gonzalez
I have:
Board Name is: FRDM-KL05Z
MicroBoot Kernel Version is: 1.03
Bootloader Version is: 1.05
Installed Application: PEMicro FRDM-KL05Z Mass Storage App
Application Version is: 1.05
I have no problem loading and running the supplied LED_Blink or the KL05_frdm_demo .
Uh Oh ... It seems I spoke too soon.
I have 3 FRDM-KL05Z Boards. 2 have been connected to a PC and now have the same problem. I'm not willing to connect the third until I find out what is wrong with the first 2. Here are their version details.
Unit 1: I'd upgraded firmware as per instructions last week.
Unit 2:
Behavior:
When plugged into USB port, the "Found New Hardware Wizard" appeared and searched for and found drivers. This is odd because they were already installed a week ago.
For both units:
Then Windows Explorer opens the drive "FRDM-KL05Z (F:)"
LASTSTAT.TXT contains the word "Ready"
Small green LED on and steady.
When I drop any program file onto it, it appears to program, then I get the program error sequence.
When I enter Bootloader mode, Windows Explorer opens the drive "BOOTLOADER (F:)" as expected.
Small green LED flashing regularly at 1 Hz.
LASTSTAT.TXT contains the word "Ready"
When I drag and drop BOOTUPDATEAPP_Pemicro_v111.SDA to the drive Unit 1 seems to ignore it (maybe because already updated?) while
Unit 2 seems to program, then goes into "Program Error". Unplug and plug. Bootloader version is unchanged.
I attempted to load MSD-DEBUG-FRDM-KL05Z_Pemicro_v114.SDA into both units but get "Program Error".
What has happened to my boards?
Hello Dan:
As Erich mentions, CodeWarrior new project wizard does not include boards (e.g. FRDM boards). You need to select the specific MCU derivative (File -> New -> Bareboard Project -> Project Name -> Device -> ... ):
A couple of examples are provided for KL05 in the KL05_SC package under "Lab and Test Software" in the next link:
Freescale Freedom Development Platform for th|Freescale
Regards!
Jorge Gonzalez