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

Something wrong with my keil?

Hi, I have tested my ARM7 stamp baord with some of the supplied test HEX files including UART test with Tera Term. All good.

My problem however is when I generate the hex files myself with Keil uv3. Do you have any idea what I possibly could have wrong ?

I am using the supplied source files, startup file, headers etc. When I compile I have 0 errors, 0 warnings and the hex file is produced.

I appreciate any help.

thanks

  • Hi, You will check the map files and the position of my code.

  • Can you be more specific? Do I have to specify where I write the code?
    I dont remember doing this previously..

    The Map file:

    ==============================================================================

    Memory Map of the image

    Image Entry point : 0x00000110

    Load Region LR_IROM1 (Base: 0x00000000, Size: 0x00000330, Max: 0x00020000, ABSOLUTE)

    Execution Region ER_IROM1 (Base: 0x00000000, Size: 0x00000330, Max: 0x00020000, ABSOLUTE)

    Base Addr Size Type Attr Idx E Section Name Object

    0x00000000 0x00000110 Code RO 3 RESET startup.o 0x00000110 0x00000008 Code RO 31 * !!!main c_t.l(__main.o) 0x00000118 0x0000003c Code RO 187 !!!scatter c_t.l(__scatter.o) 0x00000154 0x0000002c Code RO 189 !!handler_zi c_t.l(__scatter_zi.o) 0x00000180 0x00000008 Ven RO 58 .ARM.Collect$$libinit$$00000000 c_t.l(libinit.o) 0x00000188 0x00000002 Code RO 58 .ARM.Collect$$libinit$$00000000 c_t.l(libinit.o) 0x0000018a 0x00000000 Code RO 65 .ARM.Collect$$libinit$$00000002 c_t.l(libinit2.o) 0x0000018a 0x00000000 Code RO 68 .ARM.Collect$$libinit$$00000008 c_t.l(libinit2.o) 0x0000018a 0x00000000 Code RO 70 .ARM.Collect$$libinit$$0000000A c_t.l(libinit2.o) 0x0000018a 0x00000000 Code RO 72 .ARM.Collect$$libinit$$0000000C c_t.l(libinit2.o) 0x0000018a 0x00000000 Code RO 75 .ARM.Collect$$libinit$$0000000F c_t.l(libinit2.o) 0x0000018a 0x00000000 Code RO 77 .ARM.Collect$$libinit$$00000011 c_t.l(libinit2.o) 0x0000018a 0x00000000 Code RO 79 .ARM.Collect$$libinit$$00000013 c_t.l(libinit2.o) 0x0000018a 0x00000000 Code RO 81 .ARM.Collect$$libinit$$00000015 c_t.l(libinit2.o) 0x0000018a 0x00000000 Code RO 83 .ARM.Collect$$libinit$$00000017 c_t.l(libinit2.o) 0x0000018a 0x00000000 Code RO 85 .ARM.Collect$$libinit$$00000019 c_t.l(libinit2.o) 0x0000018a 0x00000000 Code RO 87 .ARM.Collect$$libinit$$0000001B c_t.l(libinit2.o) 0x0000018a 0x00000000 Code RO 89 .ARM.Collect$$libinit$$0000001D c_t.l(libinit2.o) 0x0000018a 0x00000000 Code RO 91 .ARM.Collect$$libinit$$0000001F c_t.l(libinit2.o) 0x0000018a 0x00000000 Code RO 93 .ARM.Collect$$libinit$$00000021 c_t.l(libinit2.o) 0x0000018a 0x00000000 Code RO 95 .ARM.Collect$$libinit$$00000023 c_t.l(libinit2.o) 0x0000018a 0x00000000 Code RO 99 .ARM.Collect$$libinit$$0000002A c_t.l(libinit2.o) 0x0000018a 0x00000000 Code RO 101 .ARM.Collect$$libinit$$0000002C c_t.l(libinit2.o) 0x0000018a 0x00000000 Code RO 103 .ARM.Collect$$libinit$$0000002E c_t.l(libinit2.o) 0x0000018a 0x00000000 Code RO 105 .ARM.Collect$$libinit$$00000030 c_t.l(libinit2.o) 0x0000018a 0x0000000c Code RO 106 .ARM.Collect$$libinit$$00000031 c_t.l(libinit2.o) 0x00000196 0x00000002 PAD 0x00000198 0x00000008 Ven RO 126 .ARM.Collect$$libshutdown$$00000000 c_t.l(libshutdown.o) 0x000001a0 0x00000004 Code RO 126 .ARM.Collect$$libshutdown$$00000000 c_t.l(libshutdown.o) 0x000001a4 0x00000000 Code RO 140 .ARM.Collect$$libshutdown$$00000003 c_t.l(libshutdown2.o) 0x000001a4 0x00000000 Code RO 143 .ARM.Collect$$libshutdown$$00000006 c_t.l(libshutdown2.o) 0x000001a4 0x00000000 Code RO 146 .ARM.Collect$$libshutdown$$00000009 c_t.l(libshutdown2.o) 0x000001a4 0x00000000 Code RO 148 .ARM.Collect$$libshutdown$$0000000B c_t.l(libshutdown2.o) 0x000001a4 0x00000000 Code RO 151 .ARM.Collect$$libshutdown$$0000000E c_t.l(libshutdown2.o) 0x000001a4 0x00000006 Code RO 152 .ARM.Collect$$libshutdown$$0000000F c_t.l(libshutdown2.o) 0x000001aa 0x00000002 PAD 0x000001ac 0x00000000 Code RO 33 .ARM.Collect$$rtentry$$00000000 c_t.l(rtentry.o) 0x000001ac 0x00000000 Code RO 35 .ARM.Collect$$rtentry$$00000002 c_t.l(rtentry2.o) 0x000001ac 0x00000008 Code RO 47 .ARM.Collect$$rtentry$$00000004 c_t.l(rtentry4.o) 0x000001b4 0x00000000 Code RO 37 .ARM.Collect$$rtentry$$00000009 c_t.l(rtentry2.o) 0x000001b4 0x00000004 Code RO 38 .ARM.Collect$$rtentry$$0000000A c_t.l(rtentry2.o) 0x000001b8 0x00000000 Code RO 40 .ARM.Collect$$rtentry$$0000000C c_t.l(rtentry2.o) 0x000001b8 0x00000028 Code RO 41 .ARM.Collect$$rtentry$$0000000D c_t.l(rtentry2.o) 0x000001e0 0x00000004 Ven RO 62 .ARM.Collect$$rtexit$$00000000 c_t.l(rtexit.o) 0x000001e4 0x00000004 Code RO 62 .ARM.Collect$$rtexit$$00000000 c_t.l(rtexit.o) 0x000001e8 0x00000000 Code RO 108 .ARM.Collect$$rtexit$$00000002 c_t.l(rtexit2.o) 0x000001e8 0x00000004 Code RO 109 .ARM.Collect$$rtexit$$00000003 c_t.l(rtexit2.o) 0x000001ec 0x00000008 Code RO 110 .ARM.Collect$$rtexit$$00000004 c_t.l(rtexit2.o) 0x000001f4 0x00000020 Code RO 4 .text startup.o 0x00000214 0x00000074 Code RO 11 .text main.o 0x00000288 0x00000006 Code RO 29 .text c_t.l(heapauxi.o) 0x0000028e 0x00000002 PAD 0x00000290 0x00000060 Code RO 49 .text c_t.l(sys_stackheap_outer.o) 0x000002f0 0x0000000c Code RO 51 .text c_t.l(exit.o) 0x000002fc 0x0000000c Code RO 59 .text c_t.l(libspace.o) 0x00000308 0x00000008 Ven RO 118 .text c_t.l(sys_exit.o) 0x00000310 0x0000000c Code RO 118 .text c_t.l(sys_exit.o) 0x0000031c 0x00000004 Code RO 129 .text c_t.l(use_no_semi.o) 0x00000320 0x00000000 Code RO 131 .text c_t.l(indicate_semi.o) 0x00000320 0x00000010 Data RO 185 Region$$Table anon$$obj.o

    Execution Region RW_IRAM1 (Base: 0x40000000, Size: 0x000004e8, Max: 0x00004000, ABSOLUTE)

    Base Addr Size Type Attr Idx E Section Name Object

    0x40000000 0x00000060 Zero RW 60 .bss c_t.l(libspace.o) 0x40000060 0x00000000 Zero RW 2 HEAP startup.o 0x40000060 0x00000488 Zero RW 1 STACK startup.o

  • I will compare it with what I get from the project that works.

    I will post the results.

  • Can you compile this code for an LPC2119 ?

    /*****************************************************/
    /* Examples Program For "ET-ARM STAMP LPC2119" Board */
    /* Target MCU : Philips ARM7-LPC2119 */
    /* : X-TAL : 19.6608 MHz */
    /* : Run Speed 58.9824MHz (With PLL) */
    /* Compiler : Keil ARM V2.32a */
    /* Last Update : 1/September/2005 */
    /* Function : Example Use GPIO-1 on Output Mode */
    /* : LED Blink on GPIO1.16 */
    /*****************************************************/

    #include <LPC21xx.H> // LPC2119 MPU Register

    /* pototype section */
    void delay_led(unsigned long int); // Delay Time Function

    int main(void)
    { PINSEL2 &= 0xFFFFFFFC; // Makesure GPIO1.16 = GPIO Function IODIR1 = 0x00010000; // Set GPIO1.16 = Output IOSET1 = 0x00010000; // Set GPIO1.16 Output Pin (OFF LED)

    // Loop Blink LED on GPIO1.16 // while(1) // Loop Continue { IOCLR1 = 0x00010000; // Clear Output Pin P1.16 (ON LED) delay_led(1500000); // Display LED Delay IOSET1 = 0x00010000; // Set Output Pin P1.16 (OFF LED) delay_led(1500000); // Display LED Delay }
    }

    /***********************/
    /* Delay Time Function */
    /* 1-4294967296 */
    /***********************/
    void delay_led(unsigned long int count1)
    { while(count1 > 0) {count1--;} // Loop Decrease Counter

  • Have I checked the compiler switches? I need to check them. Will the delay function work? Will it always work? What can effect it? Is anybody listening?

  • Obviously I cannot check if the delay is working because nothing is working on the stamp board.

    Can I post the screenshots somewhere?

  • I can make a smaller simple program first?

  • I tried with this..

    #include <LPC21xx.H>                                              // LPC2119 MPU Register
    
    /* pototype  section */
    
    
    int main(void)
    {
      PINSEL2 &= 0xFFFFFFFC;                                                                    // Makesure GPIO1.16 = GPIO Function
      IODIR1   = 0x00010000;                                                        // Set GPIO1.16 = Output
      IOSET1   = 0x00010000;                                        // Set GPIO1.16 Output Pin (OFF LED)
            IOCLR1 = 0x00010000;                                                                    // Clear Output Pin P1.16 (ON LED)
    
    }
    
    

    But the same thing. Port 1 remained high.
    Can you compile it and post the HEX contents so I can compare?

    thanks a lot

  • did I forget to put a loop at the end of main to stop it ending?

    can you compile it yourself?

    
    int main(void)
    {
      // la de da coding stuff
    
    the_next_step:
      goto the_next_step;
    }
    
    

  • It's good to know that C/C++ has no suitable looping construct for creating infinite loops, so a goto construct is needed.

  • goto is an old technique for branching, long since lost in the sands of time.

  • I corrected the while(1); issue because I had modified the original code and I forgot the infinite loop at the end. I still have nothing working.

    Now I am just putting the Port Low but it is remaining @ 2.1V. How come. This is the code:

    #include <LPC21xx.H>                                              // LPC2119 MPU Register
    
    
    int main(void)
    {
      PINSEL2 &= 0xFFFFFFFC;                                                                    // Makesure GPIO1.16 = GPIO Function
      IODIR1   = 0x00010000;                                                        // Set GPIO1.16 = Output
      IOSET1   = 0x00010000;                                        // Set GPIO1.16 Output Pin (OFF LED)
    
      // Loop Blink LED on GPIO1.16 //
    
        IOCLR1 = 0x00010000;                                                                        // Clear Output Pin P1.16 (ON LED)
            while(1);
    }
    
    This is a screen shot of the options. Is there anything wrong for LPC2119?
    
    

  • This is a screen shot of the options. Is there anything wrong for LPC2119?

    [IMG]i58.tinypic.com/20ruuet.png[/IMG]

  • you need a delay function to see the blinking

      IOSET1   = 0x00010000;     // Set GPIO1.16 Output Pin (OFF LED)
    
      // Loop Blink LED on GPIO1.16 //
      delay_function();
    
        IOCLR1 = 0x00010000;
    

  • But i think that it will not working yet. Can you send another screen shot from linker tab?