Beaglebone Black GPMC Tutorial

I have the same problem. I think its because I drive the inputs of the emmc on the extension header at start up. The crash is always between 1 to 5 minutes after start up.

Any idea how to solve this problem except not using this pins?

Disable the eMMC and run from the SD card. Using the pins is the easiest if you can use other pins. Driving the pins on power up, which it sounds like may not be the case here, can damage the eMMC.

Gerald

I was able to get a GPMC device tree loaded with your help, and it seems like everything is working. But how do I actually use the GPMC? I know for gpio I can just access the pins with command line using /sys/class/gpio, but that doesn’t seem to work for GPMC…

I’ve only used the GPMC in a non-linux, bare metal environment. What it boils down to is that in the course of setting up the GPMC, you are coupling an address space in the AM335x’s memory map with a particular chip select, an address space in the peripheral’s memory map, and timing information to successfully communicate with the peripheral.

So, lets say you have mapped 0x01000000 in the AM335x’s memory map to Chip Select 0, and defined the space as 16MB. If you perform a write to any address between 0x01000000 and 0x01FFFFFF, the memory controller will recognize this as a GPMC write, and will assert Chip select 0, and put the address and data on the address and data pins, using the timing information you specified.

In the case of NAND memory, and other devices that cannot be directly written to with a single address and data word, the GPMC can also be configured to perform all of the necessary actions to allow it to write to the memory.

So, to answer your question, you use the GPMC by writing to or reading from a memory address within the address space you’ve configured the GPMC to control. Performs the memory access.

Wow Todd, thanks for the great explanation! I was eventually able to figure it out by modifying the code from here. It seems like using “mmap” is the cleanest way to do it. Here’s the code I used for testing gpmc

test.c (2.63 KB)

I have downloaded the kernel and test on Overo Gumstix board.
I did not get the source code for FPGA to check the exact communication.
So i wrote myself the code which writes data to BRAM from GPMC.
in this driver i did not understand the DMA working and “RX_DATA_READY_GPIO ,TX_SPACE_AVAILABLE_GPIO” pin working

I have bypassed the dma and wrote directly data to GPMC with memcpy. but it shows very slow speed.
The time between two packets transfer is round about 8ms. its huge time how can i reduce this time.
//============
for(i=0;i<100;i++)
n = write(fp, buf, Wbytes);
//==============

is there the FPGA code and c user level(application) code available to test the driver?

Hi Todd,

I am trying the GPMC interface on AM335x for VFD (Vacuum Flouroscent Dsiplay) interface. I have configured the GPMC_config_registers and trying to Write into the configured memory address but the code crashes with exception. Not sure what is going wrong. I am trying this on TI starterware (OS less) environment using CCS. I have posted a question in TI e2e forum

https://e2e.ti.com/support/embedded/starterware/f/790/t/490638

I am not connecting the actual VFD panel but just trying to debug this code. It crashes when i’m writing a byte to the configured GPMC address. Can you please review this and suggest me what is wrong here.

Thanks,
Seetaram