I have a project on a K60 running on a TRWK60F120M. I'm using MQX so I have a BSP project, a PSP project, some other MQX-related projects such as RTCS, and my project itself. I am using Code Warrior 10.4 with the GCC-based compiler.
I want to use one of the on-chip DACs. In the BSP project I opened the ProcessorExpert.pe file, added a "DAC_LDD" component and configured it in the Component Inspector. There is not much to configure, but I set Auto Initialization to "yes".
I re-built the BSP. As far as I can see nothing happened. Nothing changed; no new files were generated; and if I try to use the component from within my main project I get linker errors indicating the functions (e.g. DA1_SetValue) and variables (e.g. DA1_DeviceData) are not present. I did a clean re-build of the BSP with the same result. I cannot find anything indicating it actually generated any DAC-related code. If I right-click on the DA1:DAC_LDD component in the tree-view and hover over the "open file" menu item I see "No files generated".
What am I doing wrong? And where might I find documentation on how this is supposed to work? Any help appreciated. Thanks.
Solved! Go to Solution.
So I figured out what I was doing wrong, and I'll write it up here in the hope it helps someone else.
The key thing is that (in CodeWarrior 10 at least) rebuilding a project that contains a Processor Expert component does not actually run the Processor Expert code generation step. Yes, that's right, the build scripts do not actually contain all the steps necessary to build. It turns out that you need to run the Processor Expert code generation step first, manually, e.g. by right clicking on the .pe file and selecting "Generate Processor Expert Code". Then re-build the BSP project. Then rebuild your main project and everything works.
So I figured out what I was doing wrong, and I'll write it up here in the hope it helps someone else.
The key thing is that (in CodeWarrior 10 at least) rebuilding a project that contains a Processor Expert component does not actually run the Processor Expert code generation step. Yes, that's right, the build scripts do not actually contain all the steps necessary to build. It turns out that you need to run the Processor Expert code generation step first, manually, e.g. by right clicking on the .pe file and selecting "Generate Processor Expert Code". Then re-build the BSP project. Then rebuild your main project and everything works.
This is a configuration you can set, at least in DS-5. I would guess that CodeWarrior has the same setting.
Right click on your project:
Properties --> Processor Expert --> Generate code before build automatically = "Yes"
It's set to "No" by default. This is the way I have it set because PEx code generation takes so long.
I hope this helps.