Rockbox Technical Forums

Rockbox Development => Starting Development and Compiling => Topic started by: Alman99 on January 14, 2018, 12:29:49 AM

Title: Need to compile one specific bin file
Post by: Alman99 on January 14, 2018, 12:29:49 AM
Hi there,


OK here is my situation. I have had a Neo35 car jukebox for many years now, and absolutely love it. Recently, too many bumpy roads caused the hard disk to die, so I went about changing it for a replacement, no big deal. As it was the first time I had it apart for some time, I happened to see if I could find any newer firmware for it, I was running openneo 2.1 beta 11. I found beta 14 on sourceforge, and decided to install it, big mistake. The flash routine did not work, unit would not boot up, eeprom was corrupted. Ok, no problem I thought, I have a burner, I'll just reflash the chip myself. Needless to say, that didn't work either. Now I have a dead player and no reliable way to reflash it.

Sourceforge has the source code for the beta build, which I downloaded. I am not a programmer per se, but know enough to be dangerous. What I would like to do is rewrite the flash utility to the eeprom (openuu.bin) but I don't have a compiled copy here, and have been struggling for several weeks to figure out a way to compile it. (have source code).  I tried to setup cygwin with the script I found here, but the rockbox repository is not working for the older stuff, I can't plug in the SH1 stuff to make it work.

Does anyone here have a version of a compiler setup at the moment to compile for the hitachi SH1? Would you be willing to compile the binary for me if I send you the code? I would be most grateful. Failing that, can anybody help me get my compiler setup to do the same, as I have had no luck thus far, and have already spent a lot of time on this. Thanks in advance, and cheers!
Title: Re: Need to compile one specific bin file
Post by: saratoga on January 14, 2018, 03:37:01 AM
I don't have the sh1 compiler installed, but it's not difficult to build using the virtual machine we provide.
Title: Re: Need to compile one specific bin file
Post by: Alman99 on January 14, 2018, 02:44:52 PM
Ok thanks for that, I'll give it a go. So to be clear, the VM already has the SH1 support baked in?
Title: Re: Need to compile one specific bin file
Post by: saratoga on January 14, 2018, 03:21:47 PM
It only comes with the ARM compiler, but you can run the rockboxdev.sh script, select sh1, and it should build it in a few minutes (on a modern CPU at least).  The development guide has instructions.

By the way, I have no idea what you're doing, and if the SH1 compiler we provide will even work for a 15 year old fork :)
Title: Re: Need to compile one specific bin file
Post by: Alman99 on January 14, 2018, 11:35:49 PM
I am just trying to obtain a copy of the original loader utility bin file for the Neo, so I can rewrite it to the proper location on the eeprom, if that works, and I can access it through the neo interface, then I may be able to write a working bin file to it using that loader as intended. I have the source code for the loader, I have determined that it was originally compiled with gcc  in C for the Hitachi SH1. The only "free" compiler out there that I can find is here on your site. As the neo was originally ported from the older rockbox, I am cautiously optimistic that this might work. The VM is a far better idea than trying to make gcc behave, and as I stated above, I am not a coder, but I do understand enough about it that I am going to give this a shot. I will post back here my results, and I am grateful for your input.

Cheers

Alman99
Title: Re: Need to compile one specific bin file
Post by: Alman99 on January 17, 2018, 12:57:17 PM
OK, so I am trying to get the current VM image to create an SH capable compiler. After searching this forum, and trying a bunch of different things, this is what I've found, and where I'm at currently.

Obviously, nobody, except me apparently, uses anything with the SH1 anymore. I have followed the instructions to the letter, and when you try to set up your compiler by running the configure script, it gives me "../tools/configure: 4527: sh-elf-gcc: not found" and "../tools/configure: 4596: sh-elf-cpp: not found". Obviously the sh versions of gcc are not in any available path for the script to find. I have run "git clone git://git.rockbox.org/rockbox ./Desktop/rockbox" and that worked, but obviously sh-elf-gcc is not in that path. It is however available elsewhere on this site under "releases". I have downloaded it, got it on the VM desktop, but as I am not really a linux expert, I can't figure out how to get it in the path so the configure script can find it. I don't want to change too much as I am not sure if it will break something else in the process if I futz around with folder permissions and ownership to end run this. I am still reading etc, but as I have so much else going on right now, its hard to find the time to do this at the moment. Any thoughts on what I can quickly do to finish setting up the sh compiler?
Title: Re: Need to compile one specific bin file
Post by: saratoga on January 17, 2018, 01:17:31 PM
Obviously, nobody, except me apparently, uses anything with the SH1 anymore. I have followed the instructions to the letter, and when you try to set up your compiler by running the configure script, it gives me "../tools/configure: 4527: sh-elf-gcc: not found" and "../tools/configure: 4596: sh-elf-cpp: not found".

tools/configure is to build rockbox, it fails because you don't have the compiler installed and you need that before you can build rockbox. 

