Skip to content

Commit

Permalink
sdk: fix mkflash tools
Browse files Browse the repository at this point in the history
  • Loading branch information
redchenjs committed May 23, 2023
1 parent ef804fb commit 0b962f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions sdk/projects/apps/wujian100_open-tools/mkflash.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include <string.h>
#include <sys/stat.h>

#define FIRMWARE_SIZE_APP_0_MAX (64 * 1024)
#define FIRMWARE_SIZE_APP_1_MAX (64 * 1024)
#define FIRMWARE_SIZE_APP_0_PADDING (0x00100000)
#define FIRMWARE_SIZE_APP_1_PADDING (0x00100000)

int main(int argc, char *argv[])
{
Expand Down Expand Up @@ -75,7 +75,7 @@ int main(int argc, char *argv[])
data_buf = NULL;

// firmware 0 padding
size = FIRMWARE_SIZE_APP_0_MAX - st.st_size - 4 - 256;
size = FIRMWARE_SIZE_APP_0_PADDING - st.st_size - 4 - 256;
data_buf = calloc(1, size);
fwrite(data_buf, 1, size, fd_outfile);
free(data_buf);
Expand Down Expand Up @@ -106,7 +106,7 @@ int main(int argc, char *argv[])
data_buf = NULL;

// firmware 1 padding
size = FIRMWARE_SIZE_APP_1_MAX - st.st_size - 4 - 256;
size = FIRMWARE_SIZE_APP_1_PADDING - st.st_size - 4 - 256;
data_buf = calloc(1, size);
fwrite(data_buf, 1, size, fd_outfile);
free(data_buf);
Expand Down
2 changes: 1 addition & 1 deletion sdk/projects/apps/wujian100_open-tools/mkfw
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
./rsa_sign ../wujian100_open-app0/CDK/Obj/wujian100_open-app0_0x10000000.bin
./rsa_sign ../wujian100_open-app1/CDK/Obj/wujian100_open-app1_0x20000000.bin

./mkflash ../../../../flash.bin \
./mkflash flash.bin \
../wujian100_open-app0/CDK/Obj/wujian100_open-app0_0x10000000.bin \
../wujian100_open-app0/CDK/Obj/wujian100_open-app0_0x10000000.bin.sig \
../wujian100_open-app1/CDK/Obj/wujian100_open-app1_0x20000000.bin \
Expand Down

0 comments on commit 0b962f1

Please sign in to comment.