2010-12-16 20:41:06     Using the simulator peripherals

Document created by Aaronwu Employee on Oct 16, 2013
Version 1Show Document
  • View in full screen mode

2010-12-16 20:41:06     Using the simulator peripherals

Akash Agarwal (UNITED STATES)

Message: 96821   

 

HI all,

 

I am working under Prof Schirner, at Northeastern University.

 

We are trying to use the  blackfin simulator provided with the tool chain as a library inside  another simulator.

 

I have two issues using the simulator.

 

1) I am not able to use the perihperal components, it is asking for the reg property

 

[agarwal@localhost src]$ bfin-elf-run --trace-insn --trace-linenum --v --hw-device bfin_uart  --model bf527 gpio_counter

/bfin_uart: Missing "reg" property

Quit Simulator

 

Is there any info I am missing

 

2) Is there any library available  for simulator ,like libsim.a ?

 

Thanks

 

QuoteReplyEditDelete

 

 

2010-12-16 21:10:18     Re: Using the simulator peripherals

Mike Frysinger (UNITED STATES)

Message: 96822   

 

unfortunately, the lack of support for embedding SoC device trees has made the setup a little unfriendly.  what the GNU sim people expect is for people to manually describe the entire device tree themselves and then pass that to the sim.  ive tried to make things easier on users and build up device trees for them based purely on the --model option.

 

so, what that means for you is that you dont need that "--hw-device bfin_uart".  the sim already takes care of declaring the bfin_uart peripheral for you.

 

if you want to see the proper device tree syntax, then load up gdb and do something like:

$ bfin-elf-gdb /tftpboot/u-boot

(gdb) target sim --model bf527 --env operating

Connected to the simulator.

(gdb) load

Loading section .text.pre, size 0x6004 lma 0x3fc0000

Loading section .text.init, size 0x1d4 lma 0x3fc6004

Loading section .text, size 0x154d8 lma 0x3fc61d8

Loading section .rodata, size 0xa62c lma 0x3fdb6b0

Loading section .data, size 0x840 lma 0x3fe5cdc

Loading section .u_boot_cmd, size 0x674 lma 0x3fe651c

Loading section .text_l1, size 0x2c lma 0x3fe6b90

Start address 0x3fc0000

Transfer rate: 1269216 bits in <1 sec.

(gdb) break *start

Breakpoint 1 at 0x3fc0000: file start.S, line 52.

(gdb) run

Starting program: /tftpboot/u-boot

 

Breakpoint 1, start () at start.S:52

52              sp.l = LO(L1_SRAM_SCRATCH_END - 20);

Current language:  auto; currently asm

(gdb) sim hw-list

/

/core

/core/bfin_cec

/core/bfin_cec/reg 0xffe02100 0x14

/core/bfin_ctimer

/core/bfin_ctimer/reg 0xffe03000 0x10

/core/bfin_ctimer > ivtmr ivtmr /core/bfin_cec

/core/bfin_evt

/core/bfin_evt/reg 0xffe02000 0x40

/core/bfin_mmu

/core/bfin_mmu/reg 0xffe00000 0x2000

/core/bfin_trace

/core/bfin_trace/reg 0xffe06000 0x104

/core/bfin_ebiu_amc

/core/bfin_ebiu_amc/reg 0xffc00a00 0xc

.................

QuoteReplyEditDelete

 

 

2010-12-16 21:12:51     Re: Using the simulator peripherals

Mike Frysinger (UNITED STATES)

Message: 96823   

 

as for libsim.a, there is one compiled up, but we currently dont retain/install it with the binary toolchain.  you'll have to build it up yourself.  fortunately, this is easy to do.

 

get the binutils-2.17/ tree from the Blackfin toolchain svn and simply run:

./configure --target=bfin-elf

make

 

you should now have all the fun files like ./gdb/gdb and ./sim/bfin/run and ./sim/bfin/libsim.a.

 

if you want to build everything for debugging, you could also do:

CFLAGS="-O0 -g" ./configure --target=bfin-elf

rm -f */config.cache

make

QuoteReplyEditDelete

 

 

2010-12-17 02:04:18     Re: Using the simulator peripherals

Akash Agarwal (UNITED STATES)

Message: 96828   

 

Thanks a lot I could see the hardware list.

QuoteReplyEditDelete

 

 

2010-12-17 02:07:53     Re: Using the simulator peripherals

Akash Agarwal (UNITED STATES)

Message: 96830   

 

I have some problem getting in the make stage it gives the following error.

 

