|
|
|
|
|
由 DF9DQ 于 星期四, 2013-04-25 05:41 发表
|
The attached project for the Embedded Artists board was created as a test of the bandwidth of SDRAM/MCI/AHB bus.
As a gimmick we made this a simple video player: Uncompressed video frames (bitmaps) and uncompressed audio are stored on an SD card. Both video and audio are continuously transferred to SDRAM via DMA. Video frames are then displayed on a TFT screen, and audio is sent via DMA to an external stereo audio DAC on I2S.
The application supports the QVGA (320x240) and WVGA (800x480) TFT boards of Embedded Artists.
With the 800x480 7" WVGA board, the TFT refresh rate is 65 Hz, and the average read speed of the SD card is 7.6 MiB/s, an impressive demonstration of the high bandwidth capabilty of the LPC1788 bus system and peripherals.
|
|
|
|
|
|
|
|
|
|
|
由 Wouter 于 星期一, 2013-01-14 03:56 发表
|

This blog describes how to use and customize the emWin skins to change the look of the emWin widgets.
What is skinning?
Skinning is a method of changing the appearance of one or multiple widgets. It allows changing the look by using a dedicated skin which defines how the widgets are rendered. This makes it easy to change the appearance of a complete group of widgets in a similar way by changing only the skin. Without skinning, widget member functions have to be used to change the look for each single widget or the callback function has to be overwritten.
| Classical design | Default skin |
 |
 |
