Content originally posted in LPCWare by wellsk on Thu Nov 29 11:00:00 MST 2012
>I compiled the USBMassStorageHost project to work on USB1. In doing this, the baud rate initialization for the debug port UART0 didn't work properly. The USB_init routine was called after the debug UART was initialized. I believe the issue was where the USB changes the operating frequency to 180 MHz. After the normal initialization I believe it was at 204 MHz when the UART init was called. I moved the UART init afterwards and it worked fine.
We know about this issue and it will be corrected in the next release. If you do catch more issues, it doesn't hurt to add the tracker issue for it. (Tracker issues will eventually get processed, although they have been somewhat delayed lately, and you should get an email when it's status has changed if you subscribe to that issue).
>One other comment/question: In my application using IAR with the older CMSIS files for LPC4350, I am loading the EMC, CGU and maybe another file or two into internal SRAM. This is required during the EMC initialization. The other CMSIS library files are still located in external flash memory. Is there any standard features planned with LPCOpen to support this or do I just need to set custom compile/link options for the particular C library files as I did with the old CMSIS library?
I can probably answer this question, but might need to know why those files needed to be relocated to IRAM. Is it because they use RW data areas that are not initialized for those drivers, but you need to use that data to initialize the ENC itself? (so it's using a resource that isn't yet available).
Changes have been made to the low drivers and setup code in LPCOpen. The clock, EMC setup (DRAM), and pin muxing are performed prior to calling the application entry point (main, __main, iar_entry, etc.). Setting up DRAM or external memory prior to doing this allows scatter loading, per-initialized data copy to DRAM, and ZI data section clear in DRAM/extmem to work correctly as part of the toolchain's run-time setup. So you can use the CGU driver, EMC driver, and some other low level drivers without them trying to use external memory for data storage prior to it being initialized.
Most driver code and startup code in the LPCOpen platform are/were checked to verify they don't use RW/ZI memory, so the use of EMC, CGU, and most drivers can be safely used prior to memory being setup. Not all drivers have this features, some do require memory (ie, UART) - these need to be setup as part of the application after memory is initialized. Some drivers (ie, CGU/CCU) are also stateless and can be used on all cores in the multi-core parts simultaneously without them altering what's on the other core. Currently, not all drivers are 'multi-core friendly' yet, but they will be soon - with the exception of setup related drivers (ie, DRAM setup which is done only one on the core that boots the system).
So you should no longer need to locate the CGU and EMC drivers to IRAM to use them.
On another note, you had asked about ongoing LWIP support in another email. LWIP will be maintained in both the LPCOpen platform and the older lwip_lpc release until the LPCOpen platform has all the current support of the lwip_lpc release (this will be the case with other packages too). Currently, the LPCOpen port and the lwip_lpc port have the same functionality for LWIP on the 18xx/43xx, but the LPCOpen port has different standards applies to that port and uses LPCOpen resources. Once the 17xx support for LWIP makes it into the LPCOpen platform, the lwip_lpc port will no longer be actively developed.