Author Topic: LPC23XX Keil uVision project add-on for SP3  (Read 20428 times)

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
LPC23XX Keil uVision project add-on for SP3
« on: January 24, 2009, 02:25:49 PM »
Hi All

Since I have been testing with Keil (in fact I have updated all ARM based projects to have a corresponding set up) I have to admit that it is quite nice to work with. Its simulator is very useful for setting up the project to ensure that it basically starts and the memory set up has no errors. Also debugging with a U-Link is very smooth.

The down side is that its evaluation version is limited to 16k code and so is not very useful for evaluating an Internet enabled project. As comparison, the IAR evaluation version (32k limited) allows full feature evaluation.

For users with Keil licenses an add-on is available for the service pack 3 which adds a uVision project and some necessary code modifications:
www.uTasker.com/software/V1.3/LPX23XX_KEIL_SP3.zip

Regards

Mark






The following details how to add the Keil project for the LPC23xx SP3:

1. Ensure that you have installed SP3 (it is not necessary to install SP1, SP2 since these are included in SP3). Follow the following document in case of difficulties:
http://www.utasker.com/docs/uTasker/uTaskerV1.3_user_guide.PDF (page 4/11)

2. Add the Keil project (folder uVision3_LPC23xx) to the directory \Applications\uTaskerV1.3

3. You will need to add the file Lpc23xx_keil.s and replace LPC23xx.c in \Hardware\LPC23xx (these have been modified for compatibility with Keil)

4. Start the Keil uVision project (double click on uTaskerV1.3.Uv2 in \Applications\uTaskerV1.3\uVision3_LPC23xx for example).

5. In \Applications\uTaskerV1.3\config.h you can configure for various LPC chips and also specifically for the KEIL_MCB2300 and OLIMEX_LPC2378_STK which have been used to test the project on.

6. When compiling with Keil there are a few warning about "assignment in condition" but these can be ignored.

7. Users without full Keil license, or without an unrestricted trial version, will be limited to 16k of code. This is very little for an Ethernet enabled project and so will only allow very limited testing. For example, to make a project with just ping test support go to config.h and comment out USE_UDP and USE_TCP - this will remove the UDP and TCP protocols, leaving just lower level ones and ICMP (needed for ping). Also ensure that SERIAL_INTERFACE is disabled since the UART demo uses a a menu driven interface with a lot of strings, requiring space.
« Last Edit: January 24, 2009, 02:46:07 PM by mark »

Offline Maik

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: LPC23XX Keil uVision project add-on for SP3
« Reply #1 on: May 16, 2009, 10:18:03 PM »
Hello!

Is this the same project as the one in the "SW/Live demos" section for LPC23xx? Because the hex file works fine, but if I open the project in Keil, set it up for my uLink debugger and flash uploader, it compiles and loads but does appearantly not run. Appearantly, because I can't see anything happen on the MCB2300. If it's just the OS and internet, I should be able to access its website, don't I?

Do you have any suggestion what I did wrong?
Thanks!

Addition: I have, of course, selected the correct processor type and emulation board in the config.h
« Last Edit: May 16, 2009, 10:40:14 PM by Maik »

Offline Maik

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: LPC23XX Keil uVision project add-on for SP3
« Reply #2 on: May 17, 2009, 12:18:14 AM »
Sorry, but I'm new to task programming.
As far as I understand the code, every task that is configured in TaskConfig.h should run at least once.
Debugging the code and setting breakpoints to, for example to fnApplication or fnConfigureAndStartWebServer, these are never reached/called.
Is this a basic misunderstanding or is there something wrong in the task setup?

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: LPC23XX Keil uVision project add-on for SP3
« Reply #3 on: May 17, 2009, 12:33:07 AM »
Hi Maik

You should see a blinking LED if the board is running (possibly also the LCD displaying "uTasker" if the LCD part is activated).

The tasks in the task list don't necessarily run once (some are started by other tasks) but application.c MUST run after 100ms. Since this is not happening the code is probably not starting correctly.

If you have installed the latest service pack (see http://www.utasker.com/docs/uTasker/uTaskerV1.3_user_guide.PDF if you haven't) and you have added the Keil add-on I would expect it to compile and also run on the target.

1) Can you run the project with your configuration in the uTasker simulator? This will verify that the problem is restricted to the target/Keil project.
2) It is best to step through the code from the reset entry to see how far it is running.
3) If you don't have success in finding the cause of the problem you can send me a HEX file from your build (for loading to my MCB2300 with Flash Magic). I can then step through the start-up code to see whether I can identify the problem.

Regards

Mark



Offline Maik

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: LPC23XX Keil uVision project add-on for SP3
« Reply #4 on: May 18, 2009, 08:32:47 AM »
1) Can you run the project with your configuration in the uTasker simulator? This will verify that the problem is restricted to the target/Keil project.
2) It is best to step through the code from the reset entry to see how far it is running.
3) If you don't have success in finding the cause of the problem you can send me a HEX file from your build (for loading to my MCB2300 with Flash Magic). I can then step through the start-up code to see whether I can identify the problem.
1. What simulator? Do you mean the uncompiled WinSim or the uncompiled Simulator in the projects folder? Sorry, but we won't buy a copy of VisualStudio just to compile an .exe
2. I did. Problem is I got Keil IDE with uLink JTAG interface and the debugger, together with the JTAG capabilities, can not really execute code step by step. I could stop at the task scheduler and almost go through it stepwise, but since most of the tasks are set to UTASKER_STOP, they are not started by scheduler. Only the watchdog task has GO status, but it does not start the other tasks.

