<div dir="ltr"><div><font color="#500050">Dear Federico Garcia, </font></div><div><font color="#500050"><br></font></div><div><font color="#500050">Yes, I got the point. So "</font><span style="font-size:12.8px">A read of the GPIO_CLEARDATAOUT register </span><span style="font-size:12.8px">returns the value of the data output register (GPIO_DATAOUT)" is the key point behind this bug.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Thanks for reporting and debugging. </span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Ben, I think we should add the patch after proper test.</span></div><div><span style="font-size:12.8px">Also we should use mmio_write() in rtems_gpio_bsp_multi_set() and rtems_gpio_bsp_set() too that uses GPIO_SETDATAOUT register. </span></div><div><br></div><div><span style="font-size:12.8px">Regards,</span></div><div><span style="font-size:12.8px">Ketul<br></span><div class="gmail_extra"><br><div class="gmail_quote">On 12 November 2015 at 01:08, Federico Garcia Cruz <span dir="ltr"><<a href="mailto:federico.garciacruz@tallertechnologies.com" target="_blank">federico.garciacruz@tallertechnologies.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Ketul,<div>you should use the mmio_write() in the gpio clear bit register, if you mantain the value of the complete bank you would clear not just the gpio number that you want but all the gpios that current value is 1.</div><div>Here's what the data sheet says about this register:</div><div><br></div><div><div>GPIO_CLEARDATAOUT is shown in Figure 25-31 and described in Table 25-30.</div><div>Writing a 1 to a bit in the GPIO_CLEARDATAOUT register clears to 0 the corresponding bit in the</div><div>GPIO_DATAOUT register; writing a 0 has no effect. A read of the GPIO_CLEARDATAOUT register</div><div>returns the value of the data output register (GPIO_DATAOUT).</div></div><div><br></div><div>It's described in the section 25.4.1.25 GPIO_CLEARDATAOUT of the AM335x_technical_reference_manual.pdf.</div></div><div class=""><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2015-11-11 16:29 GMT-03:00 Ketul Shah <span dir="ltr"><<a href="mailto:ketulshah1993@gmail.com" target="_blank">ketulshah1993@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi All,<div><br></div><div>Dear Federico Garcia,</div><div><br></div><div>I really appreciate your great efforts. My views on this are :- </div><div><br></div><div>Following are the macros from bsp.h</div><div><br></div><div>#define mmio_write(a,v) (*(volatile uint32_t *)(a) = (v)) </div><div>#define mmio_set(a,v) mmio_write((a), mmio_read((a)) | (v))<br></div><div><br></div><div>So purpose of using mmio_set() is to make change on the desired bit only (not the whole bank).</div><div>While using of mmio_write() will always make change on 32 bits (Value of desired bit would be 1 and rest would be forced to 1), the bank.</div><div><br></div><div>However I will try to test your code too on my BBB after a small Diwali vacation. </div><div><br></div><div>Latest RTEMS was tested OK by me as well as Ben.</div><div><br></div><div>Thanks & Regards,</div><div>Ketul</div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 12 November 2015 at 00:21, Federico Garcia Cruz <span dir="ltr"><<a href="mailto:federico.garciacruz@tallertechnologies.com" target="_blank">federico.garciacruz@tallertechnologies.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi all,<div>we've been working with the latest rtems on the Beaglebone and we've seen the same behavior Steve B describes.<div>Finally we've found what is the source of this <span style="font-size:12.8px">unexpected </span>behavior. </div><div>As you could see in bbb-gpio.c, "rtems_gpio_bsp_multi_clear" and "rtems_gpio_bsp_clear" they both use "mmio_set" on the AM335X_GPIO_CLEARDATAOUT register of the beaglebone.</div></div><div>The problem is that" mmio_set" reads the current value of the register, then it sets the bit of interest and then it writes this new value in the AM335X_GPIO_CLEARDATAOUT, but according the datasheet of the AM355X, every bit set in this register will produce a clear of the corresponding GPIO so that every GPIO in 1 will be cleared.</div><div>We changed the "mmio_set" for "mmio_write" and then tested "rtems_gpio_clear" and "rtems_gpio_multi_clear" and they are working fine.</div><div>Attached is the diff file.</div><div>Steve, could you please check if this fixes your problem too?</div><div>Thanks.</div></div><div class="gmail_extra"><div><div><br><div class="gmail_quote">2015-11-07 16:33 GMT-03:00 Gedare Bloom <span dir="ltr"><<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>On Sat, Nov 7, 2015 at 4:26 AM, André Marques<br>
<<a href="mailto:andre.lousa.marques@gmail.com" target="_blank">andre.lousa.marques@gmail.com</a>> wrote:<br>
> Hello<br>
><br>
> Às 17:31 de 02-11-2015, Steve B escreveu:<br>
><br>
> I just looked at some sample code on Ketul's github, and the source code of<br>
> the API itself, rather than any actual documentation.<br>
><br>
><br>
> Documentation on the GPIO API can be found in<br>
> <a href="https://devel.rtems.org/wiki/GSoC/2015/RaspberryPi_peripherals_and_SD_card#RTEMSGPIOAPI" rel="noreferrer" target="_blank">https://devel.rtems.org/wiki/GSoC/2015/RaspberryPi_peripherals_and_SD_card#RTEMSGPIOAPI</a><br>
><br>
</span>This deserves its own page.<br>
<div><div>_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/users</a></div></div></blockquote></div><br><br clear="all"><div><br></div></div></div>-- <br><div><div dir="ltr"><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><a href="http://www.tallertechnologies.com" style="text-decoration:none" target="_blank"><span style="font-size:16px;font-family:Arial;color:rgb(17,85,204);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:underline;vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><img src="https://lh6.googleusercontent.com/oWr5yxNDJfjF0N2yhmiSzhU9vstfXfDLCQju49Xj_5frxoG-vk_hKzOt-k3KSsZv5W5cNnZSjNmWi53XYbfiAsytvz44AptjWiDYFTLIhRiRifwjwHtlfPJmhrqmfEub1w" width="200" height="77" style="border: none;"></span></a></p><p style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><b style="font-weight:normal"><br></b></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:16px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;background-color:transparent">Federico Garcia Cruz</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;background-color:transparent">Software Engineer</span></p><p style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><b style="font-weight:normal"><br></b></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;background-color:transparent">San Lorenzo 47, 3rd Floor, Office 5</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;background-color:transparent">Córdoba, Argentina</span></p><p style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><b style="font-weight:normal"><br></b></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11px;font-family:Arial;color:rgb(0,0,0);font-weight:bold;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;background-color:transparent">Phone:</span><span style="font-size:11px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;background-color:transparent"> +54 351 4217888 / +54 351 4218211</span></p><p style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><br><a href="http://www.linkedin.com/company/taller-technologies" style="text-decoration:none" target="_blank"><span style="font-size:15px;font-family:Arial;color:rgb(17,85,204);text-decoration:underline;vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><img src="https://lh5.googleusercontent.com/-PNbLrk4FTcGDH9qlK0E9EOXNq30yjxcZdWdV1nrz0nea-2DSHK5Imha-1oItxasCqkHsragWxBQoGaM6htV8ZiSNmtX0zr_6h7l5SAekmvgRly09D1cmbVt4sQ8cKtmIQ" width="20px;" height="20px;" style="border: none;"></span></a><a href="https://www.facebook.com/tallertechnologies" style="text-decoration:none" target="_blank"><span style="font-size:15px;font-family:Arial;color:rgb(17,85,204);text-decoration:underline;vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><img src="https://lh6.googleusercontent.com/35gyAmo2veV0QIAK20LuNB8ouSDb62YfPd5NEbXdxvdLdbt8aNQo4c9SSXKUhbi8L69xj0fFH9HgavVbFraoqN04JrxkLfRzwsMLY2nTfDChb5Neflw7ezpE6_LxseIKGw" width="19px;" height="19px;" style="border: none;"></span></a><br></p></div></div>
</div>
<br>_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/users</a><br></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><a href="http://www.tallertechnologies.com" style="text-decoration:none" target="_blank"><span style="font-size:16px;font-family:Arial;color:rgb(17,85,204);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:underline;vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><img src="https://lh6.googleusercontent.com/oWr5yxNDJfjF0N2yhmiSzhU9vstfXfDLCQju49Xj_5frxoG-vk_hKzOt-k3KSsZv5W5cNnZSjNmWi53XYbfiAsytvz44AptjWiDYFTLIhRiRifwjwHtlfPJmhrqmfEub1w" width="200" height="77" style="border: none;"></span></a></p><p style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><b style="font-weight:normal"><br></b></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:16px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;background-color:transparent">Federico Garcia Cruz</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;background-color:transparent">Software Engineer</span></p><p style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><b style="font-weight:normal"><br></b></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;background-color:transparent">San Lorenzo 47, 3rd Floor, Office 5</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;background-color:transparent">Córdoba, Argentina</span></p><p style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><b style="font-weight:normal"><br></b></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11px;font-family:Arial;color:rgb(0,0,0);font-weight:bold;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;background-color:transparent">Phone:</span><span style="font-size:11px;font-family:Arial;color:rgb(0,0,0);font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;background-color:transparent"> +54 351 4217888 / +54 351 4218211</span></p><p style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><br><a href="http://www.linkedin.com/company/taller-technologies" style="text-decoration:none" target="_blank"><span style="font-size:15px;font-family:Arial;color:rgb(17,85,204);text-decoration:underline;vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><img src="https://lh5.googleusercontent.com/-PNbLrk4FTcGDH9qlK0E9EOXNq30yjxcZdWdV1nrz0nea-2DSHK5Imha-1oItxasCqkHsragWxBQoGaM6htV8ZiSNmtX0zr_6h7l5SAekmvgRly09D1cmbVt4sQ8cKtmIQ" width="20px;" height="20px;" style="border: none;"></span></a><a href="https://www.facebook.com/tallertechnologies" style="text-decoration:none" target="_blank"><span style="font-size:15px;font-family:Arial;color:rgb(17,85,204);text-decoration:underline;vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><img src="https://lh6.googleusercontent.com/35gyAmo2veV0QIAK20LuNB8ouSDb62YfPd5NEbXdxvdLdbt8aNQo4c9SSXKUhbi8L69xj0fFH9HgavVbFraoqN04JrxkLfRzwsMLY2nTfDChb5Neflw7ezpE6_LxseIKGw" width="19px;" height="19px;" style="border: none;"></span></a><br></p></div></div>
</div>
</div></div></blockquote></div><br></div></div></div>