Procedure for creating target bsp

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Procedure for creating target bsp

Jump to solution
2,577 Views
ERussell
Contributor IV

I am creating a bsp for a target board for the Kinetis K60 with CW10. I know I need to create a CW project (MQX and PE) for this target bsp, but am not sure where it should be located. I am unable to create a new project in the folder with the Freescale provided bsp projects - I just get the message "An existing directory cannot be specified for the project location". I can create a new project in my workspace, of course,  which I did. I copied the files in the the bsp_twrk60n512_pe project folder , twrk60n512 BSP Files, and the folder, twrk60n512 User Config, into my new project's folder in my workspace. I have modified these files where appropriate for the target as well as the lcf files. I linked in files from the Generic IO Drivers folder and the Peripheral IO Drivers folder of the twrk60n512_pe project from the MQX directory so that my new project has the same structure as that project. I haven't tried to build yet since I still have to add all the includes.

 

Is this the correct procedure? How should the batch file be edited in this case so that the correct files are located in the MQX lib directory? Are there any detailed instructions for doing this?

 

Help!

 

Thanks.

0 Kudos
Reply
1 Solution
1,909 Views
Teckna
Contributor V

Hi Chris,

 

I have found no solution other than this:

 

  • I created a new project using the closest bsp to my custom bsp (the one I have started from to develop my custom bsp)
  • I edited (with a text editor) the project files to point to my custom bsp rather than the original one.

I use CW 10.1 so the files I edited were the .project and .cproject

 

Anyone has found a more elegant solution?

 

Teckna

View solution in original post

0 Kudos
Reply
9 Replies
1,909 Views
trailman
Contributor V

Hi,

 

To create a BSP for a new board from an existing one, I don't like to use the CW interface and all its menus/submenus, but I prefer to do all from the command line. I use Linux as develoment host so it's very easy and faster to do it this way, but you can do the same using Cygwin under Linux or even from DOS prompt. The procedure is :

 

- Create files for new BSP :

 copy config/m52259evb to config/myboard   (use cp -a undr Linux or Cygwin)

 copy mqx/source/bsp/m52259evb to mqx/source/bsp/myboard

 copy mqx/build/codewarrior/bsp_m52259evb.bat to mqx/build/codewarrior/bs_myboard.bat
 copy mqx/build/codewarrior/psp_m52259evb.bat to mqx/build/codewarrior/psp_myboard.bat

Note : rtcs, mfs ... .bat files are not BSP specific so no change required

 copy mfs/build/cw10/mfs_m52259evb to cp mfs/build/cw10/mfs_myboard
 copy usb/host/build/cw10/usb_hdk_m52259evb to usb/host/build/cw10/usb_hdk_myboard
 copy usb/device/build/cw10/usb_ddk_m52259evb to usb/device/build/cw10/usb_ddk_myboard
 copy rtcs/build/cw10/rtcs_m52259evb to rtcs/build/cw10/rtcs_myboard
 copy shell/build/cw10/shell_m52259evb to shell/build/cw10/shell_myboard
 copy mqx/build/cw10/bsp_m52259evb to mqx/build/cw10/bsp_myboard
 copy mqx/build/cw10/psp_m52259evb to mqx/build/cw10/psp_myboard

- Now in the directories and files created above :

find all files with m52259evb in their name and rename them to the same name but with myboard instead (use grep under Linux or Cygwin)

open all files with a text editor and change all occurences of m52259evb to myboard (can be done automatically with sed -i under Linux or Cygwin)

WARNING : do not forget to do so on .cproject and .project files under directories cw10/xxxxx_myboard

 

Then you can Open CW 10 and use myboard project files as you would do for mcf52259evb

 

1,909 Views
trusc
Contributor II

Hi trailman

 

I'm interested in trying your method, after wasting two days following the guidelines in the Freescale documentation.

 

By the way, do you use CW10.1 on linux for programming/debugging too? I have tried many times to do this on different versions of Ubuntu, but never got it right. Always encountered the notorious USB driver problem with the Multilink.

 

Thanks.

0 Kudos
Reply
1,909 Views
trailman
Contributor V

Hi trusc,

 

Something important I missed In the method described above : you must start from the BSP that is the closest match to your custom target board.

In the method above I had to do a BSP for an MCF52254 custom board, so I started from the BSP for M52259EVB.

 

I also forgot to mention that this method also works for CW7.1, but instead of .cproject and .project files you have to deal with .mcp binary files.

For this open each project file (.mcp) of the original BSP (PSP,BSP,MFS,RTCS...) under CW, export them as XML (.mcp.xml), close CW, copy these files to you BSP tree and modify them as decribed for .cproject and .project above, open CW, import project from each file, save each project (creates a new .mcp)

 

Now for the Linux CW10.1, I did not try it.

When I said I was working on a Linux development host, I was meaning I do everything under Linux (editor, SVN, terminal, ...) from my office but at the end I build on a Windows host (the only thing I do under windows is "build" and "flash") located in the lab room.

The sources are on a Windows shared folder so I can acces them from Linux or Windows.

So unfortunately, I can not help you on this topic :smileysad:

 

1,909 Views
trusc
Contributor II

Hi trailman

 

Thanks for the info.

 

Yes, I'm beginning to suspect that it would be better for me to do the same - develop on Linux, then program/debug on Windows. I'm trying to avoid using Windows altogether; maybe all these issues with drivers etc. will be sorted out soon...

0 Kudos
Reply
1,909 Views
trusc
Contributor II

Hi trailman

 

I hope you don't mind if I bother you with another question.

 

I have no previous experience of working with RTOS; for years I have been developing software for the smaller Freescale devices from scratch in C. So, MQX is new to me. I have played around with the MCF51CN128 Tower system and the MCF52259DEMO, and I have some idea of how to start a new project using MQX.

 

The problem I have is this: once I have done all the changes to MQX required for my custom board, how do I use it to create a new project? Let me put this another way: the way I know, is to start CW7.2, then go to File > New Project. There I have the option to use Freescale MQX 3.x stationery. But, of course, my ported version is not supported there. How do I start a new project with my customized MQX?

 

Thanks in advance.

 

Chris

0 Kudos
Reply
1,909 Views
petr_uhlir
NXP Employee
NXP Employee

To add new project wizard for your target board you have to create board wizard template.

 

Select the existing template with similar mcu

"c:\Program Files\Freescale\CW MCU v10.x\MCU\lib\wizard_data\mqx\3.8\mqx_TWRK60N512.xml"

 

rename it to for example

"c:\Program Files\Freescale\CW MCU v10.x\MCU\lib\wizard_data\mqx\3.8\mqx_MYBOARD60N512.xml"

and in xml file replace the reference TWRK60N512 by MYBOARD60N512

 



0 Kudos
Reply
1,910 Views
Teckna
Contributor V

Hi Chris,

 

I have found no solution other than this:

 

  • I created a new project using the closest bsp to my custom bsp (the one I have started from to develop my custom bsp)
  • I edited (with a text editor) the project files to point to my custom bsp rather than the original one.

I use CW 10.1 so the files I edited were the .project and .cproject

 

Anyone has found a more elegant solution?

 

Teckna

0 Kudos
Reply
1,909 Views
trusc
Contributor II

Thanks, Teckna

0 Kudos
Reply
1,909 Views
trusc
Contributor II

I think Chapter 5 of the MQX RTOS User Guide might help.

0 Kudos
Reply