Not completely sure where to start, so forgive me if this is in the wrong area.
I've built a project using the headers and C files from the kinetis example projects folders:
Source:
I am not sure what you are doing here. First, let's confirm that nothing is wrong with the tools. Can you build an example project using the CodeWarrior new project wizard and does it work? If not, something's wrong with the CodeWarrior installation. If the project builds and runs fine, then my next question is: how are you building your project? Did you use the wizard to set it up? How are you adding your source code files to the project?
---Tom
Fixed - kind of - or maybe irrelevant.
My apologies - I'm new to CodeWarrior. So, I went back to basics and built an example project following the steps in the readme.txt. I can build the example projects ok, and I can build / debug / run a project for the kinetis ok from scratch using a wizard.
My approach previously, that caused the errors above, was to copy and paste source files and headers as needed, into a fresh project created by the wizard.
Basically, no...
What I wanted to do was create a fresh project, say, with the intention of communicating over SPI to a sensor, to the serial port (on which I had a USB>serial converter and realterm) or whatever. Basically, I just want to use the headers and create a bare metal app from scratch, using functionality that I'd code myself.
Unfortunately, when a file wants to include common.h, then it snowballs to needing half the peripheral support .c +.h files for the board, and that's where I was getting the error above. The example projects compile ok, but what if I want adc AND usb to work together? Or combinations of various functionality.
All I was trying to do was skip the example projects and go straight to some home brew coding and get my hands dirty. Instead, seems I got my fingers burnt, lol
I'm used to PIC32MX + MPLAB 8 / X and being able to create C/H files and functionally work from a processor header file to build all the functionality I need. I appreciate it's a bit more complex here.
So, in essence, what's the best way to go from hello world to a data logger / LCD controller / custom app on a custom board? Apologies for not reading the readme.txt until half a dozen failed project attempts into building from scratch - I just like to know too much how things work!
For a CodeWarrior project targeting a Kinetis MCU, you want start with the simple "Hello World" project and open the Project_Headers folder in the CodeWarrior Projects view. There will be a "derivative.h" file that simply references a MCU-specific header file, for example, MK60N512VMD100.h. This header file defines all of the MCU's peripheral ports and the bit-mappings for certain registers. All of the C libraries, at the lowest level, reference this file in some way.
For USB and ADC peripherals, you might want to use Processor Expert in the tools to set up drivers for them. Sure, that puts a layer between you and the metal, but it also gives you working code to study.
---Tom