PocketBeagle SD Card Extra Storage

Hello all.

I was wondering if there were any resources for adding an additional microSD card to the pocketbeagle for storage. I currently have a microSD click from MikroElektronika but it’s not listed under the pocketbeagle “working” mikrobus.

I currently have an ethernet click working with my pocketbealge and beaglebone black using very similar code snippets. I have found resources for using a microSD card for the beaglebone black from

here

and here

and this tutorial

Will any of this translate over to the pocketbeagle?

Any information regarding this topic is welcome.

Hello all.

I was wondering if there were any resources for adding an additional
microSD card to the pocketbeagle for storage. I currently have a microSD
click from MikroElektronika but it’s not listed under the pocketbeagle
"working" mikrobus.

Oh, that's easy, prove it can work, and provide a pull request here
for both spix positions:

https://github.com/beagleboard/bb.org-overlays/

Then update the wiki.

Just because I haven't purchased that click doesn't mean it 'will not' work.. :wink:

I currently have an ethernet click working with my pocketbealge and
beaglebone black using very similar code snippets. I have found resources
for using a microSD card for the beaglebone black from

here

and here

and this tutorial

Will any of this translate over to the pocketbeagle?

There's a new driver in v4.14.x? and a device tree node; "mmc-slot"
CONFIG_MMC_SPI

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/mmc/mmc-spi-slot.txt

Regards,

I found it in the 4.9 driver and made an attempt to build it natively as a module and give it a try:

https://gist.github.com/jadonk/53ae22d550021bf32a299acbd7b546aa

I optimized the loading time for the git clone with a shallow checkout. The build happens pretty fast. It didn’t load for me at first. I was able to load it, by doing a depmod and modprobe manually, but it never reports anything beyond:

mmc_spi spi2.1: SD/MMC host mmc3, no WP, no poweroff

So, got any ideas? How should I specify the interrupts?

Okay i got Jason's overlay working:

CD isn't working, looks more like a driver problem:

https://github.com/beagleboard/bb.org-overlays/commit/d83490f8f4d0b61e123ad2086b057f48dc84b3c0

debian@beaglebone:~$ sudo hdparm -tT /dev/mmcblk0

/dev/mmcblk0:
Timing cached reads: 476 MB in 2.00 seconds = 237.65 MB/sec
Timing buffered disk reads: 66 MB in 3.03 seconds = 21.80 MB/sec

debian@beaglebone:~$ sudo hdparm -tT /dev/mmcblk1

/dev/mmcblk1:
Timing cached reads: 100 MB in 2.00 seconds = 49.96 MB/sec
Timing buffered disk reads: 4 MB in 3.29 seconds = 1.22 MB/sec

debian@beaglebone:~$ dmesg | grep mmc1
[ 0.909930] mmc_spi spi0.0: SD/MMC host mmc1, no WP, no poweroff, cd polling
[ 0.954369] mmc1: host does not support reading read-only switch,
assuming write-enable
[ 0.954396] mmc1: new SDHC card on SPI
[ 0.956952] mmcblk1: mmc1:0000 00000 14.6 GiB

debian@beaglebone:~$ cat /boot/uEnv.txt | grep SPI
uboot_overlay_addr0=/lib/firmware/PB-SPI0-MICROSD-CLICK.dtbo

debian@beaglebone:~$ zcat /proc/config.gz | grep MMC_SPI
CONFIG_MMC_SPI=y

Regards,

Im having trouble executing this command


git fetch origin/4.9 --depth 1

Im consistently getting the error

fatal: 'origin/4.9' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.4


How can I get the correct access rights to run the 4.9 kernel?

With Robert’s integration, there’s no longer a need to debug my steps. Use /opt/scripts/tools/update_kernel.sh to get the latest 4.9 kernel. Googling for that script name should get sufficient instructions. Once on that kernel, do the /boot/uEnv.txt edit as indicated.

I’ve gotten the sd card overlay working, thank you for the help! Now I’m trying to read and write a file to it in python but am struggling finding the directory that it is in. Any idea on how to locate this path?

Hi
I am trying the same thing with Beagle bone green board.
Can u help me in this as you mentioned that it worked for you.
Thanks
Karishma

Hi Karishma,

Since Jason and Robert helped me out so much there shouldn’t be too much to do.
Beagle bone green and pocket beagle use the same debian version.
So I’d assume you just have to load the latest version and then edit the uEnv.txt like I did. https://github.com/beagleboard/pocketbeagle/wiki/Click-boards™

If that doesn’t work for you I’d suggest posting a new question because I am by no means an expert.

Regards,
Jack