@@ -70,7 +70,7 @@ std::vector<DeviceInfo> DeviceBootloader::getAllAvailableDevices() {
7070std::vector<uint8_t > DeviceBootloader::createDepthaiApplicationPackage (const Pipeline& pipeline,
7171 const dai::Path& pathToCmd,
7272 bool compress,
73- std::string applicationName) {
73+ std::string applicationName, bool checkChecksum ) {
7474 // Serialize the pipeline
7575 PipelineSchema schema;
7676 Assets assets;
@@ -158,8 +158,13 @@ std::vector<uint8_t> DeviceBootloader::createDepthaiApplicationPackage(const Pip
158158 sbr_section_set_size (fwSection, static_cast <uint32_t >(deviceFirmware.size ()));
159159 sbr_section_set_checksum (fwSection, sbr_compute_checksum (deviceFirmware.data (), static_cast <uint32_t >(deviceFirmware.size ())));
160160 sbr_section_set_offset (fwSection, SBR_RAW_SIZE);
161- // Ignore checksum to allow faster booting (images are verified after flashing, low risk)
162- sbr_section_set_ignore_checksum (fwSection, true );
161+ if (checkChecksum) {
162+ // Don't ignore checksum, use it when booting
163+ sbr_section_set_ignore_checksum (fwSection, false );
164+ } else {
165+ // Ignore checksum to allow faster booting (images are verified after flashing, low risk)
166+ sbr_section_set_ignore_checksum (fwSection, true );
167+ }
163168 // Set compression flags
164169 if (compress) {
165170 sbr_section_set_compression (fwSection, SBR_COMPRESSION_ZLIB);
@@ -226,19 +231,19 @@ std::vector<uint8_t> DeviceBootloader::createDepthaiApplicationPackage(const Pip
226231 return fwPackage;
227232}
228233
229- std::vector<uint8_t > DeviceBootloader::createDepthaiApplicationPackage (const Pipeline& pipeline, bool compress, std::string applicationName) {
230- return createDepthaiApplicationPackage (pipeline, " " , compress, applicationName);
234+ std::vector<uint8_t > DeviceBootloader::createDepthaiApplicationPackage (const Pipeline& pipeline, bool compress, std::string applicationName, bool checkChecksum ) {
235+ return createDepthaiApplicationPackage (pipeline, " " , compress, applicationName, checkChecksum );
231236}
232237
233238void DeviceBootloader::saveDepthaiApplicationPackage (
234- const dai::Path& path, const Pipeline& pipeline, const dai::Path& pathToCmd, bool compress, std::string applicationName) {
235- auto dap = createDepthaiApplicationPackage (pipeline, pathToCmd, compress, applicationName);
239+ const dai::Path& path, const Pipeline& pipeline, const dai::Path& pathToCmd, bool compress, std::string applicationName, bool checkChecksum ) {
240+ auto dap = createDepthaiApplicationPackage (pipeline, pathToCmd, compress, applicationName, checkChecksum );
236241 std::ofstream outfile (path, std::ios::binary);
237242 outfile.write (reinterpret_cast <const char *>(dap.data ()), dap.size ());
238243}
239244
240- void DeviceBootloader::saveDepthaiApplicationPackage (const dai::Path& path, const Pipeline& pipeline, bool compress, std::string applicationName) {
241- auto dap = createDepthaiApplicationPackage (pipeline, compress, applicationName);
245+ void DeviceBootloader::saveDepthaiApplicationPackage (const dai::Path& path, const Pipeline& pipeline, bool compress, std::string applicationName, bool checkChecksum ) {
246+ auto dap = createDepthaiApplicationPackage (pipeline, compress, applicationName, checkChecksum );
242247 std::ofstream outfile (path, std::ios::binary);
243248 outfile.write (reinterpret_cast <const char *>(dap.data ()), dap.size ());
244249}
@@ -560,12 +565,12 @@ bool DeviceBootloader::isAllowedFlashingBootloader() const {
560565}
561566
562567std::tuple<bool , std::string> DeviceBootloader::flash (
563- std::function<void (float )> progressCb, const Pipeline& pipeline, bool compress, std::string applicationName, Memory memory) {
564- return flashDepthaiApplicationPackage (progressCb, createDepthaiApplicationPackage (pipeline, compress, applicationName), memory);
568+ std::function<void (float )> progressCb, const Pipeline& pipeline, bool compress, std::string applicationName, Memory memory, bool checkCheksum ) {
569+ return flashDepthaiApplicationPackage (progressCb, createDepthaiApplicationPackage (pipeline, compress, applicationName, checkCheksum ), memory);
565570}
566571
567- std::tuple<bool , std::string> DeviceBootloader::flash (const Pipeline& pipeline, bool compress, std::string applicationName, Memory memory) {
568- return flashDepthaiApplicationPackage (createDepthaiApplicationPackage (pipeline, compress, applicationName), memory);
572+ std::tuple<bool , std::string> DeviceBootloader::flash (const Pipeline& pipeline, bool compress, std::string applicationName, Memory memory, bool checkCheksum ) {
573+ return flashDepthaiApplicationPackage (createDepthaiApplicationPackage (pipeline, compress, applicationName, checkCheksum ), memory);
569574}
570575
571576DeviceBootloader::ApplicationInfo DeviceBootloader::readApplicationInfo (Memory mem) {
0 commit comments