Adding an SD card to Glowlights (2, 3, 4)

Search This thread

Renate

Recognized Contributor / Inactive Recognized Dev
This all started out in a Glowlight 4 (7.8", 2019) thread: https://forum.xda-developers.com/nook-touch/general/glowlight-plus-7-8-2019-t3934677
An SD card was soldered to test points on the circuit board of a Glow4 to allow for extra storage.
Since it looks like this same technique should work on Glow2 & Glow3 I've broken the thread out here.

The Glow4 has test points labelled by function and has been tested and proven to work with SD cards.
http://www.temblast.com/blogs/glow4/blog.htm#sdcard

The Glow3 has test points labelled by function and has not yet been tested.

The Glow2 has test points, but they are not labelled by function.
I will try to "wiggle" out the pinout soon.

Since the only difference between the models will only be wiring, I suspect that the bulk of this thread will be on configuration and use.
 

Attachments

  • glow4-3.jpg
    glow4-3.jpg
    154.3 KB · Views: 322
Last edited:

case-sensitive

Senior Member
Nov 4, 2010
344
33
Thanks! I look forward learning more about mounting the sdcard and editing fstab etc.

One more question: Does this method have any restriction on the size of the sdcard and how it's formated? Many old(er) android devices with external storage can only take sdcard of size up to 32Gb, and (independent of that) sometimes people are told to format the sdcard using the device itself, but other times we're suppose to format it in advance (fat32? ext4?).

THANKS!
 

Renate

Recognized Contributor / Inactive Recognized Dev
Does this method have any restriction on the size of the sdcard and how it's formated?
This is not so much a method as simply putting in an option that they couldn't be bothered with.

I don't have anything bigger than 16GB on hand.
32GB is the limit for SD 2.0 spec.
Most of the 4GB to 16 GB cards that I have tried are SD 3.0 spec.
You can see this with mmcinfo in uboot.

Formatting things VFAT is only useful if you want to use UMS.
I wouldn't recommend that, VFAT is old and stupid and there are issues with timezones on timestamps.

ext2 is kind of the logical choice.
mkfs.ext2 is included in busybox for formatting.
 

Renate

Recognized Contributor / Inactive Recognized Dev
Last edited:
  • Like
Reactions: Kramar111

Renate

Recognized Contributor / Inactive Recognized Dev
Apparently there is already a default place for external SD cards: /mnt/media_rw/extsd
This has a link from /storage/extsd

Since the directory already exists you don't need to modify /init.rc
If you want to use vfat formatted disks and have them hot swappable you don't even have to modify /fstab.E70Q50

My choice is to use an ext2 formatted disk and since it will be internal and not swappable, I don't need or want vold, the volume daemon.
You need to tweak /fstab.E70Q50 (get rid of any line that mentions "extsd").
Code:
/dev/block/mmcblk1p1 /mnt/media_rw/extsd ext2 defaults defaults

You can split the SD card into separate partitions if you want.
You'd have to add some more entries in /fstab.E70Q50 and some mkdirs in /init.rc

For partitioning/formatting cards:
Code:
# busybox fdisk /dev/block/mmcblk1
d [color=red]<-- delete partition[/color]
n [color=red]<-- new partition[/color]
w [color=red]<-- actually write the changes[/color]

#busybox mkfs.ext2 /dev/block/mmcblk1p1
Be very careful when you are talking about mmcblk? and mmcblk?p?
 
  • Like
Reactions: Kramar111

Renate

Recognized Contributor / Inactive Recognized Dev
  • Like
Reactions: Kramar111

Renate

Recognized Contributor / Inactive Recognized Dev
On the Glow2 I ran into a hiccup.
I soldered some 30 gauge wire directly to the micro SD card.
The SD2 is there and fine, but the NtxHwCfg (at least on mine) had to be patched.
Code:
# dd if=/dev/block/mmcblk0 of=/sdcard/hwcfg skip=1024 count=1
This will get you a 512 byte file.
Look at the byte at hex address 0x4f
For the SD card to work this value must be 0x02 (it was 0x00 on mine)
Be very careful modifying the file and writing it back to the internal SD:
Code:
# dd if=/sdcard/hwcfg of=/dev/block/mmcblk0 seek=1024 count=1
Hey! It says "skip" in the first example and "seek" in the second. I warned you!
 
  • Like
Reactions: Kramar111

Renate

Recognized Contributor / Inactive Recognized Dev
Well, more sloppiness on NTX/B&N's part.
*.rc files are organized by board names
Usually they shovel the files into the ramdisk.
This means that you have bunches of useless files that aren't used by your hardware.
The Glow2 is a E60QD0 board, the Glow3 is a E60QQ0 board, the Glow4 is a E70Q50 board.

The init.<board>.rc file should load the fstab.<sameboard> file.
On the Glow2 (at least mine) they did sloppy copy/paste and the init.E60QD0.rc loads fstab.E60Q50
I edited init.E60QD0.rc to load fstab.E60QD0
(Then made sure that fstab.E60QD0 had the correct contents.)

Likewise, init.<board>.usb.rc is sloppy.
They don't use the approved syntax of ${ro.serialno}, but instead use $ro.serialno
I get tired of the warnings in the console log.
Also, a lot of redundant junk (the VID/PID stuff can be moved to the "on boot" section).
 

Attachments

  • sdcard.jpg
    sdcard.jpg
    207.7 KB · Views: 127
Last edited:
  • Like
Reactions: Kramar111

Renate

Recognized Contributor / Inactive Recognized Dev
I had previously said that an SD card and WiFi were not compatible on the Glow3.
It turns out that it's a bit more complicated.
SD2 is the WiFi interface.
SD3 goes to the test points.
The software currently has the WiFi enable/disable switching the SD3 interface, which is wrong.

I've got the hardware itself working
Code:
eBR-1A # mmcinfo
Device: FSL_USDHC
Manufacturer ID: 27
OEM: 5048
Name: SD32G
Tran Speed: 25000000
Rd Block Len: 512
SD version 3.0
Clock: 50000000
High Capacity: Yes
Capacity: 31104958464 Bytes
Bus Width: 4-bit
Boot Partition for boot: No boot partition available
Now I just have to fix the software.
 
  • Like
Reactions: Kramar111

Renate

Recognized Contributor / Inactive Recognized Dev
Ok, so I've patched the kernel to make this work on the Glow3.
This also needs a change to the ntxcfg. You can do that with dd or some other tool.
Is anybody ready for this? Do you have the soldering iron warmed up?
Code:
/mnt/media_rw/extsd     28.5G    20.0K    28.5G   4096
I've got to make a version of the image without my stuff in it.
I usually don't like heavily modded images.
The one thing I put in is a rooted adbd.
 
  • Like
Reactions: Kramar111

Renate

Recognized Contributor / Inactive Recognized Dev
So, who's ready for the glow3?
You need a new kernel.
If you have access to fastboot you can test drive it with "fastboot boot p1mod.img".
Later you can "fastboot flash boot p1mod.img" to make it permanent.
If you don't (and you're brave and have a good recovery) you can "dd if=p1mod.img of=/dev/block/mmcblk0p1"