..

 

Making all in po

make[4]: Entering directory `/home/Downloads/bfin-2010RC1-RC4/binutils-2.17/gas/po'

make[4]: Nothing to be done for `all'.

make[4]: Leaving directory `/home/Downloads/bfin-2010RC1-RC4/binutils-2.17/gas/po'

make[4]: Entering directory `/home/Downloads/bfin-2010RC1-RC4/binutils-2.17/gas'

gcc -DHAVE_CONFIG_H -I. -I.././gas -I. -D_GNU_SOURCE -I. -I.././gas -I../bfd -I.././gas/config -I.././gas/../include -I.././gas/.. -I.././gas/../bfd -I.././gas/../intl -I../intl -DLOCALEDIR="\"/usr/local/share/locale\""   -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -c .././gas/config/tc-bfin.c

cc1: warnings being treated as errors

.././gas/config/tc-bfin.c:1963: warning: no previous prototype for ‘bfin_loop_attempt_create_label’

make[4]: *** [tc-bfin.o] Error 1

make[4]: Leaving directory `/home/Downloads/bfin-2010RC1-RC4/binutils-2.17/gas'

make[3]: *** [all-recursive] Error 1

make[3]: Leaving directory `/home/Downloads/bfin-2010RC1-RC4/binutils-2.17/gas'

make[2]: *** [all] Error 2

make[2]: Leaving directory `/home/Downloads/bfin-2010RC1-RC4/binutils-2.17/gas'

make[1]: *** [all-gas] Error 2

make[1]: Leaving directory `/home/Downloads/bfin-2010RC1-RC4/binutils-2.17'

make: *** [all] Error 2

QuoteReplyEditDelete

 

 

2010-12-17 02:28:10     Re: Using the simulator peripherals

Akash Agarwal (UNITED STATES)

Message: 96831   

 

Hi,

 

I had problem running the make for the entire binutils but I could configure and make for the sim

 

So i able to generate the run , and libsim.a

 

Thanks a lot for the help.

QuoteReplyEditDelete

 

 

2010-12-17 08:33:24     Re: Using the simulator peripherals

Mike Frysinger (UNITED STATES)

Message: 96845   

 

pass --disable-werror to configure

QuoteReplyEditDelete

 

 

2011-02-09 01:30:16     Re: Using the simulator peripherals

Akash Agarwal (UNITED STATES)

Message: 98004   

 

Thanks Mike for your help.

 

I have been going through the gdb simulator for Blackfin, and as stated in  earlier post  we are trying to integrate the simulator with a another tool,

 

To be able to  communicated with the simulator, we want to connect the device on the Asynchronous Memory BUS(AMB)

As i see from the implementation for the EBIU when a write is made on the EBIU attaches a memory bank  to  the core through

the sim_core_attach function and for reading thrgh the EBIU it directely reads through the mmr region.

 

So if we want to connect a device on the asynchronous bus should we attach another device which communicates with the EBIU or we should have a new device attached to the SIC through which we can communicate with the simulator.

 

As I see that the bfin  simulator uses the standard interfaces  of the gdb-sim for its working a little more insight of the gdb simulator for blackfin will help me a lot

 

Regards,

 

Akash.

QuoteReplyEditDelete

 

 

2011-02-09 10:12:13     Re: Using the simulator peripherals

Mike Frysinger (UNITED STATES)

Message: 98030   

 

what version of software are you looking at ?  i redid things a bit in trunk to make it easy to attach devices to the amc.

 

for example, to attach a CFI flash, you'd do:

/core/bfin_ebiu_amc/cfi/reg 0 4

 

this tells the sim that you're attaching the "cfi" device to bank 0 and are using 4 banks total.  now the amc will direct all accesses to banks 0,1,2,3 to the child device "cfi".

QuoteReplyEditDelete

 

 

2011-02-09 10:28:39     Re: Using the simulator peripherals

Akash Agarwal (UNITED STATES)

Message: 98035    Thanks a lot.

 

 

> I have checked out the tool chain from tags\2010R1-RC4

QuoteReplyEditDelete

 

 

2011-02-09 11:33:00     Re: Using the simulator peripherals

Mike Frysinger (UNITED STATES)

Message: 98036   

 

for sim development, you'll probably want to use toolchain trunk.  it's pretty stable.

QuoteReplyEditDelete

 

 

2011-02-18 01:32:24     Re: Using the simulator peripherals

Akash Agarwal (UNITED STATES)

Message: 98238   

 

Hi Mike,

 

