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:
/*
*
*/
#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