10 years, 10 months ago.

Using USBHost and EthernetInterface together

Is it possible to use the USBHost and the EthernetInterface functionality and RTOS and SDFileSystem in one program (on LPC1768) ? I just read that the Usb and Ethernet libraries are using 'the other half" of the RAM and I was wondering if this could be an issue.

Is there a way to catch stack overflow error ?

1 Answer

10 years, 9 months ago.

If the USBHost driver and the EthernetInterface are using "the other half" of the RAM correctly, that should not be a problem.

There is so-called AHB SRAM that is dedicated to the peripherals (but can be used by general purpose programs anyway)

Looking at the LCF file sources, you can distill which parts these are:

LR_IROM1 0x00000000 0x80000  {    ; load region size_region
  ER_IROM1 0x00000000 0x80000  {  ; load address = execution address
   *.o (RESET, +First)
   *(InRoot$$Sections)
   .ANY (+RO)
  }
  RW_IRAM1 0x10000000 0x8000  {  ; RW data, Application data
   .ANY (+RW +ZI)
  }
  RW_IRAM2 0x2007C000 0x4000  {  ; RW data, USB RAM
   .ANY (AHBSRAM0)
  }
  RW_IRAM3 0x20080000 0x4000  {  ; RW data, ETH RAM
   .ANY (AHBSRAM1)
  }
  RW_IRAM4 0x40038000 0x0800  {  ; RW data, CAN RAM
   .ANY (CANRAM)
  }
}

Source: http://mbed.org/users/mbed_official/code/mbed/file/b3110cd2dd17/LPC1768/ARM/LPC1768.sct