By the way, and no offence, your code is not easy to read, since you mix up defines/macros and structures by naming both in uppercase. This is strange. We also put abbreviations in front of names, like 'ptr' for pointer or 'uc' for unsigned char, but we also do 'st' for structures.
« Last Edit: May 18, 2009, 08:35:07 AM by Maik »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: LPC23XX Keil uVision project add-on for SP3
« Reply #5 on: May 18, 2009, 10:54:24 AM »
Hi

VisualStudio Express is free and can be downloaded from here: http://www.microsoft.com/express/ See the tutorial: http://www.utasker.com/docs/LPC23XX/uTaskerV1.3_LPC23XX.PDF This explains how you can simulate the MCB2300 with it. To run a stand-alone simple execute the appropriate file on the demo page: http://www.utasker.com/SW_Demos.html (from section "µTasker Executables") - this shows it in action but won't allow debugging own code.

Keil has a powerful debugger which should work well with J-Link. It works very well with their own U-Link. It is however necessary to disable the watchdog to debug successfully: set WATCHDOG_DISABLE(), in app_hw_lpc23xx.h to 1, reload and re-power the board (the watchdog can not be turned off without also power cycling).

I will look into clearer distinction between defines, macros and structs - this is however not always easy to change due to compatibility issues.

Regards

Mark

Offline Maik

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: LPC23XX Keil uVision project add-on for SP3
« Reply #6 on: May 18, 2009, 11:59:02 AM »
Hi Mark!

Since you seem to be the programmer of all or most of the code, I would like to know if there any limitations regarding the web interface part.
I mean, we are creating an embedded network card with HTTP server and website. This website constantly sends request to the device with the embedded network card in order to get actual values and status. Besides this, one user can manually enter SCPI commands and send them by a button.
This website should be accessible to multiple users at once (for monitoring). Two users already make the double number of requests.

Can your application handle this?
Did you ever perform a stress test?
Can the application serve and handle also more complex websites with many images or even flash?
Is there a replacement for the limited file system? So that we could add an SD card interface and store logging data into files with, for example, 8+3 names?

Thank you.
Maik  :)

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: LPC23XX Keil uVision project add-on for SP3
« Reply #7 on: May 18, 2009, 03:49:03 PM »
Hi Maik

Many things performed by a web server (such as Flash) are actually handled by the browser. The web server's main job is to send back files as requested. This means that all client side technology should be possible as long as the files exist and can be addressed.

The web server supports dynamic content generation and content inserting so can also be used for most other purposes where some form of server side technology is needed. Although it doesn't include PHP, for example, the same effects can be achieved using the inbuilt features - usually with a minimum of code requirement.

There is now an extension (see http://www.utasker.com/docs/uTasker/uTaskerUserFiles.PDF) for internal files which is proving useful for handling AJAX and doing things like adding a favicon in the code.

All of these handle multiple sessions, limited only by the value NO_OF_HTTP_SESSIONS. See http://www.utasker.com/docs/uTasker/uTaskerV1.3_Content_Generation.PDF for more details about dynamic content being generated for multiple individual users at the same time.

There are thus very little known limitations of the actual capabilities and no known field problems, whereby some uses have large numbers of connections and high traffic. The question of load limits is also application specific so can not be answered with a yes/no. It is best to do some quick tests under expected conditions to get a useful answer.

At the moment the uFileSystem and internal user files (will be in the next service pack) are the only file systems available. SD card, USB mass storage and FAT compatibility are planned for later this year.

For projects requiring features not available (or not yet available) in the uTasker project it may be necessary to look at alternatives such as Micrium or InterNiche. If price is an issue it may be possible to use FreeRTOS together with an open source stack and FAT.

Regards

Mark

Offline Maik

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: LPC23XX Keil uVision project add-on for SP3
« Reply #8 on: July 07, 2009, 10:26:12 AM »
Hi Mark!

I just want to let you know that we ceased using uTasker a while ago, since we never managed to get the demo project running on our emulation board.

Perhaps it is just too complicated to export your code to several environments and hardwares. We don't want, of course, invest time in integrating and finding out how to run the code. We just want to use it if we pay for it. I still wonder why it wouldn't work even if you have a demo for the same hardware and a processor that is only a little different. Compared to other products this one here is kinda cheap, but still too effortive to be used.

As an alternative we tried a demo of LabView for ARM, including a webserver. This worked instantly. Since LabView for ARM can be used to program any target application and not only embedded ethernet, this is the better way for us to use the ARM, even if it's much more expensive.

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: LPC23XX Keil uVision project add-on for SP3
« Reply #9 on: July 07, 2009, 01:47:49 PM »
Hi Maik

I am sorry to hear that you never managed to solve the problem - I do wonder what it was (possibly compiler resp. compiler version related(?)).

But I am pleased to hear that you found the most suitable solution for your requirements.

Good luck

Regards

Mark