mirror of
https://github.com/Koenkk/Z-Stack-firmware.git
synced 2024-11-09 03:49:51 +01:00
1.8 KiB
1.8 KiB
Compiling the firmware
Setup development environment
- Download and install Z-STACK-HOME 1.2.2a.
- Download and install IAR Embedded Workbench for 8051.
NOTE: For IAR Embedded Workbench for 8051 you need either the full (paid) version or the 30-days evaluation version.
Compiling
- Copy
firmware.patch
toZ-Stack Home 1.2.2a.44539
- Open Git Bash, go to
Z-Stack Home 1.2.2a.44539
and apply the patch usinggit apply firmware.patch
. - Open
Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\znp.eww
with IAR Embedded workbench for 8051. - You will get a warning: The project file 'CC253(0/1).ewp' is in an old format. Would you like to convert it for use with this version?. Press yes for both.
- Select the correct target:
- For CC2531 select CC2531 - X
- For CC2530 or CC2530_CC2591 select CC2530 - X
- Depending if you want to compile the
.hex
or SBL firmware select - ProdHex or - ProdSBL
- Right-click on your target and press options. Go to C/C++ compiler -> preprocessor. Depending on what you want to compile, add the following symbols to Defined symbols:
- Device type:
FIRMWARE_CC2530
,FIRMWARE_CC2530_CC2531
orFIRMWARE_CC2531
. - Firmware type:
FIRMWARE_DEFAULT
,FIRMWARE_MAX_STABILITY
orFIRMWARE_MAX_DEVICES
. - In case you want to compile the SBL firmware, also add
FIRMWARE_SBL
.
To compile e.g the default CC2531 firmware, use:
FIRMWARE_CC2531
FIRMWARE_DEFAULT
NOTE: FIRMWARE_MAX_DEVICES
is only available in combination with FIRMWARE_CC2531
.
- Press OK.
- Right-click on your target and click Rebuild all.
- Once finished, you can find the
CC253(0|1)ZNP-Prod.(hex|bin)
file inZ-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\dev
.