I have a problem running a program on the simulator. I tried to run the standalone examples provided with the toolchain on the simulator, but got error as follows.

 

I tried changing the operating modes as I saw in the testsuites provided that some examples failed in the operating mode.

 

[agarwal@localhost blink]$ bfin-elf-run --model bf537 --env operating blink

_cec_raise: double fault at 0xffa000b6 !

 

[agarwal@localhost blink]$ bfin-elf-run --model bf537 --env virtual blink

program stopped with signal 11 (Segmentation fault).

 

[agarwal@localhost blink]$ bfin-elf-run --model bf537 --env user blink

program stopped with signal 11 (Segmentation fault).

 

Is there something wrong in which i am trying to run the simulator, or is there something which the simulatore does not support ?

 

I have been also trying to follow up with your adivce of attaching a hw with the ebiu.

 

But as far as i understand the device would have to be listed in the machs.c file for the simulator to be able to attach.Some more information on your advice will certainly help me a lot.

 

If possible can you guide me to some docs/post/mailing list about the gdb simulator iternals that should help me a lot.

 

Thanks for all your help.

 

Akash

QuoteReplyEditDelete

 

 

2011-02-18 07:56:19     Re: Using the simulator peripherals

Mike Frysinger (UNITED STATES)

Message: 98252   

 

the crashes with virtual/user env are expected.  you cant access processor MMRs in those.

 

the crash with the operating env is due to this simple TODO:

TODO:handle DSPID at 0xffe05000

 

you can see that by simply enabling the trace features:

$ bfin-elf-run --env operating --model bf537 --trace-core -t ./blink |& tail

core:     0xffa000b2 #251  __start                         -IBUS FETCH 2 bytes @ 0xffa000b4: 0xffe0

insn:     0xffa000b2 #251  __start                         -P0.H = 0xffe0;

reg:      0xffa000b2 #251  __start                         -wrote P0 = 0xffe05000

reg:      0xffa000b2 #251  __start                         -wrote CYCLES = 0x13

reg:      0xffa000b2 #251  __start                         -wrote PC = 0xffa000b6

core:     0xffa000b6 #252  __start                         -IBUS FETCH 2 bytes @ 0xffa000b6: 0x9100

insn:     0xffa000b6 #252  __start                         -R0 = [P0];

reg:      0xffa000b6 #252  __start                         -wrote EXCAUSE = 0x2e (SEQSTAT = 0x2e)

reg:      0xffa000b6 #252  __start                         -wrote EXCAUSE = 0x25 (SEQSTAT = 0x25)

_cec_raise: double fault at 0xffa000b6 !

 

since the blink app starts at EVT0 and hasnt lowered itself, and it tries to access a core MMR that doesnt exist, it triggers an exception.  but doing so at EVT3 or higher means the core double faults.

 

i can take a look at enabling DSPID support in the sim, but to work around it, you could just avoid reading that MMR.

 

to add arbitrary devices, you do not need to modify machs.c.  simply use the new --hw-board-file file and give it a device tree.  so to hook up a CFI flash, take that snippet i posted, put it into a plain text file, and pass that file to that option.

 

sorry, but there arent any guides i'm aware of to the sim internals.  the common/*.h files tend to have good documentation on specific functions, but that's about it.  which for now, makes me your guide :p.

QuoteReplyEditDelete

 

 

2011-02-18 08:20:53     Re: Using the simulator peripherals

Mike Frysinger (UNITED STATES)

Message: 98253   

 

ive added a simple jtag model which supports DSPID to svn trunk.  now blink doesnt crash.

 

core:     0xffa000ae #250  __start                         -IBUS FETCH 2 bytes @ 0xffa000ae: 0xe108

core:     0xffa000ae #250  __start                         -IBUS FETCH 2 bytes @ 0xffa000b0: 0x5000

insn:     0xffa000ae #250  __start                         -P0.L = 0x5000;

reg:      0xffa000ae #250  __start                         -wrote P0 = 0xffe05000

reg:      0xffa000ae #250  __start                         -wrote CYCLES = 0x12

reg:      0xffa000ae #250  __start                         -wrote PC = 0xffa000b2

core:     0xffa000b2 #251  __start                         -IBUS FETCH 2 bytes @ 0xffa000b2: 0xe148

core:     0xffa000b2 #251  __start                         -IBUS FETCH 2 bytes @ 0xffa000b4: 0xffe0

insn:     0xffa000b2 #251  __start                         -P0.H = 0xffe0;

