顯示具有 iar 標籤的文章。 顯示所有文章
顯示具有 iar 標籤的文章。 顯示所有文章

2013年1月7日 星期一

[ZigBee][CC2530] [Z-Stack][IAR] Generating Hex File Using Z-Stack for Release

    TI does provide comprehensive documents regarding its products, compared to many other chip vendors. However, too many documents without directory lead us lost ourselves.

    In Z-Stack Samples, we generate .d51 file under "EXE" directory by default. To generate hex file for mass production, I found there is useful introduction at How to configure the IAR EW 8051 to generate a hex file for CC2530 using Z-Stack? (plus link for CC2430/CC2431)



Step 1: Open the Z-stack workspace with IAR and locate the linker file f8w2530.xcl.
The f8w2530.xcl file can be found in the Tools file group in IAR.


  • To avoid change this file back and forth for debug and release, I copied it to the project folder and added to my release configuration (IAR->Project Option->Linker->Config Tab->Linker Configuration File, override default to the new .xcl)
  • at Output Tab of Linker, Click the “Override default” option in the “Output file” box and rename the xxx.a51 to xxx.hex 





Step 2: Include the linker file –M option by including the 3 lines as shown in the figure below.
// Include these two lines when generating a .hex file for banked code model:
-M(CODE)[(_CODEBANK_START+_FIRST_BANK_ADDR)-(_CODEBANK_END+_FIRST_BANK_ADDR)]*\
_NR_OF_BANKS+_FIRST_BANK_ADDR=0x8000

For the rest steps you may follow "How to configure the IAR EW 8051 to generate a hex file for CC2530 using Z-Stack? (plus link for CC2430/CC2431)"


I was using


IAR Assembler for 8051
  8.10.3 (8.10.3.40338)

ZStack-2.5.1a

2012年12月3日 星期一

[Zigbee][CC2531] make USB firmware with IAR

In order to change CC2531 USB dongle to USB CDC device, I downloaded swrc088c.zip (The Texas Instruments LPRF USB Firmware Library (Rev. B) ) and tried to make a CDC firmware of it.

the first problem I met is that the IAR project file (\ide\rfusb_cc2531\iar\rf_modem.eww) was made by  older IAR version so my IAR (8.10.3) asked me to convert it to this version. After doing so, the make operation still didn't go through because of [ Error[e12]: Unable to open file 'lnk51ew_cc2531b.xcl' ].

After quick searching at e2e, the thread IAR 7.6 linker error did provide solution of it.


-Right click on the top level project file in the 'Workspace' window
-Select 'Options'
-From the 'Category' box on the left, select 'Linker'
-Select the 'Config' tab
-In the 'Linker command file' box, make sure 'Override defaults' is checked
-Choose the proper linker file


in my case, the file is IAR Systems\Embedded Workbench 6.0\8051\config\devices\Texas Instruments\lnk51ew_cc2531F256.xcl

After reboot the dongle and installing the device driver (swrc088c\driver\usb_cdc_driver_cc2511.inf), the CC2531 CDC was successfully running.