You will need to patch the NTX hwcfg.
If this is patched but you are still running the old kernel the WiFi will probably not work, but the glow3 will still be functional.
Code:
# dd if=/dev/block/mmcblk0 skip=1024 count=1 of=/sdcard/hwcfg
[color=red]Use your favorite hex file editor either on of off the glow3 to change address 0x4f from 0x02 to 0x00.
modfile hwcfg 4f 00[/color]
# dd if=/sdcard/hwcfg seek=1024 count=1 of=/dev/block/mmcblk0
If you have access to the u-boot command line you can do it there instead:
Code:
eBR-1A # mmc read 910000 400 1

MMC read: dev # 0, block # 1024, count 1 ... 1 blocks read: OK
eBR-1A # mm.b 91004f
0091004f: 02 ? 00
00910050: 01 ? q
eBR-1A # mmc write 910000 400 1

MMC write: dev # 0, block # 1024, count 1 ... 1 blocks write: OK
eBR-1A #
So, if you get through with all this and reboot it should boot up just fine.
There is a rooted adbd in there so that should not be a problem.
The fstab has been modified to mount your new SD card.
Since that is probably still the original filesystem it will not mount correctly.
You can do an "ls -l /dev/block" and see both mmcblk1 and mmcblk1p1.
You probably noticed that your old /sdcard is empty.
This is an artifact of the fstab not finishing and therefore the nonencrypted is not triggered nor the late_start.
Just do a "start sdcard" and the /sdcard will populate.

So now, just do a "busybox fdisk /dev/block/mmcblk1" to repartition and a "busybox mke2fs /dev/block/mmcblk1p1".
The fstab presumes ext2, a reasonable choice for something used as big storage. If not, just change it.
Reboot and everything should be good.

