Altera_Forum
Honored Contributor
17 years agoStrange alt_flash_open_dev() behavior
Hello,
I have some strangeness, really I am missing something, that I am having a bit of a problem tracking down. I have a new board, which I would immediately suspect before SW, however, I am able to do a SFL of an image, using a JIC file, AN370. I can actually see the device ID silicon read from the EPCS device. So that leaves me with either something in the SOPC build or the SW. Oh, I forgot, since I am using a tiny CIII, I had to get rid of the stdio.h and use the alt_stdio.h. Now, I just started with the mem_test.c as a template and just stripped it to its bare essentials; Just want to R/W to one block? Here is snippet of code where alt_flash_open is called: *********************************************** if (flash_type == EPCS) { strcpy(flashname, "/dev/epcs_flash_controller_0\0"); //debug alt_printf(" -Flash controller name is: %s\n", flashname); } //ret_code = GetFlashName(flashname, flash_type); fd = alt_flash_open_dev(flashname); ************************************************* Reading thorugh similar alt_flash_open_dev() problems on the forum, I found that the ..open_dev() function calls alt_find_dev() which has a <stdio.h> but just to me atleast seems to use just <string.h> functions. So why am I getting a return of NULL from alt_flash_open_dev()? Can I rule out SW? That would leave me with something in the SOPC builder. First I checked the pins from my compile and saw that they match up with Active Serial. Good. NOTE: Small complaint to ALtera!! :) When you build a SOPC system with the EPCS flash controller, and then populate a top level with BDF block, a seemingly natural way to build a fast SOPC system, the pins " BECKON" you to connect them to external pins. Maybe I am the only one that had trouble with this small little fact, but do not connect the pins, as the tool already knows where the pins belong. Just a rookie mistake on my part. Anyway, does the SFL use a different peripheral than the EPCS controller. In other words is the ASMI different than the EPCS flash controller? Probably? Aren't both of them just SPI controllers? I know that the ASMI for the SFL load works but not so sure about the EPCS flash controller. Regards