Skip to content

Commit

Permalink
[Telink] Fix issue with enabled Factory Data only
Browse files Browse the repository at this point in the history
  • Loading branch information
s07641069 committed Sep 30, 2024
1 parent cb7c3a0 commit 6b2affc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/tools/telink/process_binaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def merge_binaries(input_file1, input_file2, output_file, offset):
# Obtain build configuration
build_conf = BuildConfiguration(os.path.join(os.getcwd(), os.pardir))

# Clean up merged.bin from previuse build
# Clean up merged.bin from previous build
if os.path.exists('merged.bin'):
os.remove('merged.bin')

Expand Down Expand Up @@ -97,7 +97,11 @@ def merge_binaries(input_file1, input_file2, output_file, offset):

# Merge Factory Data binary if configured
if build_conf.getboolean('CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE'):
merge_binaries('merged.bin', 'factory/factory_data.bin', 'merged.bin', build_conf['CONFIG_TELINK_FACTORY_DATA_PARTITION_ADDR'])
if os.path.exists('merged.bin'):
merge_binaries('merged.bin', 'factory/factory_data.bin', 'merged.bin', build_conf['CONFIG_TELINK_FACTORY_DATA_PARTITION_ADDR'])
else:
# Initialize merged.bin with zephyr.bin since no base binary was created
merge_binaries('zephyr.bin', 'factory/factory_data.bin', 'merged.bin', build_conf['CONFIG_TELINK_FACTORY_DATA_PARTITION_ADDR'])

# Check if merged.bin was created by any enabled feature, otherwise symlink zephyr.bin
if not os.path.exists('merged.bin'):
Expand Down

0 comments on commit 6b2affc

Please sign in to comment.