Hi, I have to backpedal to what I said. I forgot to do a sudo make install so I was still running code without this change... Sorry. Now with this code I get a mmap error bad argument.
I was able to make code run and get a profile but I had to change the code in fact exactly in the way of my original code. First for some reason the address 0x7e10002c for some reason is remapped somwhere else. My guess is like this becasue the code to access address 0x7e2000XX is #define BCM2835_PERI_BASE 0x20000000 #define BCM2835_GPIO_BASE (BCM2835_PERI_BASE + 0x200000) /* GPIO controlle I guess also that we have to mmap from some block boundaries. I have not checked that I really get more current (not so easy but I will try) but at least code run on a short vsf file I will come in another mail into study of the profile. pi@polar-pi ~/openocd-git/src/jtag/drivers $ git diff diff --git a/src/jtag/drivers/bcm2835gpio.c b/src/jtag/drivers/bcm2835gpio.c index 1f6e241..2a1757a 100644 --- a/src/jtag/drivers/bcm2835gpio.c +++ b/src/jtag/drivers/bcm2835gpio.c @@ -33,7 +33,7 @@ #define BCM2835_PERI_BASE 0x20000000 #define BCM2835_GPIO_BASE (BCM2835_PERI_BASE + 0x200000) /* GPIO controlle -#define BCM2835_PADS_GPIO_0_27 0x7e10002c +#define BCM2835_PADS_GPIO_0_27 (BCM2835_PERI_BASE + 0x100000) /* GPIO setup macros */ #define MODE_GPIO(g) (*(pio_base+((g)/10))>>(((g)%10)*3) & 7) @@ -107,7 +107,7 @@ static void bcm2835gpio_reset(int trst, int srst) uint32_t clear = 0; if (trst_gpio > 0) { - set |= !trst<<trst_gpio; + set |= !trst<<trst_gpio; clear |= trst<<trst_gpio; } @@ -250,8 +250,8 @@ static const struct command_registration bcm2835gpio_command @@ -250,8 +250,8 @@ static const struct command_registration bcm2835gpio_command .mode = COMMAND_CONFIG, .help = "gpio number for tms.", }, - { - .name = "bcm2835gpio_tdo_num", + { + .name = "bcm2835gpio_tdo_num", .handler = &bcm2835gpio_handle_jtag_gpionum_tdo, .mode = COMMAND_CONFIG, .help = "gpio number for tdo.", @@ -326,12 +326,12 @@ static int bcm2835gpio_init(void) MAP_SHARED, dev_mem_fd, BCM2835_PADS_GPIO_0_27); if (pads_base == MAP_FAILED) { - perror("mmap"); + perror("mmap1"); close(dev_mem_fd); return ERROR_JTAG_INIT_FAILED; } - *pads_base = 0x5a000018 + 7; /* 16mA drive strength */ + *(pads_base + 11)= 0x5a000018 + 7; /* 16mA drive strength */ tdo_gpio_mode = MODE_GPIO(tdo_gpio); tdi_gpio_mode = MODE_GPIO(tdi_gpio); On 09/19/2013 07:11 PM, Paul Fertser wrote: > Hi, > > On Thu, Sep 19, 2013 at 06:13:49PM +0200, Nicolas Produit wrote: >> it looks good. >> Nothing burned. > > Nothing could have been burned just because RPi should be using > stronger pulls to drive the GPIO lines :) It would be nice if you > confirmed that with a 'scope as I do not have neither RPi nor > oscilloscope handy. > >> This time it is running since at least 30 minutes... >> Veeeeery slow! The svf file is 17M. > > That's very slow indeed. I've seen RPi fetching data from an stm32 > with 88.538 kibibytes/s rate. If you're sure your SVF file doesn't set > the frequency too low (you can play with the value by hand-editing > it), you can try profiling openocd itself. For that use > > CFLAGS="-pg" ./configure --enable-bcm2835gpio > > And feed it some smaller SVF file (you can probably just use the first > N lines from your 17M one). After OpenOCD finishes, a gmon.out file > will be generated which can later be processed with "gprof" (it needs > both the binary and the output file). My runs showed all the time was > spent preparing and executing the bitbanging functions. With zero > busy-looping delays I was getting about 4MHz TCK frequency which > should be enough to flash your FPGA in reasonable time. > > HTH > -- Nicolas Produit ISDC, Data Centre for Astrophysics Phone:+41 22 379 2140 16, Chemin d'Ecogia Fax: +41 22 379 2133 CH-1290 Versoix www: http://isdc.unige.ch/~produit ------------------------------------------------------------------------------ LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk _______________________________________________ OpenOCD-devel mailing list OpenOCD-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openocd-devel