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

reset

I am using uVision4 and have an LPC2103.
After each reset the module desn't start directly (after 2 or 3 attempt) can you help me.

Parents
  • I agree with Per's comments.
    Looking at your code, you are doing low level register manipulation that is normally handled by Startup.s
    Your function PLL_Init() is not needed for proper operation; everything that is done in that function is handled by the reset signal or the Startup.s configuration.

    Look in your installed Keil directory for Arm\Boards\Keil\MCB2103\Blinky
    (I am a codgy coder, my install is at C:\Keil, yours is likely C:\KeilV5)

    There is a file called Startup.s. This file is specific to the LPC2103 device you are working with.

    Copy it into your project, and add it to your workspace. You can then click on the "Configuration Wizard" at the bottom of the source editor window and get a menu to configure things like the myriad of peripheral clocks and CPU clock rate.

    Using the supplied Startup.s will get your device clocks configured and booting reliably every time.
    Startup.s also contains the C-runtime (CRT) (zeroing of RAM, setup of stack, supervisor mode, jump to main()), so if you don't have it, your code will never appear to work.

    You are on the hook for peripheral initialization other than clocking.
    You are on the hook to manage the PCONP register (you have to power up a peripheral before you can use it unless it is one of the set of peripherals which are enabled at power on reset)

    You may be mis-configuring the peripheral clocks and hanging the processor.

    Note, you are messing with MEMMAP. Normally the only time you do that is if you are working with an embedded custom bootloader. Since you mention you are new to Keil, I suggest you get your project running without a bootloader. You don't need to touch MEMMAP unless you really understand the VIC and interrupt indirection and are doing a bootloader based application.

    One last hint, check the P0.14 pin to make sure it is high during/just after reset. Otherwise at you will go into an embedded bootloader.

    One really last hint, make sure the MAM (flash memory acceleration module) is correctly configured for your CPU clock rate (another option in startup.s). Note some versions of startup.s you enter the desired divisor, and it automatically adds or subtracts 1 for you before storing into the MAM. So just double check what is processed by the editor into startup.s actually matches what you want. This bit me hard back in 2007.

Reply
  • I agree with Per's comments.
    Looking at your code, you are doing low level register manipulation that is normally handled by Startup.s
    Your function PLL_Init() is not needed for proper operation; everything that is done in that function is handled by the reset signal or the Startup.s configuration.

    Look in your installed Keil directory for Arm\Boards\Keil\MCB2103\Blinky
    (I am a codgy coder, my install is at C:\Keil, yours is likely C:\KeilV5)

    There is a file called Startup.s. This file is specific to the LPC2103 device you are working with.

    Copy it into your project, and add it to your workspace. You can then click on the "Configuration Wizard" at the bottom of the source editor window and get a menu to configure things like the myriad of peripheral clocks and CPU clock rate.

    Using the supplied Startup.s will get your device clocks configured and booting reliably every time.
    Startup.s also contains the C-runtime (CRT) (zeroing of RAM, setup of stack, supervisor mode, jump to main()), so if you don't have it, your code will never appear to work.

    You are on the hook for peripheral initialization other than clocking.
    You are on the hook to manage the PCONP register (you have to power up a peripheral before you can use it unless it is one of the set of peripherals which are enabled at power on reset)

    You may be mis-configuring the peripheral clocks and hanging the processor.

    Note, you are messing with MEMMAP. Normally the only time you do that is if you are working with an embedded custom bootloader. Since you mention you are new to Keil, I suggest you get your project running without a bootloader. You don't need to touch MEMMAP unless you really understand the VIC and interrupt indirection and are doing a bootloader based application.

    One last hint, check the P0.14 pin to make sure it is high during/just after reset. Otherwise at you will go into an embedded bootloader.

    One really last hint, make sure the MAM (flash memory acceleration module) is correctly configured for your CPU clock rate (another option in startup.s). Note some versions of startup.s you enter the desired divisor, and it automatically adds or subtracts 1 for you before storing into the MAM. So just double check what is processed by the editor into startup.s actually matches what you want. This bit me hard back in 2007.

Children
No data