Windaq Add-ons
|
|
- First download and install LM
Flash Programmer from http://www.ti.com/tool/lmflashprogrammer
- Download the Stellaris
Firmware Upgrade USB driver from http://www.ti.com/lsds/ti/microcontrollers_16-bit_32-bit/c2000_performance/control_automation/tm4c12x/tools_software.page#uti
- Add the following line to
Project->Properties->C/C++ Build->Settings-> Build Steps
->Post-Build Steps to generate .bin file (make sure the project
name is not too long or it may have trouble generating the .bin file
without error warning)
- "${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin"
"${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin"
"${CG_TOOL_ROOT}/bin/armofd" "${CG_TOOL_ROOT}/bin/armhex"
"${CCE_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin"
- Unless TiVaWare has newer version than 2.1.1.71 to
build your DFU, you need to create your own DFU in the following steps
- Start with TiVaWare
2.1.1.71 or later, or you will run into many Bus Fault
- Import boot_usb from
DK_TM4C123G
- Overwrite the
bl_config.h in the project with the one in this folder
- Replace line 506 with
the following: while((HWREG(SYSCTL_RCGCGPIO) & (USB_DP_PERIPH |
USB_DM_PERIPH)) !=
(USB_DP_PERIPH | USB_DM_PERIPH));
- In boot_usb project,
replaced the defines referring to TM4C123 in
project->properties->CCS Build->ARM Compiler->Advanced
Options->Predefined Symbols with PART_TM4C1294NCPDT and
TARGET_IS_TM4C129_RA2
- To match the pushbutton
on our DI-2x08, enable the following definition in bl_config.h
- #define
ENABLE_UPDATE_CHECK
- #define
FORCED_UPDATE_PERIPH SYSCTL_RCGC2_GPIOG
- #define
FORCED_UPDATE_PORT GPIO_PORTG_BASE
- #define
FORCED_UPDATE_PIN 0
- #define
FORCED_UPDATE_POLARITY 0
- #define
FORCED_UPDATE_WPU
- With the above
configuration, if we push the button, which is shorting G0 to
ground, during power-up, USB DFU will be invoked
- Watch out, we should
NOT multiplex G0 for wired event input, or it may force USB DFU to
come up during deployment if the event level is low.
- Modify the VIP and PID
in bl_config.h, in our design
- #define USB_VENDOR_ID
to your own VID
- #define USB_PRODUCT_ID
to your own PID
- Modify
g_pui8ManufacturerString[] to reflect company name
- Modify
g_pui8ProductStringo[] to reflect device name
- Build the project
- Flash
it to the device, this is the USB DFU
- If
this is brand new device, you can use either CCS or LM Flash
Programmer to flash in USB DFU
- If
this is an used micro, you may need to CCS to flash in USB
DFU
- Prepare the USB drivers for
USB_DFU
- Modify boot_usb.inf to use
the new PID/VID
- Modify boot_usb.inf to
assign new ProviderName, etc in the [Strings] section
- Sign boot_usb.inf
- Consider to include the
driver and LM Flash programmer in our installation
- When your project is ready to
release
- Modify project_ccs.cmd
to change the link script
- Add #define APP_BASE
0x00004000 to project_ccs.cmd
- Replace
MEMORY
{
FLASH (RX) : origin = 0x00000000, length =
0x000100000
SRAM (RWX) : origin = 0x20000000, length =
0x00040000
}
with
MEMORY
{
FLASH (RX) : origin =
APP_BASE, length = 0x000FC000
SRAM (RWX) : origin = 0x20000000, length =
0x00040000
}
- Replace
SECTIONS
{
.intvecs: > 0x00000000
}
with
SECTIONS
{
.intvecs: > APP_BASE
}
- Build the project to
generate .bin file
- This .bin file has no
info regarding the memory location of the firmware regardless
what the link script specifies. It is purely the binary image of
the firmware. It is the responsibility of the FlashProgramer to
place it in the appropriate memory location
- Once DFU is
activated, when LMFlashProgrammer is started, it will query DFU
and find out the starting address, and it will NOT allow any
other address to be entered to the starting offset to protect
the DFU, as long as we don't define ENABLE_BL_UPDATE when
creating the DFU
- DFU is smart enough
to protect itself and the users don't need to worry about "
If there is a Flash based boot loader then 0x0 cannot be used as
it will try to overwrite the Flash boot loader”
- Revert the
modification in 2 and 3 for future CCS IDE debugging
- To program the firmware
on top of USB DFU (during calibration or DFU)
- Make sure the device
is programmed with USB DFU in 2.8
- Push the button (G0)
when powering it up via USB
- Now the device will
show up in the device manager as Stellaris Device Firmware Upgrade
- Run LM Flash
Programmer
- Select Manual
Configuration and USB DFU in Configuration pane
- In Program pane,
select the .bin file generated in 6.1.4
- Program Address offset
would be set up properly by the firmware, don’t change it
- Select Erase Necessary
Pages instead of Erase Entire Flash
- Flash the firmware to
the micro
- To restore the micro to
factory default USB DFU, follow CCW->Debug->FlashMemory->Erase
All
|