reg:      0xffa000b2 #251  __start                         -wrote P0 = 0xffe05000

reg:      0xffa000b2 #251  __start                         -wrote CYCLES = 0x13

reg:      0xffa000b2 #251  __start                         -wrote PC = 0xffa000b6

core:     0xffa000b6 #252  __start                         -IBUS FETCH 2 bytes @ 0xffa000b6: 0x9100

insn:     0xffa000b6 #252  __start                         -R0 = [P0];

/core/bfin_jtag: read 0xffe05000 (DSPID) length 4

core:     0xffa000b6 #252  __start                         -DBUS FETCH 4 bytes @ 0xffe05000: 0xe5040000

reg:      0xffa000b6 #252  __start                         -wrote R0 = 0xe5040000

QuoteReplyEditDelete

 

 

2011-02-19 02:00:22     Re: Using the simulator peripherals

Akash Agarwal (UNITED STATES)

Message: 98261   

 

Hi Mike,

 

Thanks a lot for your detailed explanation.

 

I was able to run the blink example and it does not generate double exception fault thanks to your code changes.

 

But i hade to modify the  #define BFIN_COREMMR_WP_BASE    0xFFE06000 to 0XFFE07000 otherwise it gave me a memory overlaps error as follows:

/core/bfin_wp: memory map 0:0xffe06000..0xffe06203 (516 bytes) overlaps 0:0xffe06000..0xffe06103 (260 bytes)

Quit Simulator

 

I was also able to attach the cfi device, with the procedure that you had mentioned thanks a lot for the description.

 

I am glad to have you as my guide, look forward for further guidance and help.

 

Thanks

 

Akash

 

 

 

QuoteReplyEditDelete

 

 

2011-02-19 12:36:35     Re: Using the simulator peripherals

Mike Frysinger (UNITED STATES)

Message: 98265   

 

sorry about that typo ... should be fixed in trunk now

QuoteReplyEditDelete

 

 

2011-03-14 20:45:08     Re: Using the simulator peripherals

Akash Agarwal (UNITED STATES)

Message: 98932   

 

Hi Mike,

 

Thanks to your help.

 

I am able to attach device to the EBIU and direct the EBIU bus traffic.

 

Now i was looking for generating interrupts in the simulator,What i found out that within the gdb-sim hw_port_event is used to generate the interrupts on the device port.

 

To be able to generate an interrupt from outside, i need a input port. So i was looking for the GPIO ports (port F,G or H ), but i could not find the devices in the device list.But i do see the mapping of these ports in the sic(dv-bfin-sic.c).

 

Is there something that i am missing.

 

If the GPIO device is not implemented the only other solution I can think is to create a I/O port on the device and generate an interrrupt using it, and

 

Please let me know if there are any plans of having the GPIO ports in the gdb-sim

 

Please guide me .

 

Thanks

 

Akash

QuoteReplyEditDelete

 

 

2011-03-15 00:02:04     Re: Using the simulator peripherals

Mike Frysinger (UNITED STATES)

Message: 98933   

 

there isnt any GPIO support atm because i couldnt think of how it would be used, and no one else has implemented anything.

 

i guess you simply want an API to set the level of a line ?

QuoteReplyEditDelete

 

 

2011-03-15 04:31:34     Re: Using the simulator peripherals

Mike Frysinger (UNITED STATES)

Message: 98942   

 

you should be able to use the normal hw_port_event() now.  the value is respected for its level.

QuoteReplyEditDelete

 

 

2011-03-18 13:22:24     Re: Using the simulator peripherals

Akash Agarwal (UNITED STATES)

Message: 99048   

 

Thanks a lot mike for adding the gpio device,

 

I am able to add a device and attach the device to gpio pins and connect it to ebiu for the data transfer.

 

Now i need to be able to call the device from outside the simulator in order to generate the interrupt on the gpio.

 

The way i think it is possible is using the hw_tree_find_device function to locate the  device in the tree and call the function to set and clear interrupts.

 

Is this approach correct or is there any other better way ?

 

Thanks

 

Akash

QuoteReplyEditDelete

 

 

2011-03-18 14:04:31     Re: Using the simulator peripherals

Mike Frysinger (UNITED STATES)

Message: 99051   

 

that is the best way i know of in common code.  the Blackfin code also provides a simpler dv_get_device() in bfin/devices.h.

QuoteReplyEditDelete

 

 

2011-03-19 10:44:22     Re: Using the simulator peripherals

Akash Agarwal (UNITED STATES)

Message: 99068   

 

