How to compile minima bootloader

Hello.
I'm trying to build a minima bootloader, as described by arduino in the readme file here but without success.

When I execute the step TINYUSB_ROOT=$PWD/../tinyusb make -f Makefile.minima , I get this error message :

MacBook-Pro:arduino-renesas-bootloader $ TINYUSB_ROOT=$PWD/../tinyusb make -f Makefile.minima
Makefile.minima:8: /Users/Downloads/bootloader/arduino-renesas-bootloader/../tinyusb/examples/make.mk: No such file or directory
Makefile.minima:32: /Users/Downloads/bootloader/arduino-renesas-bootloader/../tinyusb/examples/rules.mk: No such file or directory
make: *** No rule to make target `/Users/Downloads/bootloader/arduino-renesas-bootloader/../tinyusb/examples/rules.mk'.  Stop.
MacBook-Pro:arduino-renesas-bootloader $

So I looked inside tinyusb folder and I found that missed files where inside, but not in the place the program expected to.
So after copying required files at the right place, I re-executed TINYUSB_ROOT=$PWD/../tinyusb make -f Makefile.minima , and this time get this error message :

MacBook-Pro:arduino-renesas-bootloader $ TINYUSB_ROOT=$PWD/../tinyusb make -f Makefile.minima
You must provide a BOARD parameter with 'BOARD='
/Users/Downloads/bootloader/arduino-renesas-bootloader/../tinyusb/examples/make.mk:60: *** Invalid BOARD specified.  Stop.
MacBook-Pro:arduino-renesas-bootloader $ 

When I looked into the MakeFile.minima, I saw these first line

TOP ?= $(TINYUSB_ROOT)
BOARD ?= uno_r4

# run 
# python tools/get_deps.py ra
# once in the tinyusb root folder

include $(TOP)/examples/make.mk

So I changed BOARD ?= uno_r4 to BOARD = uno_r4 to see If it does something, but not, same error.

Need help please to know how to make it works.

Thanks

PS : I seems instruction given by arduino was written with earlier tinyusb version (like 0.15 or 0.14) where missed file is located at the right place

I have been trying to build on Windows, so the following points could be wrong, but I have been in the same situation as you.

The reason is that "TOP" is not defined in one place.
It is on line 13 of make.mk - the file you copied over after finding it was not in the right place, which is included on line 8 of Makefile.minima.
If BOARD is not defined, BOARD_DIR cannot be defined (lines 45-56 of the make.mk file), which is why the error message you noted appears. However, TOP is also used to define BOARD_DIR, the same error message will be displayed as a result even if not BOARD but TOP is not defined correctly.

In my case, the build could not be completed without other minor modifications. You may have a different situation since you seem to be building on a MAC, but good luck.

Examining what variables are in the makefile will help you to figure out why you are unable to build.
"$(info )" statement can be used to show you the variables during the build. ie., "$(info $(BOARD))"
"$(info )" statement is exactly the syntax for displaying the message that BOARD is not defined. (line 59 of file make.mk)

Hello key2023.

Thanks for your response but I got a solution.

The think is that the new tinyusb version use cmake instead make.

So after changing these lines :

-include $(TOP)/examples/make.mk
+include $(TOP)/examples/build_system/make/make.mk
 
-include $(TOP)/examples/rules.mk
+include $(TOP)/examples/build_system/make/rules.mk

build works for me

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.