Friday 5 July 2013

uVision v4.71.2.0 learning notes



















uVision 4 Release Notes 

file:///C:/Keil/UV4/Release_Notes.htm

What's New in µVision4?

µVision4 is an IDE (Integrated Development Environment) that helps you write, compile, and debug embedded programs. It encapsulates the following components:

Multiple Monitor - flexible window management system.

System Viewer - display device peripheral register information.

Debug Views - create and save multiple debug window layouts.

Multi-Project Workspace - simplify working with numerous projects.

Source and Disassembly Linking - the Disassembly Window and Source Windows are fully synchronized making program debugging and cursor navigation easier.

Memory Window Freeze - store the current Memory Window view allowing easy comparison of memory contents at different points in time.

Device Simulation has been updated to support many new devices such as Infineon XC88x, SiLABS C8051Fxx, Atmel SAM7/9, and Cortex-M3 MCUs from Luminary, NXP, and Toshiba.

Support for Hardware debug adapters added including ADI miDAS-Link, Atmel SAM-ICE, Infineon DAS, and ST-Link.

New Data and Instruction Trace capabilities for ARM and Cortex MCUs.

XML based Project Files - create, view and modify projects as easily readable XML text files.

Serial Window - extended to provide a basic VT-100 terminal, ASCII Mode, Mixed Mode, and Hex Mode views.

Watchpoints and Logic Analyzer variables are now easier to set.


Building an Application in µVision4

To build (compile, assemble, and link) an application in µVision4, you must:

Select Project - Open Project.

If loading a µVision3 project, change the file filter in the Select Project File dialog to Previous
Project Files (*.uv2; *.uv3; *.mpw).

Select the project to load (for example, \ARM\EXAMPLES\MEASURE\MEASURE.UVPROJ).

Select Project - Rebuild all target files or Build target.

µVision4 compiles, assembles, and links the files in your project.


Debugging an Application in µVision4

To debug an application created using µVision4, you must:

Select Debug - Start/Stop Debug Session.

Use the Step toolbar buttons to single-step through your program. You may enter G, main in the Output Window to execute to the main C function.

Open the UART #2 Window using the Serial Windows - UART #2 button on the toolbar.

Debug your program using standard options like Step, Go, Break, and so on.

Creating Your Own Application in µVision4

To create a new project in µVision4, you must:

Select Project - New Project.

Select a directory and enter the name of the project file.

Select Project - Select Device and select an ARM, 8051, 251, or C16x/ST10 device from the Device Database™.

Create source files to add to the project.

Select Project - Targets, Groups, Files. Add/Files, select Source Group1, and add the source files to the project.

Select Project - Options and set the tool options. Note when you select the target device from the Device Database™ all special options are set automatically. You typically only need to configure the memory map of your target hardware. Default memory model settings are optimal for most applications.

Select Project - Rebuild all target files or Build target.

.END




Tutorial: Flashing the LPC1114 with FlashMagic - microBuilder.eu

http://www.microbuilder.eu/Projects/LPC1114ReferenceDesign/FlashMagic.aspx

Deployed your compiled code to the LPC1114 with the freely available FlashMagic tool

Unlike the LPC1343, the LPC1114 doesn't have a convenient USB bootloader (which isn't surprising, since it also doesn't have USB).  While you can easily flash the device using a dedicated HW debugger like the Segger J-Link for ARM or one of the many HW debuggers supported by Crossworks for ARM (if you're using Crossworks), if you don't have access to a HW debugger you can still program the device with FlashMagic, a free software utility sponsored by NXP.  FlashMagic can also be used to 'debrick' your device if you have written something to the firmware that prevents you from connecting over SWD (for example, going directly into deep-sleep mode after bootup).

FlashMagic works with the ISP bootloader built into almost every LPC device from NXP, and allows you to update the flash contents on your MCU via a simple UART connection.  In the case of the LPC1114 Reference Board, you simply need to set the ISP jumper, reset the device, and you should automatically enter ISP mode.

The only HW required for this is an inexpensive UART converter with 3.3V logic, such as the FT232R Breakout Board ....  Using the FT232R Breakout Board as an example, you simply need to connect the LPC1114 to the breakout board as follows:

Connecting the FT232RL to the LPC1114 Reference Board

FT232R Breakout Board LPC1114

GND GND

TXD RXD

RXD TXD

Note on UART Settings: If you are not sure what the baud rate and COM port are for your USB to UART converter, you can go into the Windows Device Manager, and look at the Properties window for the device, which should be in the Ports (COM & LPT) sections. The appropriate information can be found and modified in the 'Port Settings' tab. We'd suggest setting the bis per second to at least 57600, since it will default to a relatively slow 9600.

Step One: Enter ISP mode

Connect the UART adapter to the LPC1114 as shown in the table above.

Set the ISP jumper to the on possition.

Reset the board by pressing and releasing the RESET button.

Step Two: Configure FlashMagic

Start FlashMagic if you haven't already done so.

Click on the 'Select Device...' button and select the appropriate device from the popup window. In the case of the LPC1114 Reference Board, this would be the LPC1114/301:

Set the Baud Rate, COM Port and Oscillator Frequency (12.0 in the case of the LPC1114 Reference Board).

Check the Erase blocks used by Hex file checkbox

Located the firmare.hex file created when you built your project with the Browse... button. This is the compiled code that will be written to the flash device.

Check the Verify after programming button

The final setting should look similar to this:

Confirming the UART connection: You can check the UART connection and make sure that you are indeed in ISP mode by selecting the 'ISP > Read Device Signature...' menu item. If everything is properly configured, and the device is in ISP mode you should something similar to this screen.

Step Three: Flash the Device

To flash the device with the supplied firmware, you simply need to click the Start button. Once the flashing process is complete, you can put the ISP jumper back to it's off position, reset the LPC1114, and your new firmware should start executing.  You can use this precompiled .hex file for the LPC1114 Reference Board as a test, which will cause the LED on pin 3.5 to blink on and off every 3 seconds.

If you have any problems, you probably haven't entered ISP mode on the board (set the ISP jumper to the appropriate position and reset the device), or your UART port isn't properly configured. Double check your settings in the Windows Device Manager and in FlashMagic, make sure you have properly set the ISP jumper on the LPC1114 Reference Board and try again.  If you are using the FT232R Breakout Board available in our online store, you may want to make sure you have the latest FTDI drivers installed as well.

.END

No comments:

Post a Comment