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

IAP on the LPC1788 Developer's Kit

Hi,

I have an LPC1788-32 Developer's Kit.

I would like to plug the device into my computer via USB, it to come up as a Mass Storage Device (MSD) containing a single file - it's current firmware, be able to replace the current firmware with a new one on the MSD, reset the device and have it running the new firmware. I.e. implement IAP over USB.

As a starting point I have been looking at the following application note from LPCWare: AN10866: LPC1700 secondary USB bootloader, which contains a uVision sample project... however, it appears to be written with a different developer kit in mind (Keil's MCB1700 development board). I have tried the following on the LPC1788 Dev. kit available to me:

- Within uVision, compiling the code as is. Uploading it via ISP.
- Within uVision, adding a target of an LPC1788, compiling the code as is. Uploading it via ISP.
- Within uVision, both of above, only calling enter_usb_isp() within main(). Uploading it via ISP.

The jumpers were kept at the default positions during the above. Additionally J15, 'Force USB Connect', was also closed. At this point the PC recognised a USB device, but it was unrecognised.

So what am I not doing?

Thank you!

Parents
  • > I have an LPC1788-32 Developer's Kit.

    I remember, on this board, the USB DEVICE port should be assigned to USB2 port, though the AN10866 supposes USB1 port. Unfortunately, I can't confirm it, because I don't have this kit. Embedded Artists restrict access to the schematics of these boards just for registered. But a couple of example code, like Keil V4 HID, suggests this setting.

    C:\Keil\ARM\Boards\Embedded Artists\LPC1788-32 Developers Kit\RL\USB\Device\HID\usbd_LPC177x_8x.c

    You may drag in corresponding part of the source code from above HID example,

    \AN10866\LPC1700 Secondary USB bootloader\usb\usbhw.c
    
    void USB_Init (void) {
    
      LPC_SC->PCONP       |=  (1UL << 31);  /* Enable USB interface power/clock   */
    
      LPC_USB->USBClkCtrl = 0x1A;                  /* Dev, PortSel, AHB clock en  */
      while ((LPC_USB->USBClkSt & 0x1A) != 0x1A);
    
      LPC_USB->StCtrl   =  0x02;            /* USB device maped to U2 port        */
    
      /* Set pin functions                                                        */
      LPC_IOCON->P1_30 = 2;
      LPC_IOCON->P0_14 = 3;                 /* USB_CONNECT2                       */
      LPC_IOCON->P0_31 = 1;                 /* USB_D+2                            */
                                            /* USB_D-2 is dedicated pin           */
      LPC_IOCON->P1_30 = 0;
      LPC_IOCON->P0_13 = 1 | (1 << 7);      /* USB_UP_LED2                        */
    
      USBD_Reset();
      USBD_SetAddress(0, 0);
    
      NVIC_EnableIRQ(USB_IRQn);             /* enable USB interrupt               */
    }
    

    > Additionally J15, 'Force USB Connect', was also closed.

    Don't enable 'Force USB Connect', so that the secondary bootloader could soft-disconnect/connect, to bring re-enumeration at switch to your firmware.

    Tsuneo

Reply
  • > I have an LPC1788-32 Developer's Kit.

    I remember, on this board, the USB DEVICE port should be assigned to USB2 port, though the AN10866 supposes USB1 port. Unfortunately, I can't confirm it, because I don't have this kit. Embedded Artists restrict access to the schematics of these boards just for registered. But a couple of example code, like Keil V4 HID, suggests this setting.

    C:\Keil\ARM\Boards\Embedded Artists\LPC1788-32 Developers Kit\RL\USB\Device\HID\usbd_LPC177x_8x.c

    You may drag in corresponding part of the source code from above HID example,

    \AN10866\LPC1700 Secondary USB bootloader\usb\usbhw.c
    
    void USB_Init (void) {
    
      LPC_SC->PCONP       |=  (1UL << 31);  /* Enable USB interface power/clock   */
    
      LPC_USB->USBClkCtrl = 0x1A;                  /* Dev, PortSel, AHB clock en  */
      while ((LPC_USB->USBClkSt & 0x1A) != 0x1A);
    
      LPC_USB->StCtrl   =  0x02;            /* USB device maped to U2 port        */
    
      /* Set pin functions                                                        */
      LPC_IOCON->P1_30 = 2;
      LPC_IOCON->P0_14 = 3;                 /* USB_CONNECT2                       */
      LPC_IOCON->P0_31 = 1;                 /* USB_D+2                            */
                                            /* USB_D-2 is dedicated pin           */
      LPC_IOCON->P1_30 = 0;
      LPC_IOCON->P0_13 = 1 | (1 << 7);      /* USB_UP_LED2                        */
    
      USBD_Reset();
      USBD_SetAddress(0, 0);
    
      NVIC_EnableIRQ(USB_IRQn);             /* enable USB interrupt               */
    }
    

    > Additionally J15, 'Force USB Connect', was also closed.

    Don't enable 'Force USB Connect', so that the secondary bootloader could soft-disconnect/connect, to bring re-enumeration at switch to your firmware.

    Tsuneo

Children