Skip to content

Commit

Permalink
Fix linux build error and add support for custom loader in kdimg.
Browse files Browse the repository at this point in the history
  • Loading branch information
kendryte747 committed Jan 7, 2025
1 parent 7c3e15c commit d39b496
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
10 changes: 10 additions & 0 deletions src/kburn/cli/k230_flash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,16 @@ int main(int argc, char **argv) {
}

file_offset_max = get_kdimage_max_offset();

for (auto it = kdimg_items->begin(); it != kdimg_items->end(); ++it) {
const struct KburnImageItem_t item = *it;

if(item.partName == std::string("loader")) {
custom_loader = true;
loader_file = item.fileName;
load_address = 0x80360000;
}
}
} else {
struct KburnImageItem_t item;

Expand Down
8 changes: 4 additions & 4 deletions src/kburn/include/kdimage.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#pragma once

#include "kburn.h"
#include <string>
#include <vector>

#include <algorithm>
#include <filesystem>
#include <fstream>

#include <iomanip>
#include <string>
#include <vector>
#include <stdexcept>
#include <vector>

#include "picosha2.h"

Expand Down
2 changes: 1 addition & 1 deletion src/kburn/kdimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ void KburnKdImage::get_parts_from_temp(void) {
std::string partName = filename.substr(0, offsetPos);
std::string offsetStr = filename.substr(offsetPos + 1); // Skip "_"
uint64_t partOffset = std::stoull(offsetStr, nullptr, 16); // Convert hex string to uint64_t

spdlog::debug("filename {}, partName {}, partOffset {}({})", filename, partName, partOffset, offsetStr);

// Read the corresponding .sha256 file
Expand Down

0 comments on commit d39b496

Please sign in to comment.