LPC1343 USB Bootloader

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC1343 USB Bootloader

926 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by imanhp on Wed Jul 14 12:47:27 MST 2010
Hi,

This might be a bit off topic (due to the non LPCXpresso relation) but I will try anyways in hopes of clearing up some questions that I have.

OK, so I want to make my own board for the LPC1343 (I have a couple of LPC1343FBD48 to play with here in my lab).

I thought it would be neat to use the USB mass storage bootloader thing to program the chip. As far as I have understood from the datasheets I need to do pull up on a pin to activate the built in USB mass storage device. Well that's simple enough.

I figured out from an appnote  (http://www.nxp.com/documents/application_note/AN10905.pdf) that "The  on-chip USB driver requires RAM from 0x10000050 and 0x10000180 to be  allocated for USB frame buffers."´, and that's pretty easy to do.

But do i need to take any other special considerations with the sourcecode or can I happily just code with any compiler-package (I am using CrossWorks) that supports the lpc1343 chip?

Cheers!
//iman
0 Kudos
Reply
2 Replies

806 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ktownsend on Sun Jul 18 14:53:25 MST 2010
If you're using Crossworks, it will automatically fix the CRC on the .bin files so you don't need to do anything special. For the SRAM issue, you can import the section placement to your project and use the following settings which will set aside the appropriate chunk of SRAM. This example is for rom-based USBHID ... you may need to adjust the values if the MSD uses more or less memory (see the "RAM" MemorySegment):

[HTML]
<!DOCTYPE Linker_Placement_File>
<Root name="Flash Section Placement">
  <MemorySegment name="FLASH" start="0x00000000" size="0x8000">
    <ProgramSection load="Yes" inputsections="*(.vectors .vectors.*)" name=".vectors"/>
    <ProgramSection alignment="4" load="Yes" inputsections="*(.init .init.*)" name=".init"/>
    <ProgramSection alignment="4" load="Yes" inputsections="*(.text .text.* .glue_7t .glue_7 .gnu.linkonce.t.* .gcc_except_table)" name=".text"/>
    <ProgramSection alignment="4" load="Yes" inputsections="KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors))" name=".dtors"/>
    <ProgramSection alignment="4" load="Yes" inputsections="KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors))" name=".ctors"/>
    <ProgramSection alignment="4" load="Yes" inputsections="*(.rodata .rodata.* .gnu.linkonce.r.*)" name=".rodata"/>
    <ProgramSection alignment="4" load="Yes" runin=".fast_run" inputsections="*(.fast .fast.*)" name=".fast"/>
    <ProgramSection alignment="4" load="Yes" runin=".data_run" inputsections="*(.data .data.* .gnu.linkonce.d.*)" name=".data"/>
  </MemorySegment>
  <MemorySegment name="RAM" start="0x10000180" size="0x2000-0x180">
    <ProgramSection alignment="4" load="No" name=".fast_run"/>
    <ProgramSection alignment="4" load="No" name=".data_run"/>
    <ProgramSection alignment="4" load="No" inputsections="*(.bss .bss.* .gnu.linkonce.b.*) *(COMMON)" name=".bss"/>
    <ProgramSection alignment="4" load="No" inputsections="*(.non_init .non_init.*)" name=".non_init"/>
    <ProgramSection alignment="4" size="__HEAPSIZE__" load="No" name=".heap"/>
    <ProgramSection alignment="4" size="__STACKSIZE__" load="No" name=".stack"/>
    <ProgramSection alignment="4" size="__STACKSIZE_PROCESS__" load="No" name=".stack_process"/>
  </MemorySegment>
  <MemorySegment name="FLASH2">
    <ProgramSection alignment="4" load="Yes" inputsections="*(.text2 .text2.*)" name=".text2"/>
    <ProgramSection alignment="4" load="Yes" inputsections="*(.rodata2 .rodata2.*)" name=".rodata2"/>
    <ProgramSection alignment="4" load="Yes" runin=".data2_run" inputsections="*(.data2 .data2.*)" name=".data2"/>
  </MemorySegment>
  <MemorySegment name="RAM2">
    <ProgramSection alignment="4" load="No" name=".data2_run"/>
    <ProgramSection alignment="4" load="No" inputsections="*(.bss2 .bss2.*)" name=".bss2"/>
  </MemorySegment>
</Root>
[/HTML]

Kevin.
0 Kudos
Reply

806 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Europe on Thu Jul 15 04:32:20 MST 2010
Hi imanhp,
If you'd like to use the USB MSC for programming the  microcontroller, the only thing indeed to keep in mind is the RAM usage  of the USB MSC as described in the app note.

With that you can  use all tools you'd like, supporting or not supporting the LPC1343. As  long as it is able of creating a .bin file with the right mem mapping.

Kind  regards,
0 Kudos
Reply