# \[Custom OSD3358 SiP\] 4.19-RT-Kernel panic (shutdown)

**URL:** <https://forum.digikey.com/t/custom-osd3358-sip-4-19-rt-kernel-panic-shutdown/6679>\
**Category:** Linux Discussions\
**Created:** [May 26, 2020, 8:13am UTC](https://forum.digikey.com/t/custom-osd3358-sip-4-19-rt-kernel-panic-shutdown/6679 "2020-05-26T08:13:34Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![taek8461](https://avatars.discourse-cdn.com/v4/letter/t/34f0e0/32.png) [@taek8461](https://forum.digikey.com/u/taek8461)\
**Post date:** [May 26, 2020, 8:13am UTC](https://forum.digikey.com/t/custom-osd3358-sip-4-19-rt-kernel-panic-shutdown/6679/1 "2020-05-26T08:13:34Z")

</div>

Hi  
When My beaglebone black is booted or flashing from SD Card to emmc, the following error occurs.

 ![image](https://global.discourse-cdn.com/digikey/original/2X/b/b3e1e17fee224ea9975c40da78c4989e810268b0.png)

What’s wrong with my BBB and How can I fix it?  
Please Help me.

Regards

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://sea2.discourse-cdn.com/digikey/user_avatar/forum.digikey.com/robertcnelson/32/12_2.png) [@RobertCNelson](https://forum.digikey.com/u/RobertCNelson)\
**Post date:** [May 26, 2020, 4:27pm UTC](https://forum.digikey.com/t/custom-osd3358-sip-4-19-rt-kernel-panic-shutdown/6679/3 "2020-05-26T16:27:53Z")

</div>

Hi @taek8461, is there a specific reason why you are using 4.19.31-bone-rt-31?

We are currently shipping: 4.19.120-bone-rt-r50

> **[RobertCNelson/bb-kernel](https://github.com/RobertCNelson/bb-kernel/commits/am33x-rt-v4.19)**
>
> Contribute to RobertCNelson/bb-kernel development by creating an account on GitHub.

```auto
debian@beaglebone:~$ uname -r ; sudo systemctl poweroff 
4.19.120-bone-rt-r50

..........

[OK] Started Power-Off.
[OK] Reached target Power-Off.
[76625.609386] systemd-shutdow: 47 output lines suppressed due to ratelimiting
[76625.707137] systemd-shutdown[1]: Syncing filesystems and block devices.
[76625.760941] systemd-shutdown[1]: Sending SIGTERM to remaining processes...
[76625.784974] systemd-journald[771]: Received SIGTERM from PID 1 (systemd-shutdow).
[76625.827537] systemd-shutdown[1]: Sending SIGKILL to remaining processes...
[76625.853474] systemd-shutdown[1]: Unmounting file systems.
[76625.865084] [2216]: Remounting '/' read-only in with options 'errors=remount-ro'.
[76625.907328] EXT4-fs (mmcblk0p1): re-mounted. Opts: errors=remount-ro
[76625.928214] systemd-shutdown[1]: All filesystems unmounted.
[76625.933957] systemd-shutdown[1]: Deactivating swaps.
[76625.939563] systemd-shutdown[1]: All swaps deactivated.
[76625.944955] systemd-shutdown[1]: Detaching loop devices.
[76625.951087] systemd-shutdown[1]: All loop devices detached.
[76625.956743] systemd-shutdown[1]: Detaching DM devices.
[76626.061502] reboot: Power down

```

Humm, 4.19.31-bone-rt-r31 shut’s down fine too…

```auto
debian@beaglebone:~$ uname -r
4.19.31-bone-rt-r31

[OK] Started Power-Off.
[OK] Reached target Power-Off.
[154.941274] systemd-shutdow: 42 output lines suppressed due to ratelimiting
[155.039811] systemd-shutdown[1]: Syncing filesystems and block devices.
[155.091116] systemd-shutdown[1]: Sending SIGTERM to remaining processes...
[155.114843] systemd-journald[766]: Received SIGTERM from PID 1 (systemd-shutdow).
[155.156011] systemd-shutdown[1]: Sending SIGKILL to remaining processes...
[155.181832] systemd-shutdown[1]: Unmounting file systems.
[155.193789] [1705]: Remounting '/' read-only in with options 'errors=remount-ro'.
[155.237145] EXT4-fs (mmcblk0p1): re-mounted. Opts: errors=remount-ro
[155.257897] systemd-shutdown[1]: All filesystems unmounted.
[155.263633] systemd-shutdown[1]: Deactivating swaps.
[155.268997] systemd-shutdown[1]: All swaps deactivated.
[155.274280] systemd-shutdown[1]: Detaching loop devices.
[155.280363] systemd-shutdown[1]: All loop devices detached.
[155.286002] systemd-shutdown[1]: Detaching DM devices.
[155.391206] reboot: Power down

```

What version of u-boot are you running?

```auto
U-Boot SPL 2019.04-00002-g31a8ae0206 (May 13 2020 - 09:26:17 -0500)
Trying to boot from MMC1
Loading Environment from EXT4... **File not found /boot/uboot.env**

**Unable to read "/boot/uboot.env" from mmc0:1**

U-Boot 2019.04-00002-g31a8ae0206 (May 13 2020 - 09:26:17 -0500), Build: jenkins-github_Bootloader-Builder-139

CPU : AM335X-GP rev 2.1
I2C: ready
DRAM: 512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: External.
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from EXT4... **File not found /boot/uboot.env**

```

Regards,

---

<div class="post-metadata">

**Author:** ![taek8461](https://avatars.discourse-cdn.com/v4/letter/t/34f0e0/32.png) [@taek8461](https://forum.digikey.com/u/taek8461)\
**Post date:** [May 27, 2020, 2:43am UTC](https://forum.digikey.com/t/custom-osd3358-sip-4-19-rt-kernel-panic-shutdown/6679/4 "2020-05-27T02:43:49Z")

</div>

Hi  
Thank you for your response.

This is the message when BBB is booted.

 ![image](https://global.discourse-cdn.com/digikey/original/2X/9/96ff63b3ddc059935ccbde282e09cf48c71b056f.png)

I have been testing BBB since December, 2018  
The linux version is the first. No changes have been made since then.

If I change Linux version to 4.19.120-bone-rt-r50, will it be resolved?

or could it be because I made a bad sd card image?

Please, help me.

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://sea2.discourse-cdn.com/digikey/user_avatar/forum.digikey.com/robertcnelson/32/12_2.png) [@RobertCNelson](https://forum.digikey.com/u/RobertCNelson)\
**Post date:** [May 27, 2020, 3:06pm UTC](https://forum.digikey.com/t/custom-osd3358-sip-4-19-rt-kernel-panic-shutdown/6679/5 "2020-05-27T15:06:38Z")

</div>

Hi @taek8461, sorry i just tried to replicate your issue with u-boot v2019.01 and 4.19.31-bone-rt-r31… For me it shuts down properly… It did get me wondering, how are you powering the BeagleBone Black, DC jack, usb connector or some other method?

Regards,

---

<div class="post-metadata">

**Author:** ![taek8461](https://avatars.discourse-cdn.com/v4/letter/t/34f0e0/32.png) [@taek8461](https://forum.digikey.com/u/taek8461)\
**Post date:** [May 28, 2020, 1:41am UTC](https://forum.digikey.com/t/custom-osd3358-sip-4-19-rt-kernel-panic-shutdown/6679/6 "2020-05-28T01:41:31Z")

</div>

Hi  
I modified beaglebone blacks a little.  
Some BBBs are good, but the others have the issue.  
I use a DC Jack.

I want to know what kind of situation that problem occurs.  
Please, help me

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://sea2.discourse-cdn.com/digikey/user_avatar/forum.digikey.com/robertcnelson/32/12_2.png) [@RobertCNelson](https://forum.digikey.com/u/RobertCNelson)\
**Post date:** [May 28, 2020, 2:17am UTC](https://forum.digikey.com/t/custom-osd3358-sip-4-19-rt-kernel-panic-shutdown/6679/7 "2020-05-28T02:17:39Z")

</div>

So, you modified a few BBB’s some have shutdown issues while other’s do not?

What exactly did you modify?

I’m sorry, but it looks like we are chasing Hardware bugs you actually created! 😉

On a factory BBB, this kernel and u-boot combination works correctly.

Feel free to share exactly what you changed. Schematic’s are helpful.

Regards,

---

<div class="post-metadata">

**Author:** ![taek8461](https://avatars.discourse-cdn.com/v4/letter/t/34f0e0/32.png) [@taek8461](https://forum.digikey.com/u/taek8461)\
**Post date:** [May 29, 2020, 4:39am UTC](https://forum.digikey.com/t/custom-osd3358-sip-4-19-rt-kernel-panic-shutdown/6679/8 "2020-05-29T04:39:55Z")

</div>

Hi  
I made 40 modified BBBs  
4 BBBs of them have the problem.  
I also think it would be a hardware problem.  
I want to know what kind of problem is causing this.  
So If I know the cause of the problem, you might find a clue to tackle the troubled 4 BBBs

I upload my schematics.  
[LTEModem\_Schematics1.pdf](https://forum.digikey.com/uploads/short-url/uBXeWQDIZjTk6mmMKWnfO2MGnSi.pdf) (3.8 MB)  
[LTEModem\_Schematics2.pdf](https://forum.digikey.com/uploads/short-url/zEc314z8RWsg5vvSmm5ppXfITqt.pdf) (3.3 MB)  
[LTEModem\_Schematics3.pdf](https://forum.digikey.com/uploads/short-url/u1ujK6BZGBzga7mQ2fUTfnTB1Mm.pdf) (3.2 MB)

Please, help me.

Regard

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://sea2.discourse-cdn.com/digikey/user_avatar/forum.digikey.com/robertcnelson/32/12_2.png) [@RobertCNelson](https://forum.digikey.com/u/RobertCNelson)\
**Post date:** [May 29, 2020, 2:19pm UTC](https://forum.digikey.com/t/custom-osd3358-sip-4-19-rt-kernel-panic-shutdown/6679/9 "2020-05-29T14:19:19Z")

</div>

Hi @taek8461, very nice re-spin with the OSD3358 SiP. This is not a BeagleBone Black, just call it your own design. 😉

Since it looks like you dropped HDMI, (do you have any lcd or similar display attached) You should probably remove the 24.576 Mhz Noise generator (OSC1) on GPIO3\_21, as that can make FCC fail when no HDMI cable is properly connected…

So I’ve found, on some boards using the SiP device, the 32.768Khz Osc for RTC doesn’t work, which causes a similar shutdown failure. There are two fixes, first switch to the internal 32KCLK. This must be done in u-boot: (We do this by default for the PocketBeagle and BeagleBone Blue)

> <https://github.com/RobertCNelson/Bootloader-Builder/blob/master/patches/v2019.04/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch#L198>

```auto
+	if (board_is_pb() || board_is_blue()) {
+ /* 6: EN_32KCLK */
+ /* 3: SEL_32KCLK_SRC 0: internal, 1: external */
+ writel((0 << 3) | (1 << 6), &rtc->osc);
+	} else {
+ /* Enable the RTC 32K OSC by setting bits 3 and 6. */
+ writel((1 << 3) | (1 << 6), &rtc->osc);
+	}

```

Second, we need to configure the \*.dts for the rtc change, for example this is the Blue fix:

> <https://github.com/beagleboard/BeagleBoard-DeviceTrees/commit/70af2e9dd254e108d7fcaf320da7fb7bfd255c60#diff-290e1a8b914e9585ddb06cc26a55ae45>

So as this is a custom board, using the BeagleBone Black “eeprom” there is no generic fix i can push out, as it’ll break “Real” BeagleBone Black’s. Your options are to patch u-boot and the kernel yourself, or create a new eeprom variant that does not collide with official values:

> <https://github.com/beagleboard/image-builder/blob/master/readme.md>

Easiest thing to do is, use the base value for ddr3 timing:

```auto
aa 55 33 ee 41 33 33 35 42 4e 4c 54

```

Then use 4 more standard readable characters and create your own “board\_is\_xyz(void)” functions:

> <https://github.com/RobertCNelson/Bootloader-Builder/blob/master/patches/v2019.04/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch#L352-L394>

Tie it under board\_is\_beaglebonex to get the ddr3 timing and all the beagle defaults. Then add it to the RTC section.

You can verify you did this correctly by looking at the u-boot log, which should change from:

```auto
RTC 32KCLK Source: External.

```

to:

```auto
RTC 32KCLK Source: Internal.

```

When correctly patched.

Regards,

---

<div class="post-metadata">

**Author:** ![taek8461](https://avatars.discourse-cdn.com/v4/letter/t/34f0e0/32.png) [@taek8461](https://forum.digikey.com/u/taek8461)\
**Post date:** [June 8, 2020, 7:40am UTC](https://forum.digikey.com/t/custom-osd3358-sip-4-19-rt-kernel-panic-shutdown/6679/10 "2020-06-08T07:40:09Z")

</div>

Hi  
Thank you for your response.  
But your explanation is so difficult… 😰

I tried to follow like your instruction.  
So What I did until now is as follow.

1. downloaded new u-boot and kernel
  - u-boot : U-Boot 2019.04-dirty (Jun 07 2020 - 22:54:40 -0700)
  - kernel : 4.19.120-bone50

2. I changed the file : 0001-am335x\_evm-uEnv.txt-bootz-n-fixes.patch  
 ![image](https://global.discourse-cdn.com/digikey/original/2X/b/bd812119e605d64afe6dac34c490db2db95c2bb6.png)  
 ![image](https://global.discourse-cdn.com/digikey/original/2X/a/a9e9ebd1c21496090048681588b6d18600a7a019.png)  
added board\_is\_bblter(void)
3. I changed board id  
 ![image](https://global.discourse-cdn.com/digikey/original/2X/7/7a338a51a9bb31969c9b02cb1e5950bab980348b.png)

Is what I have done correct?  
and I don’t know how to change this : am335x-boneblue.dts: fix rtc off  
I am a beginner as well as Linux embedded Linux 😰  
Could you explain it easily?

Regards.
