How to setup MDK-ARM project to flash/debug mbed SDK test code
.
This is quick instruction how to setup/configure Keil MDK-ARM project file flash and debug mbed SDK test code.
Create a project
- Launch MDK-ARM
- Create new project form menu [Project] - [New uVision Project...] with any project name
Note: I recommend not to create a project in mbed GitHub local directly to avoid sync problem
- Select your target device. e.g. [NXP] - [LPC1114/102]
- Do not copy startup code (press 'NO' in the dialog below)
Configure settings
- Open project setting from menu [Project] - [Options for Target 'Target 1'...]
- Click 'Output' tab
- Press 'Select Folder for Objects...' button and select your ELF file of mbed test case.
e.g. C:\Users\toywat01\Documents\GitHub_mbed\build\test\LPC1114\ARM\MBED_11 - Changed ELF file name in 'Name of Executable:' text field.
e.g. ticker.elf
- Click 'Debug' tab
- Select your debug adapter on the right hand side of the setting panel
e.g. Press 'Use:' radio button and select 'ULINK2/ME Cortex Debugger'
- Press 'Settings' button
- Check 'Download to Flash'
- Press 'OK' to close the dialog
- Press 'Utilities' tab
- Uncheck 'Use Debug Driver'
- Press 'Settings' button
- Check 'Reset and Run'
- Press 'OK' to closed the dialog
Flash your test code
- Download and flash your test code from menu [Flash] - [Download]
- You will see a result of flash programming in build output window
Debug your test code
- Start debug session from menu [Debug] - [Start/Stop Debug Session]
- From command window, enter "bs main" to set breakpoint at main() function.
- Press 'Run' button in toolbar and your test code stops at main() function.
- You can open peripheral register windows from menu [Peripherals], if your target has CMSIS-SVD file. This is very useful feature for mbed SDK debugging.
Please log in to post comments.