You should be running rockboxdev.sh, which will build the compilers automatically.  See here for more info:

  https://www.rockbox.org/wiki/CrossCompiler 
Title: Re: Need to compile one specific bin file
Post by: Alman99 on January 17, 2018, 05:38:03 PM
OHHHH, damn. I guess I managed to read that backwards. I though I was supposed to run configure BEFORE rockboxdev. Ok, I will see what happens with that. Thankyou very much!
Title: Re: Need to compile one specific bin file
Post by: Alman99 on January 17, 2018, 06:23:31 PM
Well that didn't work either, ran it and got the following

Quote
ubuntu@ubuntu-VirtualBox:~/Desktop/rockbox/build$ ../tools/rockboxdev.sh
ROCKBOXDEV: "automake" is required for this script to work.
ROCKBOXDEV: "libtool" is required for this script to work.
ROCKBOXDEV: "autoconf" is required for this script to work.
ROCKBOXDEV: "flex" is required for this script to work.
ROCKBOXDEV: "bison" is required for this script to work.
ROCKBOXDEV: Please install the missing tools and re-run the script.
ubuntu@ubuntu-VirtualBox:~/Desktop/rockbox/build$

According to another post,
Code: [Select]
http://forums.rockbox.org/index.php/topic,50131.msg233088.html#msg233088
in reply #7, configure was supposed to be run first, so at this point, I will erase the image I am running, and start all over with a fresh copy, and try it again. Still can't see what I've missed though.
Title: Re: Need to compile one specific bin file
Post by: saratoga on January 17, 2018, 06:59:53 PM
That error means you need to install automake. The link I provided above (third time mentioning that you  might want to look at it) explains this. However, if you missed it, type "sudo apt-get install automake".

The link you provided is to someone realizing that the arm compiler is included with the vm. If you want, you can indeed build rockbox for arm devices right now since you already have the arm compiler.
Title: Re: Need to compile one specific bin file
Post by: Alman99 on January 17, 2018, 09:58:09 PM
Nope, I had already tried that too...

Quote
ubuntu@ubuntu-VirtualBox:~/Desktop/rockbox$ sudo apt-get install automake
[sudo] password for ubuntu:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  autoconf autotools-dev m4
Suggested packages:
  autoconf2.13 autoconf-archive gnu-standards autoconf-doc libtool
The following NEW packages will be installed:
  autoconf automake autotools-dev m4
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,344 kB of archives.
After this operation, 4,735 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
  m4 autoconf autotools-dev automake
Install these packages without verification [y/N]? y
Err http://it.archive.ubuntu.com/ubuntu/ oneiric/main m4 i386 1.4.16-1
  404  Not Found
Err http://it.archive.ubuntu.com/ubuntu/ oneiric/main autoconf all 2.68-1ubuntu1
  404  Not Found
Err http://it.archive.ubuntu.com/ubuntu/ oneiric/main autotools-dev all 20110511.1
  404  Not Found
Err http://it.archive.ubuntu.com/ubuntu/ oneiric/main automake all 1:1.11.1-1ubuntu1
  404  Not Found
Failed to fetch http://it.archive.ubuntu.com/ubuntu/pool/main/m/m4/m4_1.4.16-1_i386.deb  404  Not Found
Failed to fetch http://it.archive.ubuntu.com/ubuntu/pool/main/a/autoconf/autoconf_2.68-1ubuntu1_all.deb  404  Not Found
Failed to fetch http://it.archive.ubuntu.com/ubuntu/pool/main/a/autotools-dev/autotools-dev_20110511.1_all.deb  404  Not Found
Failed to fetch http://it.archive.ubuntu.com/ubuntu/pool/main/a/automake1.11/automake_1.11.1-1ubuntu1_all.deb  404  Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
ubuntu@ubuntu-VirtualBox:~/Desktop/rockbox$
Title: Re: Need to compile one specific bin file
Post by: Alman99 on January 18, 2018, 02:43:59 AM
Figured it out. Building the compiler now. Unfortunately, as it stands, the rockboxdev.sh file when run after following the other steps in rockbox.txt, will not create the compiler for the sh cpu. I realize that its a museum piece now, but thought I'd point out that something needs changing in its present form. The way I did it ultimately was simple, I could post coded links to the 2 web pages that show the 2 things I did. I don't want to break any rules here, so let me know if I should post them.
Title: Re: Need to compile one specific bin file
Post by: saratoga on January 18, 2018, 10:16:01 AM
You're actually running the old 2011 virtual machine, which is why it can't download the packages (they're only supported for a couple years by Ubuntu).

I'll take a look and see where the old link is and update it.
Title: Re: Need to compile one specific bin file
Post by: Alman99 on January 18, 2018, 01:10:50 PM
What I managed to do was make 2 small changes to config files that allowed it to take updates, this info is not included anywhere here that I could see. I will post the link info of 2 web pages that show the 2 changes if you would like.
Title: Re: Need to compile one specific bin file
Post by: saratoga on January 18, 2018, 03:40:50 PM
That isn't necessary.