This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Getting Started with LPC2148

Hi all,
I am new to 32bit computing and I have choosen lpc2148 to start with. I am using uVision v4.00...
I have a LPC2148 dev board for which i have written a led-blink program and certainly it doesn't works.
Now what I have done is.

1. Created a new project. uVision asked for adding "startup file" I said yes .
2. Wrote a down to earth simple led blink program.
3. Build hex without error or warning. It 'ran' with meaningful results in debugger too. port getting written and erased, all's well.
4. Downloaded the hex file to my LPC2148 board with philips utility software. AND IT DOESN't WORKED. DID IT AGAIN N AGAIN. NO SUCCESS YET !

My only question is Does the startup.S file that is added automatically by uVision WORKS ???

Parents Reply Children
  • Of course there are. But no one who can answer the question you ask based on the information you have given.

    Yes, of course lots of users have managed to get their projects to work with the startup files Keil supplies. Lots of users have also had access to debuggers, oscilloscopes etc, to spend some quality time debugging, when their programs haven't worked as expected.

    What kind of debugging have you done with your real hardware?
    Did the examples supplied work with your board?
    What are the differences between working and not working programs?
    Exactly what equipment do you have?
    I'm not sure what you mean with "philips utility software" - is it FlashMagic you forgot the name of?

  • And by the way - your posts indicates you created this thread on a sunday. And got bored early on a monday morning, based on european time zones. Still not even monday morning for US time zones. Only into working day for people in the eastern part of the world.

    You think there are a huge number of people all over the different time zones constantly looking at this forum just to quickly react when someone asks a question?

  • Hi Westermark,
    Certainly I wanted someone to respond in a short time. My LPC2148 board was not working and i couldn't get started. I hope you can understand this 'rush', when you have a fresh board, and you want your first led blink program to run.
    As you say, the board did came with example projects and certainly they work out of the box !

    But when I try to write a program on my own ( like simple LED blink ), it doesn't works.
    Now I have this board, FlashMagic( properly ) and a collection of sample programs.

    I have been able to get my board to work ONLY BY MODIFYING THE SAMPLE PROGRAMS. I tried lot to understand where I am going wrong.
    I tried copying Startup.S file from sample programs(which came with board) into my own programs but even it didn't worked !

    I just couldn't understand what I am doing wrong( or right ! ). In debug( uvision ) i can see the proper behaviour but in my board "nothing".

  • I have been able to get my board to work ONLY BY MODIFYING THE SAMPLE PROGRAMS. I tried lot to understand where I am going wrong.
    I tried copying Startup.S file from sample programs(which came with board) into my own programs but even it didn't worked !

    So a good start would be to see what differences there are between your working and non-working projects.

  • So a good start would be to see what differences there are between your working and non-working projects !

    I am a newbie and I am trying to find what are the differences. If you read the last line that you quoted it say's I tried copying Startup.S file from sample programs(which came with board) into my own programs but even it didn't worked ! I was basically thinking that the source of malfunction was improper configuration in startup.S

    I came here so that experienced users can point me in right direction.
    I know from my previous experience that if i write a program in C, i first get it compiled and linked to get 'hex'.
    This hex goes into FLASH memory.
    When program starts execution it should do all the initializations first, RAM stack, IVT and hardware peripherals.
    Since ARM is a big and complicated micro-controller I thought the startup.S helps to get a straight start. But i couldn't use it properly. So now I think I don't understand the programming for ARM !

  • So if your sure the startup is the same, then you need to look for differences in other files within the project. Include the project configuration values.

  • "Include the project configuration values" What that refers to ? IS it "options for target1 WINDOW " ?
    I have checked that every setting is same in the "options for target window".
    The only thing that was different was the file count in respective directories.
    In my custom made project directory(led blink project) there are 16 files including the hex.
    In the sample project directory(led blink sample project ) there are 25 files including the hex.

    The extra files have extensions as " sct, BAK, uvopt, ". I think "bak" files are just created by uvision as the sample project was originally compiled via a older uvision version.
    The led.sct is "Scatter-Loading Description File generated by uVision" and
    The led.uvopt is a xml file.

    Where else can the difference be ?

  • Note that when you create a new project, there are many, many, many settings in the project configuration.

    Have you compared these settings between your newly created projects and with the reference applications that does work? Make sure that the settings are the same - or that you properly understand the meaning of the specific settings so you know if it is ok to use different values between your project and the already working examples.

  • There are multiple tabs for "Options for Target" - have you compared the settings for all tabs?

    Do you have a JTAG adapter, so you can debug?

  • Finallllyyyyy !!! It worked. All I did was checked on the option "USE MEMORY LAYOUT FROM TARGET DIALOG" on the "LINKER TAB" OF "OPTIONS FOR TARGET WINDOW" .. Thanks Guys.

    And I have one more question. If I want to use Interrupts ( Specifically Timer and UART receive Interrupts) DO I need to do some external settings( other than the usual register value writing in program ) OR just use

         void timer_interrupt(void)__irq {//I have a working example for this one
    }
    
         void uart_interrupt(void)__irq {//I don't have a example for making out this one !!!
    }
    
    


    and compiler will do rest ???