Skip to content

Commit

Permalink
[image_gen] add warning: image is not a mult. of 4
Browse files Browse the repository at this point in the history
  • Loading branch information
stnolting committed Oct 3, 2024
1 parent 1f7bc8a commit 36717c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sw/common/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ target bootloader | bl_image: CC_OPTS += -Wl,--defsym=MAKE_BOOTLOADER=1 -DMAKE_B
# -----------------------------------------------------------------------------
# Compile image generator
$(IMAGE_GEN): $(NEORV32_EXG_PATH)/image_gen.c
@echo Compiling $(IMAGE_GEN)
@echo Compiling image generator...
@$(CC_HOST) $< -o $(IMAGE_GEN)

# -----------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions sw/image_gen/image_gen.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ int main(int argc, char *argv[]) {
unsigned int input_words = input_size / 4;
rewind(input);

if ((input_size % 4) != 0) {
printf("WARNING - image size is not a multiple of 4 bytes.\n");
}

// input file empty?
if(input_size == 0) {
printf("Input file is empty!");
Expand Down

0 comments on commit 36717c9

Please sign in to comment.