Thanks again Mike,

 

I have been able to generate interrupt on the gpio pins.

 

But i think in the hardware list the gpio mapping is not allright.

 

The gpio port only comes up once in the hw -list whereas it should be there three times for port f,g,h

 

It looks the like the address for port F works and pin connectivity for Port H works.

 

I could see that the in machs.c file the

 

sim_hw_parse() is called for each of the porf ,g and h but I could not see the

 

attach_bfin_gpio_regs() in device dv-gpio.c called for each of the ports.

 

Attached is hw trace of the simulator

 

 

 

Thanks a lot for ur help

 

hw-trace.txt

QuoteReplyEditDelete

 

 

2011-03-19 15:12:03     Re: Using the simulator peripherals

Mike Frysinger (UNITED STATES)

Message: 99070   

 

blah, brain fart.  should be fixed now in trunk by using valid bus addresses.

QuoteReplyEditDelete

 

 

2011-03-21 19:54:52     Re: Using the simulator peripherals

Akash Agarwal (UNITED STATES)

Message: 99107   

 

Thanks Mike for the quick response.

 

With your help I have been able to generate an interrupt on the GPIO and execute the ISR for the device as well.

 

But I had to make the following changes:

 

1)File : dv-bfin_gpio.c

 

Function :bfin_gpio_port_event

 

Earlier Code :

 

/* Just one edge.  */

      if (!(((port->polar & bit) && olvl > nlvl)

        || (!(port->polar & bit) && olvl < nlvl)))

 

Modification :  

 

    // exit if falling required but rising edge

      if( ((port->polar & bit) && olvl < nlvl) ||

          // exit if rising required but falling edge

          !(port->polar & bit) && olvl > nlvl ){

 

 

 

2)File dv-bfin_sic.c

 

Function : bfin_sic_52x_port_event

 

Earlier code: bu32 bit = (1 << (my_port & 0x1f));

 

Modification :  bu32 bit = (1 << ((my_port%100) & 0x1F));

 

Thanks again for the help.

 

QuoteReplyEditDelete

 

 

2011-03-21 20:09:33     Re: Using the simulator peripherals

Mike Frysinger (UNITED STATES)

Message: 99108   

 

thanks, i didnt have any way of testing the gpio logic.  i just kind of eye balled it ;).

 

the bfin_sic part is annoying.  i confused 100 and 0x100.  seems the bf54x and bf56x port forwarders have the same bug.  i'll probably rewrite the port ids so that i can stick to hex math.

QuoteReplyEditDelete

 

 

2011-03-22 22:06:52     Re: Using the simulator peripherals

Mike Frysinger (UNITED STATES)

Message: 99140   

 

ive rewritten the SIC pin encoding now.  could you update and make sure that things still work for you ?

QuoteReplyEditDelete

 

 

2011-03-22 23:54:15     Re: Using the simulator peripherals

Akash Agarwal (UNITED STATES)

Message: 99141    > Yes it works, is the gpio modifications that we did correct ?

QuoteReplyEditDelete

 

 

2011-03-23 00:00:06     Re: Using the simulator peripherals

Mike Frysinger (UNITED STATES)

Message: 99142   

 

yes, i'll be checking those in shortly

QuoteReplyEditDelete

 

 

2011-03-23 11:36:20     Re: Using the simulator peripherals

Mike Frysinger (UNITED STATES)

Message: 99168   

 

hmm, thinking about it a bit more, the new code you propose doesnt handle levels (olvl == nlvl).  it also seems to be missing paren around the second check ... otherwise you have: (w && x) || y && z.  not sure gcc is handling that the way you expect, but it should warn about it when compiling.

 

that's why i encoded things the way i did ... check the conditions where an interrupt would occur, and then negate the result.  so if an interrupt *doesnt*, we return.

QuoteReplyEditDelete

 

 

2011-03-23 22:43:12     Re: Using the simulator peripherals

Mike Frysinger (UNITED STATES)

Message: 99170   

 

i wrote up some tests using the dv-glue driver and fixed a bunch of random bugs in the handler.  please see if these fix your issues too.

 

this is the simple board device file i'm using:

/core/glue/reg 0x30000000 8

/core/glue > 0 p0 /core/bfin_gpio@5

/core/glue > 1 p1 /core/bfin_gpio@5

 

writing 0 or 1 to 0x30000000 will set the PF0 line, and writing 0 or 1 to 0x30000004 will set the PF1 line.  this makes it easy to test level/edge interrupts for gpio lines.

