def main(): softdevices = load_softdevies( os.path.join(os.path.dirname(os.path.abspath(__file__)), "../configuration/softdevices.json")) platforms = load_platforms( os.path.join(os.path.dirname(os.path.abspath(__file__)), "../configuration/platforms.json")) sd_str = '' for sd in softdevices: sd_str += ''.join(sd["name"]) + "\n" plt_str = '' for plt in platforms: plt_str += ''.join(plt["name"]) + '\n' SOFTDEVICE = "s132_7.2.0" DEVICE = "nrf52832_xxAA" parser = argparse.ArgumentParser(description="Device Page Generator") parser.add_argument("-d", "--device", help="Select device: " + ''.join(plt_str), default=DEVICE) parser.add_argument("-sd", "--softdevice", help="Select SoftDevice: " + ''.join(sd_str), default=SOFTDEVICE) parser.add_argument("-c", "--bootloader-config", default=os.path.join( os.path.dirname(os.path.abspath(__file__)), "bootloader_config_default.json"), help="Bootloader configuration file") parser.add_argument( "-o", "--output-file", help="Output hex file (default: bin/device_page_%s_%s.hex)." % ("<DEVICE>", "<SOFTDEVICE>"), default=False) parser.add_argument("--all", default=False, action="store_true", help=("Writes all known device page combinations to " + "\'bin/\'")) args = parser.parse_args() if not args.output_file: args.output_file = "bin/device_page_%s_%s.hex" % (args.device, args.softdevice) dirname = os.path.dirname(args.output_file) if not os.path.exists(dirname): os.mkdir(dirname) if args.all: write_all(platforms, softdevices, args) print("Wrote for device pages for all devices.") elif args.softdevice and args.device: write_specific_page(platforms, softdevices, args) print("Wrote device page for %s with the %s SoftDevice to %s." % (args.device, args.softdevice, args.output_file))
def main(): softdevices = load_softdevies("tools/configuration/softdevices.json") platforms = load_platforms("tools/configuration/platforms.json") # No support for nrf52810 yet. platforms = [p for p in platforms if "nrf52810" not in p["name"].lower()] make_bootloader_for_platforms(platforms) set_softdevices_for_platforms(platforms, softdevices) timestamp = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') write_bootloader_linker_files(platforms, timestamp, "mesh/bootloader/linker") write_app_linker_files(platforms, softdevices, timestamp, [ "examples/beaconing/linker", "examples/dfu/linker", "examples/light_switch/client/linker", "examples/light_switch/server/linker", "examples/pb_remote/client/linker", "examples/pb_remote/server/linker", "examples/serial/linker" ])