Good luck.
 

Attachments

  • p1mod.img
    4.2 MB · Views: 14
  • Like
Reactions: Kramar111

Renate

Recognized Contributor / Inactive Recognized Dev
I've been talking about the NTX hardware configuration, but I don't think that I mentioned or released the utility that I use to dump it.
Availible in the signature, there is NtxHwCfg which can dump or compare NTX configurations.
There is a version for Win32 and one for Android.
http://www.temblast.com/android.htm

It's interesting that the B&N updates don't modify the NTX config.
The Glow2 has version 2.5 vs. the Glow3 with 2.8 vs. the Glow4 with 3.1!
So that means that the u-boots all have to be different.

Code:
C:\>ntxhwcfg hwcfg3 hwcfg4
0b  Version              2.8               3.1
0f  Size                 65                70
10  PCB                  E60QQ0 (69)       E70Q50 (84)
12  AudioCodec           No (0)            ALC5672 (6)
14  Wifi                 RTL8189 (8)       RTL8723DS (14)
15  BT                   No (0)            RTL8723DS (8)
17  TouchCtrl            neonode_v2 (8)    ektf2132 (9)
...
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    This all started out in a Glowlight 4 (7.8", 2019) thread: https://forum.xda-developers.com/nook-touch/general/glowlight-plus-7-8-2019-t3934677
    An SD card was soldered to test points on the circuit board of a Glow4 to allow for extra storage.
    Since it looks like this same technique should work on Glow2 & Glow3 I've broken the thread out here.

    The Glow4 has test points labelled by function and has been tested and proven to work with SD cards.
    http://www.temblast.com/blogs/glow4/blog.htm#sdcard

    The Glow3 has test points labelled by function and has not yet been tested.

    The Glow2 has test points, but they are not labelled by function.
    I will try to "wiggle" out the pinout soon.

    Since the only difference between the models will only be wiring, I suspect that the bulk of this thread will be on configuration and use.
    1
    I wiggled the Glow2, the pinout for SD2 is:

    TP159 D0
    TP160 D1
    TP161 D2
    TP162 D3
    TP163 Cmd
    TP164 Clk
    TP165 /CD
    TP165 VDD
    TP167 Gnd

    The Glow3, while it's labelled, seems to be on SD3, which is not configured.
    I'm still looking at this.
    1
    TLDR: This works on the Glow2 & Glow4 relatively easily.
    On the Glow3 you'd need to sacrifice the WiFi to make it work. This works on the Glow3, but you need a modified kernel and a hwcfg change.

    http://www.temblast.com/blogs/glow2/blog.htm
    http://www.temblast.com/blogs/glow3/blog.htm
    http://www.temblast.com/blogs/glow4/blog.htm
    1
    Apparently there is already a default place for external SD cards: /mnt/media_rw/extsd
    This has a link from /storage/extsd

    Since the directory already exists you don't need to modify /init.rc
    If you want to use vfat formatted disks and have them hot swappable you don't even have to modify /fstab.E70Q50

    My choice is to use an ext2 formatted disk and since it will be internal and not swappable, I don't need or want vold, the volume daemon.
    You need to tweak /fstab.E70Q50 (get rid of any line that mentions "extsd").
    Code:
    /dev/block/mmcblk1p1 /mnt/media_rw/extsd ext2 defaults defaults

    You can split the SD card into separate partitions if you want.
    You'd have to add some more entries in /fstab.E70Q50 and some mkdirs in /init.rc

    For partitioning/formatting cards:
    Code:
    # busybox fdisk /dev/block/mmcblk1
    d [color=red]<-- delete partition[/color]
    n [color=red]<-- new partition[/color]
    w [color=red]<-- actually write the changes[/color]
    
    #busybox mkfs.ext2 /dev/block/mmcblk1p1
    Be very careful when you are talking about mmcblk? and mmcblk?p?
    1
    Many old(er) android devices with external storage can only take sdcard of size up to 32Gb...
    Code:
    [email protected]_6sl:/ # df
    Filesystem               Size     Used     Free   Blksize
    ...
    /mnt/media_rw/extsd    114.4G    20.0K   114.4G   4096
    ...
    [email protected]_6sl:/ # mount
    ...
    /dev/block/mmcblk1p1 /mnt/media_rw/extsd ext2 rw,relatime,errors=continue 0 0