Skinning makes only sense if a widget consists of several widget specific details. It does not make sense for each kind of widget. A TEXT widget for example does not require a separate skin, because it consists only of the text itself.
Currently the following widgets support skinning:
- BUTTON
- CHECKBOX
- DROPDOWN
- FRAMEWIN
- HEADER
- PROGBAR
- RADIO
- SCROLLBAR
- SLIDER
[From http://www.segger.com/skinning.html]
Using Skinning
Using skinning is very easy; with just a few command, your GUI can have a more modern and more appealing look already! Currently emWin comes with one standard skin, called SKIN_FLEX. This skin can be used by calling the widget's SetDefaultSkin() function. E.g. to use the SKIN_FLEX skin on all buttons in your GUI, simply call the following function before drawing the GUI:
BUTTON_SetDefaultSkin(BUTTON_SKIN_FLEX);
Customizing skins
The default skin (SkinFlex) can easily be customized.
As an example, let's examine how the SkinFlex skin of a button widget can be customized. All widgets which are capable of using the SkinFlex skin have a property get-and-set-function called X_GetSkinFlexProps() and X_SetSkinFlexProps() (X being the name of the widget, e.g. BUTTON). These functions can retrieve and set the properties of the SkinFlex skin for that specific widget. The available properties depend on what widget is used, but the procedure for changing any of the properties is the same for all widgets.
Both the get and set function require two parameters:
- A pointer to an object to store/retrieve the skin properties to/in.
- An index number. The index number represents the state a widget can have, e.g. a button can be pressed, focussed, enabled or disabled. Each of these states have specific properties.
An example for a button with SkinFlex skin is provided below:
BUTTON_SKINFLEX_PROPS /* Temp variable to store customized settings of the skin */
BUTTON_GetSkinFlexProps(&Props, BUTTON_SKINFLEX_PI_ENABLED); /* Get current skin properties of enabled button */
Props.aColorFrame[0] = GUI_GREEN; /* Change colors of several parts of the button */
Props.aColorFrame[1] = GUI_MAGENTA;
Props.aColorFrame[2] = GUI_BLUE;
Props.aColorUpper[0] = GUI_YELLOW;
Props.aColorUpper[1] = GUI_RED;
Props.aColorLower[0] = GUI_GREEN;
Props.aColorLower[1] = GUI_BLUE;
BUTTON_SetSkinFlexProps(&Props, BUTTON_SKINFLEX_PI_ENABLED); /* Store new skin properties to enabled button */
Result:

The provided example code needs to be executed before the GUI is drawn on the screen. Upon drawing, all buttons assigned to the SkinFlex skin will use the customized properties.
Note: Only index BUTTON_SKINFLEX_PI_ENABLED is changed here. Only when the button is enabled (thus not focussed, pressed or disabled) the customized skin is displayed.
More information
More information can be found on the segger website: http://www.segger.com/skinning.html
Also one of the demo applications provided by segger (http://www.segger.com/emwin-samples.html) show how to apply skinning:

Simulator executable [link]
Source code [link]
|
|
|
|
|
|
|
|
|
|
|
由 nxp_apps 于 星期二, 2012-11-27 16:05 发表
|
This blog describes how to invoke ISP mode on the LPCXpresso LPC812 board.
Need the following:
LPCXpresso LPC812 Board
Flash Magic V 7.0 or later (www.flashmagictool.com)
Use FTDI cable: C232HD-DDHSP-0
(http://www.ftdichip.com/Support/Documents/DataSheets/Cables/DS_C232HD_UA...)
Connections:
J7 LPCXpresso board -> FTDI Cable
J7.3 -> Red
J7.4 -> Orange
J7.5 -> Yellow
J7.8 -> Connect to GND (for ISP Enable)
FTDI Black wire connect to ground
Jumper for ISP pin to GND to enable ISP mode
Power board via USB connector on the Link-I side.
Start Flash Magic. Now it should be possible to read the device ID and more!
|
|
|
|
|
|
|
|
|
|
|
由 usb10185 于 星期三, 2012-11-21 09:51 发表
|
NXP recently announced the LPC800, a small pin count family of parts with a neat set of serial peripherals and a Cortex M0+ core.
The LPCXpresso evaluation board was also announced, it has the LPC812 20pin TSSOP device mounted. The board schematics can be found here http://www.lpcware.com/gfiles/devper/lpc800
Of course native support for the family is already in place in the LPCXpresso IDE (http://lpcware.com/LPCXpresso).
However some users may want to use their existing debug hardware such as ULINKme or JLINK to connect to the part.
Connection of Keil’s ULINKme is as easy as long as you have the 10pin cable!
For Segger’s JLINK there is a simple ‘trick’ required to get going. On the LPCXpresso board simply connect J4.11 to 3.3V available on J6.28. This forces the part out of reset state.
To get the ULINK2 to work a low value resistor is required on the LPCXpresso board. R29, connected to pin 1 of J5, the 10-pin JTAG header. This is not populated on any Xpresso board. If the user adds a low ohm resistor to Vdd (3.3v), then ULINK2 will work. The other option is to pop open the ULINK2 and switch the jumper (to provide target power via the probe) in the ULINK2. In some cases the jumper inside the ULINK2 may already be in the correct position.
|
|
|
|
|
|
|
|
|
|
|
由 NXP_Support 于 星期五, 2012-11-02 02:27 发表
|
Since ARM Cortex-M0 doesn't have instruction set to do division (integer division and floating point division), any division (such as '/' and '%') will need helper functions (which usually supplied by the compiler).
To reduce the Flash usage, the integer division on LPC11U2x / LPC11U3x has been hardcoded into the bootROM. To use it, copy and paste this source code into the project that you are using.
/* Copyright (c) 2012, Daniel Widyanto * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of the copyright holders nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN * NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
#if defined (__cplusplus) extern "C" { #endif
typedef struct { int quot; int rem; } idiv_return; typedef struct { unsigned quot; unsigned rem; } uidiv_return;
struct LPC_ROM_DIV_STRUCT { /* Signed integer division */ int(*sidiv)(int numerator, int denominator); /* Unsigned integer division */ unsigned (*uidiv)(unsigned numerator, unsigned denominator); /* Signed integer division with remainder */ idiv_return (*sidivmod)(int numerator, int denominator); /* Unsigned integer division with remainder */ uidiv_return (*uidivmod)(unsigned numerator, unsigned denominator); };
typedef struct _ROM { unsigned p_dev1; unsigned p_dev2; unsigned p_dev3; unsigned pPWRD; struct LPC_ROM_DIV_STRUCT* pROMDiv; unsigned p_dev4; unsigned p_dev5; unsigned p_dev6; } ROM;
static ROM** rom =(ROM **) 0x1FFF1FF8; static struct LPC_ROM_DIV_STRUCT *pDivROM = (struct LPC_ROM_DIV_STRUCT *)((*rom)->pROMDiv);
int __aeabi_idiv(int numerator, int denominator) { return pDivROM->sidiv(numerator, denominator); }
unsigned __aeabi_uidiv(unsigned numerator, unsigned denominator) { return pDivROM->uidiv(numerator, denominator); }
idiv_return __aeabi_idivmod(int numerator, int denominator) { return pDivROM->sidivmod(numerator, denominator); }
uidiv_return __aeabi_uidivmod(unsigned numerator, unsigned denominator) { return pDivROM->uidivmod(numerator, denominator); }
#if defined (__cplusplus) } // extern "C" #endif
For further reference, please refer to "Run-time ABI for the ARM Architecture" (http://infocenter.arm.com/help/topic/com.arm.doc.ihi0043c/IHI0043C_rtabi...)
|
|
|
|
|
|
|
|
|
|
|
由 Daniel Widyanto 于 星期一, 2012-10-08 21:37 发表
|

This is simple demo on how to re-invoke ISP from user code. Tested on LPC1788 (should work on LPC177x and LPC178x as well).
/* * Copyright (c) 2012, NXP Semiconductors N.V. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the NXP Semiconductors N.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL NXP Semiconductors N.V. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
#include <LPC177x_8x.h>
#include <cr_section_macros.h> #include <NXP/crp.h>
#define IAP_ADDRESS 0x1FFF1FF1 #define REINVOKE_ISP 57
/* To reinvoke ISP, this must be in the heap, not in the stack * ie. Don't put the command and result array as local variables */ static unsigned int command[5]; static unsigned int result[4];
typedef unsigned int (*IAP)(unsigned int[], unsigned int[]); static const IAP iap_entry = (IAP) IAP_ADDRESS;
static void iap_reinvoke_isp(void) { /* Set the clock source back into IRC */ LPC_SC->CLKSRCSEL = 0; LPC_SC->CCLKSEL = 1;
/* Set stack pointer to ROM value (reset default) */ __set_MSP(*((uint32_t *) 0x1FFF0000));
command[0] = REINVOKE_ISP; iap_entry(command, result);
/* Never return from here */ }
// Variable to store CRP value in. Will be placed automatically // by the linker when "Enable Code Read Protect" selected. // See crp.h header for more information __CRP const unsigned int CRP_WORD = CRP_NO_CRP;
int main(void) { iap_reinvoke_isp(); return 0; }
|
|
|
|
|
|
|
|
|
|
|
由 NXP_Support 于 星期四, 2012-09-27 20:08 发表
|
For those in need of IAP demo code / example code, here's simple code to test the IAP function for NXP ARM Cortex-M MCUs. Tested in LPC11xx, LPC11Cxx, LPC12xx.
iap_driver.c
/* * Copyright (c) 2010, NXP Semiconductors N.V. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the NXP Semiconductors N.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL NXP Semiconductors N.V. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/* * iap_driver.c * Demonstrate basic capability of In-Application Programming feature * * by: Daniel Widyanto <daniel.widyanto@nxp.com> */
#include <LPC122x.h> #include "iap_driver.h"
/* * The IAP funtion address in LPC11xx ROM */ #define IAP_ADDRESS 0x1FFF1FF1
/* * Command codes for IAP */ #define PREPARE_SECTOR 50 #define COPY_RAM_TO_FLASH 51 #define ERASE_SECTOR 52 #define BLANK_CHECK_SECTOR 53 #define READ_PART_ID 54 #define READ_BOOT_CODE_REV 55 #define COMPARE 56 #define REINVOKE_ISP 57 #define READ_UID 58
typedef unsigned int (*IAP)(unsigned int[], unsigned int[]); static const IAP iap_entry = (IAP) IAP_ADDRESS;
/*--------------------------------------------------------------------------- * Public functions */
/** * Init IAP driver * @return 0 for success */ int iap_init(void) { /* Need to update 'SystemCoreClock' according to the current clock settings * It's needed as IAP parameter */ SystemCoreClockUpdate(); return 0; }
/** * Erase flash sector(s) * * @param sector_start The start of the sector to be erased * @param sector_end The end of the sector to be erased * * @return CMD_SUCCESS, BUSY, SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION, * or INVALID_SECTOR */ int iap_erase_sector(unsigned int sector_start, unsigned int sector_end) { unsigned int command[5]; unsigned int result[4];
command[0] = ERASE_SECTOR; command[1] = (unsigned int) sector_start; command[2] = (unsigned int) sector_end; command[3] = SystemCoreClock / 1000; iap_entry(command, result);
return (int) result[0]; }
/** * Prepare flash sector(s) for erase / writing * * @param sector_start The start of the sector to be prepared * @param sector_end The end of the sector to be prepared * * @return CMD_SUCCESS, BUSY, or INVALID_SECTOR */ int iap_prepare_sector(unsigned int sector_start, unsigned int sector_end) { unsigned int command[5]; unsigned int result[4];
command[0] = PREPARE_SECTOR; command[1] = (unsigned int) sector_start; command[2] = (unsigned int) sector_end; iap_entry(command, result);
return (int) result[0]; }
/** * Copy RAM contents into flash * * @param ram_address RAM address to be copied * It should be in word boundary * @param flash_address Flash address where the contents are to be copied * It should be within 256bytes boundary * @param count Number of data to be copied (in bytes) * The options: 256, 512, 1024, 4096 * * @return CMD_SUCCESS, BUSY, or INVALID_SECTOR */ int iap_copy_ram_to_flash(void* ram_address, void* flash_address, unsigned int count) { unsigned int command[5]; unsigned int result[4];
command[0] = COPY_RAM_TO_FLASH; command[1] = (unsigned int) flash_address; command[2] = (unsigned int) ram_address; command[3] = count; command[4] = SystemCoreClock / 1000; iap_entry(command, result);
return (int) result[0]; }
iap_driver.h
/* * Copyright (c) 2010, NXP Semiconductors N.V. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the NXP Semiconductors N.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL NXP Semiconductors N.V. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/* * iap_driver.h * Demonstrate basic capability of In-Application Programming feature * * by: Daniel Widyanto <daniel.widyanto@nxp.com> */
#ifndef IAP_DRIVER_H_ #define IAP_DRIVER_H_
/* * IAP status codes */ typedef enum { CMD_SUCCESS = 0, INVALID_COMMAND, SRC_ADDR_ERROR, DST_ADDR_ERROR, SRC_ADDR_NOT_MAPPED, DST_ADDR_NOT_MAPPED, COUNT_ERROR, INVALID_SECTOR, SECTOR_NOT_BLANK, SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION, COMPARE_ERROR, BUSY, } __e_iap_status;
/** * Init IAP driver * @return 0 for success */ int iap_init(void);
/** * Erase flash sector(s) * * @param sector_start The start of the sector to be erased * @param sector_end The end of the sector to be erased * * @return CMD_SUCCESS, BUSY, SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION, * or INVALID_SECTOR */ int iap_erase_sector(unsigned int sector_start, unsigned int sector_end);
/** * Prepare flash sector(s) for erase / writing * * @param sector_start The start of the sector to be prepared * @param sector_end The end of the sector to be prepared * * @return CMD_SUCCESS, BUSY, or INVALID_SECTOR */ int iap_prepare_sector(unsigned int sector_start, unsigned int sector_end);
/** * Copy RAM contents into flash * * @param ram_address RAM address to be copied * It should be in word boundary * @param flash_address Flash address where the contents are to be copied * It should be within 256bytes boundary * @param count Number of data to be copied (in bytes) * The options: 256, 512, 1024, 4096 * * @return CMD_SUCCESS, BUSY, or INVALID_SECTOR */ int iap_copy_ram_to_flash(void* ram_address, void* flash_address, unsigned int count);
#endif /* IAP_DRIVER_H_ */
To test the IAP function
main.c
/* * Copyright (c) 2010, NXP Semiconductors N.V. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the NXP Semiconductors N.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL NXP Semiconductors N.V. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
#include <LPC122x.h> #include <cr_section_macros.h> #include <NXP/crp.h>
#include "iap_driver.h"
// Variable to store CRP value in. Will be placed automatically // by the linker when "Enable Code Read Protect" selected. // See crp.h header for more information __CRP const unsigned int CRP_WORD = CRP_NO_CRP ;
/* Flash offset where the configuration is stored */ #define CONFIG_FLASH_OFFSET 0x1000 #define CONFIG_FLASH_SECTOR (CONFIG_FLASH_OFFSET >> 12) #define CONFIG_FLASH_SECTOR_SIZE 1
static uint8_t demo_messg[] = "Greetings from IAP";
int main(void) { __e_iap_status iap_status;
/* Init the IAP driver */ iap_init();
/* Prepare the sector for erase */ iap_status = (__e_iap_status) iap_prepare_sector(CONFIG_FLASH_SECTOR, (CONFIG_FLASH_SECTOR + CONFIG_FLASH_SECTOR_SIZE)); if (iap_status != CMD_SUCCESS) while(1);
/* Erase the sector */ iap_status = (__e_iap_status) iap_erase_sector(CONFIG_FLASH_SECTOR, (CONFIG_FLASH_SECTOR + CONFIG_FLASH_SECTOR_SIZE)); if (iap_status != CMD_SUCCESS) while(1);
/* Prepare the sector for writing */ iap_status = (__e_iap_status) iap_prepare_sector(CONFIG_FLASH_SECTOR, (CONFIG_FLASH_SECTOR + CONFIG_FLASH_SECTOR_SIZE)); if (iap_status != CMD_SUCCESS) while(1);
/* write data to flash */ iap_status = (__e_iap_status) iap_copy_ram_to_flash(&demo_messg, (void *)CONFIG_FLASH_OFFSET, 256); if (iap_status != CMD_SUCCESS) while(1);
while(1); return 0 ; }
Don't forget to modify the stack pointer in your linker file to not use the last 32-bytes of the SRAM (because it's used by the IAP functions).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
由 lpcadmin 于 星期四, 2012-02-16 09:50 发表
|

Developers with accounts on LPCware.com can now contribute their LPC device based projects that might be of interest to other developers. Examples of projects that can be contrinbuted to LPCware.com include:
- Examples, applications, or demos for a specific device or platform
- Invidual driver files or driver libraries
- Enhancements to existing LPC based software libraries
Indivudual files can still be attached to forum or blog posts, but using the project contribution mechanism allows more flexibility and control in maintainence of the project. The original author of the contributed project can edit the project at any time and delete or update files related to the project. Contributed projects can also be search and each has it's own comment thread at the bottom of the project page.
Creation of the contributed project can be done from the main forums page or the resources page. Locate the Contributors menu on the right menu column and select the "Add new project" option.

A new submission page will then appear that allows you to enter the information for your project. Easch field of the project submission page is explained below:
Project title:
Enter the name of your project here. Note that the URL for this page is generated automatically based on your project title, so if you edit the page and change the title in a future update, the URL may also change.
Project categories:
Select one or more related categories for your project. For example, if your project is related to the lpc1850 device and uses the timers, select the lpc18xx and timers categories. Hold down the CTRL key to select multiple categories.
File grouping tag:
Select the one option here that most closely matches your project type. If your project is a software project, select Software.
Project information:
Enter a description of your project here. Try to describe your project as best as possible. If you have documentation in your project files that go into more depth, state that in the information description.
Attached images:
You can aattach up to 3 images for your project that will appear at the bottom of the project's page.
File attachments:
You can attach a file using this box. The submission page will list the acceptable files types and maximum file size.

After you have entered your information in the submission form, click the Save button at the bottom of the page to submit it. Once submitted, the contributed project will immediately be publicly viewable in the contributed project search/view list and in other site content. Note files associated with the project wil not appear in file lists on the resource page.
If you need to edit your project, locate the project in the project search/view list and click on it or directly enter the URL for your project in your browsers URL bar. Near the top of your projuect's page is an edit button. Clicking on this button will allow you to return to the submission view, where you can alter information, images, or files related to your proejct. After editing your project, click save to update your proejct.
|
|
|
|
|
|
|
|
|
|
|
|
|
由 lpcadmin 于 星期一, 2011-11-07 18:06 发表
|

Welcome to the November 2011 edition of the LPCware newsletter!

New USB software for LPC microcontrollers!
nxpUSBlib is a new USB software library designed to run on all LPC microcontrollers. The library includes both host and device stacks, support for many USB classes on each stack, and lots of real world example applications that will accelerate the design of your products.
The library includes pre-built examples for the LPC1769 LPCXpresso board, Hitex LPC1850 Evaluation board, and the Keil MCB1700 evaluation board with the LPCXpresso IDE. Support for the Keil uVision 4 IDE is coming soon!
Visit the nxpUSBlib website to learn how to get started.
LCD expertise contest
There's still time to create and submit your project for LCD contest. Enter by November 30th and you may be the lucky winner of 1 of 3 Nintendo® 3DS play packs! See the contest announcement at http://www.lpcware.com/content/page/put-your-lcd-expertise-display-contest-announcement for rules and the submission form.
Developer submitted projects
The School of Engineering, University of Buenos Aires has submitted a number of projects based on the LPC1341 and LPC1768/69 devices. Projects include home monitoring, audio processing, remote measurement, and more. Each project has a detailed write and includes source code!i can see all the projects here or click on one of the project icons below.
     
Which device are you currently using?
Tell us which device you are currently using in our poll. Read more
Introduction to NXP/Segger emWin Free Graphics Library
Watch our video on the free Segger emWim library for NXP devices! Watch the video here.
lpc177x_8x u-boot released
The 2011.06 version of u-boot has been released for the LPC177x and LPC178x devices. The initial release includes support for the Embedded Artists LPC1788 based board, but should be easily portable to other boards. More information can be found on the LPC177x_8x u-boot project pages. http://www.lpcware.com/content/project/lpc177x8x-u-boot-port
LPC18xx Pin Mux tool
This is the pin muxing tool for the LPC18xx series of devices. It also includes pre-built pin mux configurations for the Hitex 1850 boards. Update 20110905 Fixed pin 115 & 113 configuration on LQFP144 package per datasheet Version 20110830 Initial release
LPC43xx Pin Mux tool
This is the pin muxing tool for the LPC43xx series of devices. Version 20111019 Initial release
LPCWare Bug Tracker
Did you know that LPCware.com has a bug tracker where you can submit an issue and track its status? You can submit issues related to specific devices, peripherals, or software developer and released on this website. You must be a registered user to access the bug tracker. See http://www.lpcware.com/ct_plus/filter.
How to subscribe to posts
If you find something interesting on LPCware.com or want to know when someone comments or responds to one of your posts, use the scubscribe link at the bottom of the page you are viewing to subscribe to any changes related to that page. When someone responds or adds a comment, you'll get an email at your registered email address about the change. You can subscribe to individual posts or or entire forums. You can always unsubscribe later.
|
|
|
|
|
|
|
|
|
|
|
由 nxpUSBlib team 于 星期一, 2011-11-07 17:39 发表
|
nxpUSBlib is a new USB software library designed to run on all LPC microcontrollers. The library includes both host and device stacks, support for many USB classes on each stack, and lots of real world example applications that will accelerate the design of your products.
The library includes pre-built examples for the LPC1769 LPCXpresso board, Hitex LPC1850 Evaluation board, and the Keil MCB1700 evaluation board with the LPCXpresso IDE. Support for the Keil uVision 4 IDE is coming soon!
Visit the nxpUSBlib website to learn how to get started.
|
|
|
|
|
|
|
|
|
|
|
由 lpcadmin 于 星期一, 2011-11-07 10:14 发表
|
If you find something interesting on LPCware.com or want to know when someone comments or responds to one of your posts, use the scubscribe link at the bottom of the page you are viewing to subscribe to any changes related to that page. When someone responds or adds a comment, you'll get an email at your registered email address about the change. You can subscribe to individual posts or or entire forums. You can always unsubscribe later. You cana lso manage your subscriptions by clicking the User (http://www.lpcware.com/user) tab on the tabbed menu bar and selecting the Notifications option.

|
|
|
|
|
|
|
|
|
|
|
由 lpcadmin 于 星期一, 2011-11-07 10:00 发表
|
Did you know that LPCware.com has a bug tracker where you can submit an issue and track it status? You can submit issues related to specific devices, peripherals, or software developer and released on this website. See http://www.lpcware.com/ct_plus/filter. You must be a registered user to access the bug tracker.
|
|
|
|
|
|
|
|
|
|
|
|
|
由 wellsk 于 星期一, 2011-10-24 10:10 发表
|
Here a few informal slides with some basic information on how to get your USB design certified.
|
|
|
|
|
|
|
|
|
|
|
由 wellsk 于 星期四, 2011-09-29 16:43 发表
|
Said to be the first Cortex M0 base MCUs to have LCD display drivers, the LPC11D00 and LPC12D00 series have a two chip package with a full PCF8576D LCD driver. They can drive displays with up to four backplanes and 40 segments, and can be cascaded with multiple segment LCD drivers to accommodate up to 2560 segments.

The 50 MHz devices support a wide LCD supply range from 2.5 to 6.5 V. The 11Dxx has up to 32 Kbytes of flash, while the 12Dxx features up to 128 Kbytes and also adds a CRC engine, DMA, and a real-time clock. Both devices feature a low 130 ua/MHz current requirement and have an 8-channel 10-bit A/D converter with ±1 bit differential and ±3 integral non-linearity maximum over the -40° to 85° operating range. (LPC11D00 from $1.53; LPC12D00 from $2.19 — available now.)
http://www2.electronicproducts.com/Cortex_M0_MCUs_first_to_include_LCD_d...
|
|
|
|
|
|
|
|
|
|
|
由 scott.robertson 于 星期五, 2011-09-16 16:38 发表
|
Blue Water Embedded, Inc. is pleased to offer out-of-the-box solution of the Prism™ GUI Toolkit supported for Embedded Artists LPC1788-32 Developer's Kit. The Prism GUI Toolkit was ported to the Embedded Artists eval kit board with NXP LPC1788 cpu. The integration package includes Prism Core Library, Prism Insight Development Tool, all documentation, and 16 bpp screen driver. Full support included integration files for Keil RTOS, project files and demo code for Keil MDK compiler.
The eval kit includes: NXP's Cortex-M3 LPC1788 microcontroller in BGA package, Program Flash of 128 MB NAND FLASH + 512 kB internal, and Data Memory 32 MB SDRAM + 96 KB internal, 32- or 16-bit data bus to SDRAM.
The Developer's Kit with touch screen capability is designed to be used as an "off-the-shelf" Graphical User Interface (GUI) or Human Machine Interface (HMI) in a variety of end customer applications. The NXP LPC1788 runs at 120MHz and has 512MB of internal flash. For more information about this Developer's kit, see the following weblink:
http://www.embeddedartists.com/products/kits/lpc1788_kit.php
Prism and Prism Micro are a complete GUI software development solution for resource-constrained devices. Prism™ delivers the eye-catching graphical capabilities and time-to-market edge needed for medical, industrial, office automation and consumer markets where user interfaces play an essential role in device design.
The development platform Prism Insight™ and Prism Micro Insight enables you to completely design your user interface in a drag-and-drop WYSIWYG environment. Incorporating TrueType font technology, the Insight Resource Editor defines buttons, menus, and other widgets so developers can customize screen layout as required. With the Animation Designer, developers can specify screen flows and select from a wide range of built-in or customize screen transition effects and animations. Prism Insight™ offers a large range of data output formats such as C++ source code, XML screen description files, and binary resource files, enabling developers to tailor output to the requirements and capabilities of target systems.
Blue Water Embedded offers complete customer support including training sessions guaranteed to reduce the learning curve and slash time out of the device development process.
Availability and Licensing
Prism™ and Prism Micro™ are delivered with full source code, Prism Insight Development Tools, 90 days of technical support and royalty free. For a free evaluation kit, contact sales@bwembedded.com or call (810) 987-3002. Evaluation kits are available, at no charge, for qualified evaluators from http://www.bwembedded.com/download/product_evaluation.php
|
|
|
|
|
|
|
|
|
|
|
由 wellsk 于 星期三, 2011-08-17 10:55 发表
|
The 2011.06 version of u-boot has been released for the LPC177x and LPC178x devices. The initial release includes support for the Embedded Artists LPC1788 based board, but should be easily portable to other boards.
More information can be found on the LPC177x_8x u-boot project pages.
http://www.lpcware.com/content/project/lpc177x8x-u-boot-port
|
|
|
|
|
|
|
|
|
|
|
由 Daniel Widyanto 于 星期二, 2011-08-16 21:17 发表
|

The LPC11xx IAP provides function to call the ISP in the BootROM from user code. Here's an example of how to use it. The code is based on UART example for LPC1114 (for LPCXpresso)
The first thing is that, if you have LPC11xx UART enabled, you need to disable it, including the interrupts
static void StopUART(void) { uint32_t temp;
/* Disable UART interrupts */ LPC_UART->IER = 0; /* Disable UART interrupts in NVIC */ NVIC_DisableIRQ(UART_IRQn);
/* Ensure a clean start, no data in either TX or RX FIFO. */ while (( LPC_UART->LSR & (LSR_THRE|LSR_TEMT)) != (LSR_THRE|LSR_TEMT) ); while ( LPC_UART->LSR & LSR_RDR ) { temp = LPC_UART->RBR; /* Dump data from RX FIFO */ }
/* Read to clear the line status. */ temp = LPC_UART->LSR; }
Then, turn on Timer32B1, GPIO and IOCON block in the SYSAHBCLKCTRL, set the stack pointer to the BootROM's requirement, and execute the IAP command 57.
typedef void (*IAP)(unsigned int[], unsigned int[]);
static void ReinvokeISP(void) { IAP iap_entry = (IAP) 0x1fff1ff1; uint32_t command[5], result[4];
/* make sure 32-bit Timer 1 is turned on before calling ISP */ LPC_SYSCON->SYSAHBCLKCTRL |= 0x00400; /* make sure GPIO clock is turned on before calling ISP */ LPC_SYSCON->SYSAHBCLKCTRL |= 0x00040; /* make sure IO configuration clock is turned on before calling ISP */ LPC_SYSCON->SYSAHBCLKCTRL |= 0x10000; /* make sure AHB clock divider is 1:1 */ LPC_SYSCON->SYSAHBCLKDIV = 1;
/* Send Reinvoke ISP command to ISP entry point*/ command[0] = 57;
/* Set stack pointer to ROM value (reset default). This must be the last piece of code executed before calling ISP, because most C expressions and function returns will fail after the stack pointer is changed. */ __set_MSP(*((uint32_t *) 0x1FFF0000)); /* inline asm */
/* Invoke ISP. We call "iap_entry" to invoke ISP because the ISP entry is done through the same command interface as IAP. */ iap_entry(command, result);
// Code will never return! }
Lastly, before you can run your new code (assuming you are upgrading / replacing the firmware using ISP), you will need to reset the MCU.
Take a look at the LPCXpresso project file that I've attached to this post, and send me your comments =)
|
|
|
|
|
|
|
|
|
|
|
由 drs 于 星期五, 2011-08-12 15:00 发表
|
The errata ES_LPC177x/8x (http://www.lpcware.com/content/nxpfile/errata-sheet-eslpc177x8x) describes a problem that exists in some parts with a USB host controller block where the host controller can hang in some (rare) cases where a dribble bit is seen on the bus. The only way to recover from this hang is to reset the USB host controller.
This is a list of parts that are affected by this problem:
LPC2361,62,87,88
LPC24xx
LPC1754,56,58,59
LPC1765,66,68,69
LPC1776,77,78
LPC178x
LPC32x0
So to address this problem you must first detect the hang, then reset the block.
Detecting the hang:
The best way to detect this condition is to enable the SOF interrupt in the host controller (SF bit (bit 2) and the MIE bit (bit 31) of the HcInterruptEnable register) and look for inactivity in the associated ISR.
Resetting the block:
Only the LPC177x/8x parts have the ability to reset the USB host controller individually. In this case, refresh a count down timer in the SOF ISR and reset the block in the timer's ISR.
All other parts that this errata apply to require the entire chip to be reset. In this case, refresh the watchdog timer directly in the SOF ISR.
|
|
|
|
|
|
|
|
|
|
|
由 usb10185 于 星期四, 2011-08-11 11:21 发表
|
Recently NXP changed revision of the LPC2300/2400 families from Rev B to Rev D. This main implication of this change are summarized in the ES for the parts:
“On the LPC23XX/LPC24XX Rev D, design changes to the Memory Accelerator Module were made to enhance timing and general performance. Design changes are intended to enhance performance in general and will result in minor differences in the code execution timing between the previous device revisions and rev D. Actual performance impact is code dependent, some code sequences may speed up while other code sequences may slow down between the previous device revisions and rev D. This might be observed when using software delays and in such cases, a hardware timer should be used to generate a delay instead of a software delay.”
One other side effect that has been noticed by some customers is related to Ethernet operation in RMII mode when using the National Semiconductor DP83848 PHY.
In all cases it appears that the issue is related to the incorrect Ethernet PHY connection to the LPC device. The National Semiconductor Application note “AN-1405 - PHY in RMII mode” clearly states in Table 2:
"The 25MHz_OUT signal is a delayed version of the X1/REF_CLK input. While this clock may be used for other purposes, it should not be used as the timing reference for RMII control and data signals."
In summary, the 25MHz_OUT should not be used for LPC device ENET_REF_CLK signal.
The error in schematics may be attributed to a third party design that has since been fixed but some users have the incorrect design and thus in some cases using the Rev D with the DP83848 PHY, Ethernet does not work reliably.
|
|
|
|
|
|
|
|
|
|
|
由 usb10185 于 星期五, 2011-07-01 06:59 发表
|
For the LPC1788 parts, please update the JLINK driver to ensure that the Bootloader executes when in debug session. The JLINK supports the 'halt after bootloader' feature.
Just got this from Segger:
We have built a patched release version of the J-Link software (V4.28c) in which the halt after bootloader reset strategy has been corrected.
The new version is available for download on our website: http://www.segger.com/download_jlink.html
|
|
|
|
|
|
|
|
|
|
|
由 nlv11817 于 星期五, 2011-07-01 06:35 发表
|
These designs are low cost demo, evaluation and test boards for NXP microcontrollers. They can be used as a reference design, for testing and for validating early prototypes of LPC11xx and LPC13xx devices. The boards allow easy access to all pins, peripherals and functions of the microcontroller. Published are user manual, schematics, bill of materials and a number of code examples at project page: http://www.lpcware.com/content/project/nxp-microcore4864-evaluation-board
|
|
|
|
|
|