Rockbox Technical Forums
Rockbox Development => Starting Development and Compiling => Topic started by: ciel on April 26, 2018, 04:52:59 PM
-
How do I compile the bootloader for Sansa Clip Plus?
I'm trying to compile the bootloader after making a change to sansa_as3525.c. However, I'm getting several errors, listed below. For example, it cannot find make.inc.
./../firmware/export/config.h:895:17: error: operator '>=' has no left operand
#if (MEMORYSIZE >= 8) && !defined(BOOTLOADER) && !defined(__PCTOOL__) \
^
./../firmware/export/config.h:1042:41: error: operator '&&' has no right operand
(CONFIG_CPU == AS3525 && MEMORYSIZE > 2 && !defined(BOOTLOADER)) || /* AS3525 +2MB: core, plugins, codecs */ \
Makefile:105: /make.inc: No such file or directory
make: *** No rule to make target '/make.inc'. Stop.
Before that, I had fixed another error by changing line 41 in /bootloader/Makefile to the following, where the bold part of the path is what I added to fix it. Otherwise, it could not be found.
SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "[b]../firmware/export/[/b]config.h" - )
-
Another note is that I can't find a "bootloader.bin" file.
-
Post the full log, including the configure step.
-
Your best bet is to do this through the supplied VM image
see here for that and/or setting up your environment
https://www.rockbox.org/wiki/DevelopmentGuide
That being said.. you can easily brick your player by messing up the bootloader
while it is recoverable it isn't the easiest thing to do as it requires taking the Clip+ apart
Might I ask what you are changing in sansa_as3525.c? If you are confident in the changes pastebin them and I can compile the bootloader for you
If you are trying to learn I'd suggest playing with a firmware build first as it won't brick the player
-
Thank you for the quick responses. I figured it out. It turns out that the bootloader gets compiled to "rockbox.sansa" if I follow the build instructions on the rockbox wiki.
So, I don't need to go into /bootloader and run its Makefile to compile the bootloader.
-
I ran into another problem. I started afresh, and have the current version of rockbox in github. I compiled rockbox in the build folder as instructed, which produced a "rockbox.sansa" file. Then I ran:
./mkamsboot clppa.bin rockbox.sansa patched.bin
However, I get an error:
[ERR] Packed data (426067 bytes) doesn't fit in the firmware (134008 bytes).
I haven't done anything to the code. How can this be fixed?
-
I've a feeling you aren't doing a bootloader build
https://www.rockbox.org/wiki/HowToCompile#A_3._Run_configure
after you do configure you need to press b for bootloader
../tools/configure
'b'
-
you know if you would stop for a bit and explain what you are trying to do we might be able to save you some heartache/burn
-
to further clarify if you are trying to change something in rockbox ie after the logo pops up you just need to compile firmware
If you are trying to change something when the player boots ie. before the logo thats the bootloader it handles things like booting the OF when you hold the volume key
-
Thank you for the advice. I'm doing some research for my graduate studies. What I've been trying to do is to start up a small game instead of rockbox.
To do that on a Sansa Clip Plus, I added new firmware files in /firmware, and modified bootloader/sansa_as3525.c so that it'd boot the game instead of rockbox. My steps to put the new firmware on the device are:
1. Run "make zip". This creates a "rockbox.sansa" file.
2. Use this "rockbox.sansa" file in the command " ./mkamsboot clppa.bin bootloader-clipplus.sansa patched.bin". However, this command fails, saying that the "Packed data doesn't fit in the firmware".
Do you have any suggestions?
-
Post the full log, including the configure step.
-
Thank you for the advice. I'm doing some research for my graduate studies. What I've been trying to do is to start up a small game instead of rockbox.
It would be much easier to for you to just write a plugin instead of essentially having to roll your own operating system, unless that's what you specifically want to do.
-
Yes, that is true, but that is specifically what I'd like to do. But it seems like building the bootloader even from the source code has issues.
-
I double checked and the clip+ bootloader was ~3 KB over limit. I committed two patches that reduce the size, so it should work now.
-
@saratoga: Sorry that I haven't replied sooner, but your patches have been a great help! Thanks.