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

Issue With loded code under IAP

i am using LPC2148 For my Project. There is a problem in Loded code in IAP programming through Secondary Bootloder(USB)....

1).When I load Code USING FLASH MAGIC ISP MODE(Through Serial Coomunication). my code works fine without any Problem..(BUT code is might in size so it is painful to wait 5 min To see How its Work.)

2).When Same code i modified(Not edit Code only few settings to generate binary file.) For compatiblity in USB Bootloder Purpose.The code is loded succesfully without errors and There is a proper execution of all things except SERIAL COMMUNICATION..my serial communication is not work properly and strange characters are displaying in Terminal...

i am beginner so not Developed A code for USB bootloder But just Get it from NXP..

www.nxp.com/.../AN10711.zip

and it is working fine and able to load code with P0.15 low and detect USB storage..

By googling about this i find there should be little modification for Startup.s for the Interrupt Vector Table and yes i am using Serial interrupt which on character reception into lpc2148..

Parents
  • 5 minutes to transfer program using ISP?

    The LPC2148 doesn't have any huge flash memory, so a transfer shouldn't take long unless you run a very low baudrate.

    At 115400 baud, you would transfer about 5kB of code/second which means a 512 kB flash would fill in 100 seconds. Twice that if you verify the transfer.

    What parameters are you changing for USB compatibility? Some clock frequencies? Always verify your baudrates by looking at transmitted data using an oscilloscope. And remember that some clock frequency changes may require you to also adjust the clock settings or the baudrate computation to make sure the UART communication ends up using the expected baudrate.

Reply
  • 5 minutes to transfer program using ISP?

    The LPC2148 doesn't have any huge flash memory, so a transfer shouldn't take long unless you run a very low baudrate.

    At 115400 baud, you would transfer about 5kB of code/second which means a 512 kB flash would fill in 100 seconds. Twice that if you verify the transfer.

    What parameters are you changing for USB compatibility? Some clock frequencies? Always verify your baudrates by looking at transmitted data using an oscilloscope. And remember that some clock frequency changes may require you to also adjust the clock settings or the baudrate computation to make sure the UART communication ends up using the expected baudrate.

Children
  • Ya....its right I use 9600 bps...but I use 12Mhz cry.
    And 2nd things is that my serial device support 9600 so i use in my application

    And for usb compatibility I just create. Bin file from. Elf and make irrom1
    From 0x00 to 0x2000.
    So my application code is at 0x2000..all things working correctly at isp program loading ....

    Only problem is with iap flashing ....

    There is not any kind of changes in freq. In between all this procedure .....

    Exactly doesn't known why mine serial comm is not working .....
    Thanks for ur rply per ....

  • After Reading NXP secondary Bootloder figure out some Data Might be Useful For solution...

    For NXP AN10711 USB bootloader....
    Loded At 0x00 Hex
    1> Used Interrupt:

    
      VICVectAddr0 = (unsigned long)USB_ISR;    /* USB Interrupt -> Vector 0 */
      VICVectCntl0 = 0x20 | 22;                 /* USB Interrupt -> IRQ Slot 0 */
      VICIntEnable = 1 << 22;                   /* Enable USB Interrupt */
    
    

    2> Startup.s Adresses:
    (Stack configuration..)

    Undefined Mode :0x0000 0000
    Supervisor Mode :0x0000 0008
    Abort Mode :0x0000 0000
    Fast Interrupt Mode:0x0000 0000
    Interrupt Mode :0x0000 0400
    User/System Mode :0x0000 0800

    For User Application (main application Code)....
    Loded At 0x2000 Hex
    1> Used Interrupt:

      VICVectCntl13 = 0x20 | 13; ; //Set channel
      VICVectAddr13 = (unsigned long)RTCHandler; //Set the timer ISR vector address
    
      VICVectCntl2 = 0x20 | 16; //0x0000002F; //select a priority slot for a given interrupt
      VICVectAddr2 = (unsigned long)EXTINT3_VectoredIRQ; // pass the address of the IRQ into VIC
      VICVectCntl0 = 0x20 | 14;
      VICVectAddr0 = (unsigned long)EXTINT0_VectoredIRQ;
      VICVectCntl3 = 0x20 | 17;
      VICVectAddr3 = (unsigned long)EXTINT2_VectoredIRQ;
    
      VICVectCntl5 = 0x20 | 6;
      VICVectAddr5=(unsigned long) UART_ISR0;
    

    2> Startup.s Adresses:
    (Stack configuration..)

    Undefined Mode :0x0000 0000
    Supervisor Mode :0x0000 0008
    Abort Mode :0x0000 0000
    Fast Interrupt Mode:0x0000 0000
    Interrupt Mode :0x0000 0080
    User/System Mode :0x0000 0400

    If there is a need of remaping than how to remap those adresses for proper execution of my code loded with secondary boot loder..