lpoulain
Posts: 24
Joined: Mon May 20, 2019 12:35 am

Loading the kernel without the SD card

Thu May 30, 2019 12:22 am

All,

I've been trying to load my kernel without constantly updating the SD card, so far to no avail:
  • I connected my RPi to my computer using a USB/TTL cable. Using the Raspbootin Java client from https://github.com/milanvidakovic/Raspbootin64Client and opening a terminal, I was able to catch the UART traffic that my kernel is sending. To it seems like my USB/TTL cable is properly configured
  • Trying to upload my kernel however doesn't work. I booted the RPi running the Raspbootin64 kernel receiver from https://github.com/bztsrc/raspi3-tutori ... spbootin64 and tried to upload my kernel8.img file, but most of the time it says "Connecting to the Raspbootin..." without going any further. One time it was able to upload the file ("Got the response from Raspbootin64: OK. Sent 48780 bytes." then a bunch of weird characters), but nothing was displayed on the RPi screen.
  • I tried the option of booting off a USB stick. I set the USB booting mode in the config.txt on the SD card. I can then start a Raspbian distro installed on a USB stick, but putting my own kernel8.img on the USB stick (hiding the original kernel.img) only produces a blank screen
Are there some caveats to know or ways to troubleshoot what's going on?

Thanks

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 22684
Joined: Sat Jul 30, 2011 7:41 pm

Re: Loading the kernel without the SD card

Thu May 30, 2019 8:42 am

I'd test first with the official image. There no way of knowing if your home built kernel actually works.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

lpoulain
Posts: 24
Joined: Mon May 20, 2019 12:35 am

Re: Loading the kernel without the SD card

Thu May 30, 2019 11:56 am

My kernel works. When I install it on the SD card itself it is running properly. I also tried other kernels from other people that work, with the same result.

zeoneo
Posts: 52
Joined: Sun Sep 30, 2018 6:54 am

Re: Loading the kernel without the SD card

Sat Jun 01, 2019 4:44 am

I can suggest the steps to debug. When I started using raspbootin 32 bit bootloader first I checked if serial UART is working? So i tried to send characters and hex data. When I verified data received from rpi is correct, then I compiled raspbootcom and sent some hex data from host computer, I would relay back the same data from rpi to host again to check everything is well received. Mostly issues with endianness can cause problems .

-zeo
Let there be some light .../\...

lpoulain
Posts: 24
Joined: Mon May 20, 2019 12:35 am

Re: Loading the kernel without the SD card

Sun Jun 02, 2019 3:54 pm

If I connect the cable and open a terminal in the Raspbootin Java client, I see the UART output from the kernel. But sending characters is a good idea, I'll try that.

bzt
Posts: 373
Joined: Sat Oct 14, 2017 9:57 pm

Re: Loading the kernel without the SD card

Wed Jun 05, 2019 1:05 pm

Hi,

In theory endianess doesn't matter since the code reads bytes and concatenates them afterwards using bit shifts. But the size can arrive in the wrong order in the first place of course.

TBH, I've never tried the Java sender, as I have a general dislike about Java ever since I haven't got paid for a Java job. I've tested the Raspbootin64 loader with this: raspbootcom.c. It is a minor modification to the original sender code, as my boot loader uses this protocol to upload initrds. But if it's not my boot loader running on the Pi but the Raspbootin64 loader, then it will receive kernels from this sender without probs.

If it turns out to be a bug in Raspbootin64, please let me know and open a ticket on github. I'll fix it right away.

Cheers,
bzt

Return to “Bare metal, Assembly language”