QuoteReplyEditDelete

 

 

2011-03-24 16:36:53     Re: Using the simulator peripherals

Akash Agarwal (UNITED STATES)

Message: 99220   

 

Hi Mike,

 

I checked with the new code it works,

 

Thanks a lot.

 

Test bench:

 

I have created a device which dv-fpga which is attached to the ebiu memory banks  and its pins are connected to gpio.

 

as follows :

 

1 /core/bfin_ebiu_amc/fpga/reg 0 3

  2 /core/bfin_ebiu_amc/fpga > p0 p0 /core/bfin_gpio@5

  3 /core/bfin_ebiu_amc/fpga > p1 p1 /core/bfin_gpio@5

  4 /core/bfin_ebiu_amc/fpga > p2 p2 /core/bfin_gpio@5

  5 /core/bfin_ebiu_amc/fpga > p3 p3 /core/bfin_gpio@5

  6 /core/bfin_ebiu_amc/fpga > p4 p4 /core/bfin_gpio@5

  7 /core/bfin_ebiu_amc/fpga > p5 p5 /core/bfin_gpio@5

  8 /core/bfin_ebiu_amc/fpga > p6 p6 /core/bfin_gpio@5

  9 /core/bfin_ebiu_amc/fpga > p7 p7 /core/bfin_gpio@5

10 /core/bfin_ebiu_amc/fpga > p8 p8 /core/bfin_gpio@5

11 /core/bfin_ebiu_amc/fpga > p9 p9 /core/bfin_gpio@5

12 /core/bfin_ebiu_amc/fpga > p10 p10 /core/bfin_gpio@5

13 /core/bfin_ebiu_amc/fpga > p11 p11 /core/bfin_gpio@5

14 /core/bfin_ebiu_amc/fpga > p12 p12 /core/bfin_gpio@5

15 /core/bfin_ebiu_amc/fpga > p13 p13 /core/bfin_gpio@5

16 /core/bfin_ebiu_amc/fpga > p14 p14 /core/bfin_gpio@5

 

 

When i write to a address 0x20060000 fr example, from my example code it generates an interrupt. and it executes the ISR which i have registered earlier.

 

if it helps for your testing I can share my code as well.

 

Thanks

 

Akash

QuoteReplyEditDelete

 

 

2011-03-24 16:42:12     Re: Using the simulator peripherals

Mike Frysinger (UNITED STATES)

Message: 99221   

 

when testing things, i noticed that the SIC behavior isnt exactly optimal.  i outlined the issue in the TODO file.  so if you're seeing interrupts continuing to fire when they shouldnt, you might want to check this.

 

unfortunately, the only workaround i have atm is to update SIC_IMASK and manually clear ILAT in the CEC.  and that's not really scalable.

 

if this becomes a real issue for you, let me know and i can look into making it work.  unless you get to it before me ;).

QuoteReplyEditDelete

 

 

2011-06-02 11:41:06     Re: Using the simulator peripherals

Akash Agarwal (UNITED STATES)

Message: 100980   

 

Hi Mike,

 

I have been able to successfully integrate the simulator in the system design framework.

 

We have been trying to run some test on it.

 

We found some problem with the gpio peripheral simulation code )dv-bfin_gpio.c .

 

1)

 

Presnt code: -

 

  /* Only screw with state if this pin is set as an input.  */

--//  if (!(port->dir & port->inen & bit))

 

Proposed code :-

 

  // exit if output       or  not input

  if ( (port->dir & bit ) || !(port->inen & bit)){

    return;

  }

 

2) The gpio port clear does not have any functionality.

 

As a result if we have multiple interrupts on the gpio we are not able to get the desired behaviour.

 

Can you please let me know how do you plan to test the code as well, can we be any help to you with this.

 

Thanks

 

Akash

QuoteReplyEditDelete

 

 

2011-06-02 11:52:09     Re: Using the simulator peripherals

Mike Frysinger (UNITED STATES)

Message: 100981   

 

i think your svn tree is out of date wrt (1).  that should already be fixed.

 

as for (2), i mentioned this problem earlier.  the gpio clear mmr you refer to only tweaks the mask, it doesnt affect the pin state.  i have a completely rewritten sic/int handling in my local git tree which fixes this problem in general, but i havent been able to get UART/DMA working again with Linux just yet, so i havent committed it.

 

you can find that work here:

http://blackfin.uclinux.org/git/?p=sourceware.org/gdb.git;a=shortlog;h=refs/heads/vapier

Attachments

Outcomes